igor.wojda
03/30/2019, 1:38 PMtask("prCheck") {
afterEvaluate {
// Non-android modules do not have lint task
val lintDependencies = subprojects.mapNotNull { "${it.name}:lint" }
val taskDependencies = mutableListOf<String>("ktlintCheck", "detekt", "testDebugUnitTest")
taskDependencies.addAll(lintDependencies)
dependsOn(taskDependencies)
}
}
Above task works well for android lint, detekt, ktlint, however it fails to resolve testDebugUnitTest
task 🤔
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':prCheck'.
> Task with path 'testDebugUnitTest' not found in root project 'android'.
gildor
03/30/2019, 3:02 PMgildor
03/30/2019, 3:02 PMigor.wojda
03/30/2019, 6:48 PMprCheck
task in project root level build.gradle.kts
, so and I am able to run it in project root like this ./gradlew prCheck
- the only problem is testDebugUnitTest
task that comes from Android
FYI I can run ./gradlew testDebugUnitTest
without any problems - the problem starts when I want to use it as dependencygildor
03/31/2019, 12:58 AMgildor
03/31/2019, 12:59 AMgildor
03/31/2019, 1:00 AMgildor
03/31/2019, 1:05 AMsubmodules["myModule"].tasks["testDebugUnitTest]
and set dependency on it, but didn't try this approach, and all default Gradle task work like 1, not like 2