diff --git a/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorIntegrationTest.kt b/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorIntegrationTest.kt index f0242058..eb83d89f 100644 --- a/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorIntegrationTest.kt +++ b/affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorIntegrationTest.kt @@ -112,6 +112,9 @@ class AffectedModuleDetectorIntegrationTest { // THEN assertThat(result.output).contains(":sample-app:assembleDebugAndroidTest SKIPPED") + assertThat(result.output).contains(":sample-core:mergeDexDebugAndroidTest SKIPPED") + assertThat(result.output).contains(":sample-core:packageDebugAndroidTest SKIPPED") + assertThat(result.output).contains(":sample-core:assembleDebugAndroidTest SKIPPED") assertThat(result.output).contains(":sample-core:assembleAndroidTest SKIPPED") assertThat(result.output).contains(":assembleAffectedAndroidTests SKIPPED") } @@ -190,6 +193,9 @@ class AffectedModuleDetectorIntegrationTest { // THEN assertThat(result.output).contains(":sample-app:assembleDebugAndroidTest SKIPPED") + assertThat(result.output).doesNotContain(":sample-core:mergeDexDebugAndroidTest") + assertThat(result.output).doesNotContain(":sample-core:packageDebugAndroidTest") + assertThat(result.output).doesNotContain(":sample-core:assembleDebugAndroidTest") assertThat(result.output).doesNotContain(":sample-core:assembleAndroidTest") assertThat(result.output).contains(":assembleAffectedAndroidTests SKIPPED") } diff --git a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt b/sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt index a49115c1..5af78ae5 100644 --- a/sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt +++ b/sample/buildSrc/src/main/kotlin/com/dropbox/sample/tasks/AffectedTasksPlugin.kt @@ -53,8 +53,8 @@ class AffectedTasksPlugin : Plugin { private fun registerAffectedTestTask( taskName: String, testTask: String, testTaskBackup: String?, rootProject: Project - ): Task { - val task = rootProject.tasks.register(taskName) { task -> + ) { + rootProject.tasks.register(taskName) { task -> val paths = getAffectedPaths(testTask, testTaskBackup, rootProject) paths.forEach { path -> task.dependsOn(path) @@ -62,7 +62,6 @@ class AffectedTasksPlugin : Plugin { task.enabled = paths.isNotEmpty() task.onlyIf { paths.isNotEmpty() } } - return task.get() } private fun getAffectedPaths(