- 使用 gradle init 產生 gradle 專案目錄的範本
~$ mkdir -p gradle-sample
~$ cd gradle-sample
~/gradle-sample$ gradle init
:wrapper
:init
BUILD SUCCESSFUL
Total time: 2.419 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.12/userguide/gradle_daemon.html
- gradle init 產生的目錄結構如下:
.
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
2 directories, 6 files
- 可以用 gradle tasks 了解目前定義了哪些 task
:tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------
Build Setup tasks
-----------------
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'gradle-sample'.
components - Displays the components produced by root project 'gradle-sample'. [incubating]
dependencies - Displays all dependencies declared in root project 'gradle-sample'.
dependencyInsight - Displays the insight into a specific dependency in root project 'gradle-sample'.
help - Displays a help message.
model - Displays the configuration model of root project 'gradle-sample'. [incubating]
projects - Displays the sub-projects of root project 'gradle-sample'.
properties - Displays the properties of root project 'gradle-sample'.
tasks - Displays the tasks runnable from root project 'gradle-sample'.
BUILD SUCCESSFUL
Total time: 1.994 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.12/userguide/gradle_daemon.html