noob question: why I dont I see `test`˛or `build` ...
# gradle
u
noob question: why I dont I see `test`˛or
build
task in
gradlew :tasks --all
? I only see module:build, module:test etc
g
Because root module doesn't have test task
u
then how do I make a custom task that depends on test task that is equivalent of
./gradlew test
?
g
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
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
./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
thats exactly what I want as part of my custom task. why cant I depend on it?
g
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
thats odd, why would they have real and fake tasks, it does get listed in :tasks
g
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