-
General purpose build tool
-
Tasks and their dependencies on each other. A task has
- inputs
- actions
- outputs
-
Fixed build phases
- Initialization
- Configuration - only those tasks are configured that are selected to be run
- Execution - only those tasks are run that are selected
-
build scripts are code, but mainly declarative (configuration)
-
imperative logic -
doLast(),doFirst()- Demo by Geri: source
- task syntax
- logger (--info, --debug, --stacktrace)
- dependsOn, finalizedBy, mustRunAfter, (shouldRunAfter)
- copy task / templating / delete / download
- depend on other submodules -> :api:public-api:asseamble
- dry run: --dry-run
- Demo by Geri: source
-
Groovy/Kotlin
gradle init- Gradle wrapper
- gradle version used by the project is fixed
- no need to install it if one starts to work on a project
- it is possible to create a gradle wrapper bundled with some specific logic in it
- Adds lifecycle tasks
- Adds base extension
archivesName- ...
- clean
- check
- assemble
- build
- compile
- jar
- processResources
- main
- test
- custom
Note: script classpath and script dependencies is different from the sourceSets and dependencies above.
Dependencies from repositories can be defined in buildscript block.
- The
apidependency
runtask
Groovy environment should be added as dependency.