فهرست منبع

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.
Ryan Ernst 7 سال پیش
والد
کامیت
a139c42964
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingPlugin.groovy

+ 3 - 0
buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingPlugin.groovy

@@ -62,6 +62,9 @@ class RandomizedTestingPlugin implements Plugin<Project> {
         RandomizedTestingTask newTestTask = tasks.create(properties)
         RandomizedTestingTask newTestTask = tasks.create(properties)
         newTestTask.classpath = oldTestTask.classpath
         newTestTask.classpath = oldTestTask.classpath
         newTestTask.testClassesDir = oldTestTask.project.sourceSets.test.output.classesDir
         newTestTask.testClassesDir = oldTestTask.project.sourceSets.test.output.classesDir
+        // since gradle 4.5, tasks immutable dependencies are "hidden" (do not show up in dependsOn)
+        // so we must explicitly add a dependency on generating the test classpath
+        newTestTask.dependsOn('testClasses')
 
 
         // hack so check task depends on custom test
         // hack so check task depends on custom test
         Task checkTask = tasks.findByPath('check')
         Task checkTask = tasks.findByPath('check')