task
A project is essentially a collection of Task objects
- actions
- inputs
- outputs
Task Dependencies and Task Ordering
- dependsOn
- mustRunAfter
- shouldRunAfter
- finalizedBy
run gradle
- gradle command looks for a file called build.gradle
- gradle -b
gradle -q
忽略Gradle的log信息,只显示task的结果
doFirst doLast
将一个action头插入或者尾插入action list中。action list是按照顺序执行的
Lifecycle tasks
- Lifecycle tasks are tasks that do not do work themselves.
- typically do not have any task actions.
- If any of the task’s dependencies are executed/up-to-date, skipped or from cache, the lifecycle task will be considered executed/up-to-date.
CacheableTask
This will tell Gradle to try to use caching for every instance of the task type by default.