Skip to content

Commit a139c42

Browse files
authored
Build: Fix test task to explicitly depend on testClasses task (#28490)
Gradle 4.5 now hides immutable task dependencies. We previously copied the existing dependencies from the builtin test task to the randomizedtesting task. This commit adds testClasses as an extra dependency of the randomizedtesting task, to ensure the classes are built.
1 parent 90c74a7 commit a139c42

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingPlugin.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class RandomizedTestingPlugin implements Plugin<Project> {
6262
RandomizedTestingTask newTestTask = tasks.create(properties)
6363
newTestTask.classpath = oldTestTask.classpath
6464
newTestTask.testClassesDir = oldTestTask.project.sourceSets.test.output.classesDir
65+
// since gradle 4.5, tasks immutable dependencies are "hidden" (do not show up in dependsOn)
66+
// so we must explicitly add a dependency on generating the test classpath
67+
newTestTask.dependsOn('testClasses')
6568

6669
// hack so check task depends on custom test
6770
Task checkTask = tasks.findByPath('check')

0 commit comments

Comments
 (0)