Код: Выделить всё
project1:
implementation(1st_lvl_module1)
implementation(1st_lvl_module2)
project2:
implementation(1st_lvl_module1)
implementation(1st_lvl_module2)
implementation(1st_lvl_module3)
project3:
implementation(1st_lvl_module2)
1st_lvl_module1:
implementation(2nd_lvl_module1)
implementation(2nd_lvl_module2)
1st_lvl_module2:
implementation(2nd_lvl_module2)
1st_lvl_module3:
implementation(2nd_lvl_module2)
implementation(2nd_lvl_module3)
2nd_lvl_module1
2nd_lvl_module2
2nd_lvl_module3
Если я вызову для Project1 Gradle1: тест он будет выполнен только для Project1 и не включает 1st_lvl_module1 , который также реализовал 2nd_lvl_module1 и 2nd_l_module. 1st_lvl_module2 с 2nd_lvl_module2
Я попытался реализовать пользовательскую задачу, например:
Код: Выделить всё
tasks.register("testWithDependencies") { task ->
task.dependsOn("test")
configurations.forEach {
it.dependencies.findAll { it instanceof ProjectDependency }.forEach {
dependsOn ":${it.name}:test"
}
}
}
< /code>
И с таким образом он также работает для реализаций первого уровня.
gradle project1:testWithDependencies
Код: Выделить всё
tasks.register("pd") { task ->
configurations.forEach {
println("Config name: ${it.name}")
it.dependencies.findAll { it instanceof ProjectDependency }.forEach {
def depProject = ((ProjectDependency)it).getDependencyProject()
println("${depProject.name}")
depProject.configurations.forEach {
println("---Config name: ${it.name}")
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/638 ... pendencies