Gradle supports single and multi-project builds. During the initialization phase, Gradle determines which projects are going to take part in the build, and creates a Project instance for each of these projects.
Gradle determines the subset of the tasks, created and configured during the configuration phase, to be executed. The subset is determined by the task name arguments passed to the gradle command and the current directory. Gradle then executes each of the selected tasks.
./gradlew task1 This is executed during the initialization phase.
> Configure project : Hello World!
> Task :task1 I'm task number 1
Zip task
build.gradle
task zip(type: Zip, group:'Archive', description:'Archives source in a zip file') { archiveName 'demo.zip' destinationDirectory = file("$buildDir/dist") from 'src'// from 這邊的設定還不是很懂 }
Execute Task
This is executed during the initialization phase.
> Configure project : Hello World! Zip files from src to /Users/jerry80409/eton/gradle-multi-module/build/dist