为什么在Gradle中使用'tasks'任务时看不到所有任务? [英] Why can't see all task when use 'tasks' task in Gradle?
问题描述
任务startSession<< {
chant()
}
def chant(){
ant.echo(message:'Repeat after me ...')
}
3.times {
任务yayGradle $ it<< {
的println '摇篮岩石'
}
}
yayGradle0.dependsOn startSession
yayGradle2.dependsOn yayGradle1,yayGradle0
任务groupTherapy(dependsOn:yayGradle2)
在我的脚本中,我有startSession任务,groupTherapy任务和三个动态生成的任务yayGradle0-3。当我执行时:
gradle任务
部分输出为:
其他任务
---- -------
groupTherapy
其他任务在哪里?如果我使用参数 - 全部
执行上面的命令,它们是可见的,但不是作为独立的任务,而是依赖于 groupTherapy 。为什么Gradle不会将任务startSession显示为单独的任务,例如?
gradle tasks
显示其他任务所依赖的任务以及具有 task.group
set的任务。这个想法是,这些任务显然意味着直接执行,而(通常很多)其余任务不是。 gradle tasks --all
显示所有任务。
task startSession << {
chant()
}
def chant() {
ant.echo(message: 'Repeat after me...')
}
3.times {
task "yayGradle$it" << {
println 'Gradle rocks'
}
}
yayGradle0.dependsOn startSession
yayGradle2.dependsOn yayGradle1, yayGradle0
task groupTherapy(dependsOn: yayGradle2)
In my script I have startSession task, groupTherapy task and three dynamically generated tasks yayGradle0-3. When I am executing:
gradle tasks
Part of the output is:
Other tasks
-----------
groupTherapy
Where are the other tasks? If I execute the command above with parameter --all
they are visible but not as indipendant tasks but like dependent on groupTherapy. Why Gradle doesn't show task startSession as separate task for example?
gradle tasks
show tasks that no other task depends on, and tasks that have task.group
set. The idea is that these are the tasks that are clearly meant to be executed directly, whereas the (often many) remaining tasks aren't. gradle tasks --all
shows all tasks.
这篇关于为什么在Gradle中使用'tasks'任务时看不到所有任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!