Skip to content

Commit edfb1f2

Browse files
Fix for flaky error: Source directory '/dd-smoke-tests/play-2.8/build/src/play/routes' is not a directory.
1 parent 86fb978 commit edfb1f2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,25 @@ dependencies {
6969
}
7070

7171
configurations.testImplementation {
72-
exclude group:'com.typesafe.play', module:"play-test_$scalaVer"
72+
exclude group: 'com.typesafe.play', module: "play-test_$scalaVer"
73+
}
74+
75+
// Fix for flaky error: Source directory '/dd-smoke-tests/play-2.8/build/src/play/routes' is not a directory.
76+
tasks.register('cleanRoutes') {
77+
description = 'Deletes routes path if it is a file instead of directory'
78+
group = 'build cleanup'
79+
80+
doFirst {
81+
def routesPath = layout.buildDirectory.dir('src/play/routes').get().asFile
82+
if (routesPath.exists() && !routesPath.isDirectory()) {
83+
logger.lifecycle("Removing file that blocks routes directory: ${routesPath}")
84+
routesPath.delete()
85+
}
86+
}
87+
}
88+
89+
tasks.named('compileScala') {
90+
dependsOn tasks.named('cleanRoutes')
7391
}
7492

7593
tasks.named('compileTestGroovy').configure {

0 commit comments

Comments
 (0)