task.withType()的文档在哪里? [英] Where are the docs for tasks.withType()?
问题描述
Gradle是一个文档齐全的项目,但是当我搜索tasks.withType()
的文档时,我只会找到
Gradle is a well documented project, but when I search for the docs for tasks.withType()
, I only find the API docs.
这不是Gradle的官方部分吗?
Isn't this an official part of Gradle?
推荐答案
One of the fundamental concepts in Gradle is that everything is executed against a Project instance. Once you know that, you can work through the javadoc to find what you want. There's a bit of "magic" to be wary of too (a topic for another conversation) and also groovy syntax to understand .
因此,可以在javadocs中将tasks.withType(...)
查找为Project.getTasks().withType(...)
.
So tasks.withType(...)
can be looked up in the javadocs as Project.getTasks().withType(...)
.
您会注意到,Project.getTasks()
返回一个TaskCollection
(您在谷歌搜索中找到)
You'll notice that Project.getTasks()
returns a TaskCollection
(which you found in your googling)
*编辑*
在文档中的此处提及链接到TaskContainer
javadocs
There's a mention here in the docs which links to the TaskContainer
javadocs
项目本质上是Task对象的集合.每个任务执行一些基本工作,例如编译类,运行单元测试或压缩WAR文件.您可以使用TaskContainer上的create()方法之一将任务添加到项目中,例如TaskContainer.create(java.lang.String).您可以使用TaskContainer上的一种查找方法来找到现有任务,例如TaskCollection.getByName(java.lang.String)
A project is essentially a collection of Task objects. Each task performs some basic piece of work, such as compiling classes, or running unit tests, or zipping up a WAR file. You add tasks to a project using one of the create() methods on TaskContainer, such as TaskContainer.create(java.lang.String). You can locate existing tasks using one of the lookup methods on TaskContainer, such as TaskCollection.getByName(java.lang.String)
这篇关于task.withType()的文档在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!