https://kotlinlang.org logo
Title
u

ursus

07/26/2019, 4:41 PM
noob question: why I dont I see `test`˛or
build
task in
gradlew :tasks --all
? I only see module:build, module:test etc
g

gildor

07/27/2019, 3:40 AM
Because root module doesn't have test task
u

ursus

07/27/2019, 6:55 AM
then how do I make a custom task that depends on test task that is equivalent of
./gradlew test
?
g

gildor

07/27/2019, 8:25 AM
Just create test task, or do not depend on non-existent task, you can check it
Or create task in modules that apply particular plugins that provide required tasks
u

ursus

07/27/2019, 1:56 PM
okay but why cant I depend on the
test
? i.e. why I do not see it there if
gradlew test
works? is it some timing thing? Like afterEvaluate etc?
g

gildor

07/27/2019, 2:26 PM
./gradlew test
runs task with name
test
in all modules of your project, for modules where you don't have this task it will do nothing
u

ursus

07/27/2019, 2:59 PM
thats exactly what I want as part of my custom task. why cant I depend on it?
g

gildor

07/27/2019, 4:08 PM
This is not a real task, just a way to run task with this name in all modules, you cannot depend on it, tho, you just can have this task in all your modules (added by a plugin or explicitly to any module)
u

ursus

07/27/2019, 4:13 PM
thats odd, why would they have real and fake tasks, it does get listed in :tasks
g

gildor

07/27/2019, 4:55 PM
test is default task for JVM modules, Android modules are more complicated, they create multiple test tasks for differt build types, my original proposal was to have the same task that depends on required test task in each module