Skip to content

Commit 1e9e281

Browse files
Changes after review.
1 parent e87e1c4 commit 1e9e281

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

dd-smoke-tests/play-2.8/build.gradle

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,22 @@ configurations.testImplementation {
7272
exclude group: 'com.typesafe.play', module: "play-test_$scalaVer"
7373
}
7474

75-
// Fix for flaky test on CI: Source directory '/dd-smoke-tests/play-2.8/build/src/play/routes' is not a directory.
75+
// Fix for flaky error: Source directory '/dd-smoke-tests/play-2.8/build/src/play/routes' is not a directory.
7676
// Probably, GitLab somehow creates (or restores from cache) file instead of folder.
77-
def isCI = System.getenv("CI") != null
78-
79-
if (isCI) {
80-
tasks.register('fixPlayRoutesDirectory') {
81-
description = 'Deletes routes path if it is a file instead of directory'
82-
group = 'build cleanup'
83-
84-
doFirst {
85-
def routesPath = layout.buildDirectory.dir('src/play/routes').get().asFile
86-
if (routesPath.exists() && !routesPath.isDirectory()) {
87-
logger.lifecycle("Removing file that blocks routes directory: ${routesPath}")
88-
routesPath.delete()
89-
}
90-
}
91-
}
77+
tasks.register('fixPlayRoutesDirectory') {
78+
group = 'build cleanup'
79+
description = 'Deletes routes path if it is a file instead of directory'
9280

93-
tasks.named('compileScala') {
94-
dependsOn tasks.named('fixPlayRoutesDirectory')
81+
def routesPath = layout.buildDirectory.dir('src/play/routes')
82+
destroyables.register(routesPath)
83+
84+
doFirst {
85+
def routesPathFile = routesPath.get().asFile
86+
87+
if (routesPathFile.exists() && !routesPathFile.isDirectory()) {
88+
logger.lifecycle("Removing file that blocks routes directory: ${routesPathFile}")
89+
project.delete(routesPathFile)
90+
}
9591
}
9692
}
9793

0 commit comments

Comments
 (0)