Gradle プロジェクト初期化

build.gradleのサンプルや、gradle wrapper, 基本的なディレクトリまで生成してくれる.

ihiroky@LZ750HS:~/t$ gradle init --type java-library
:wrapper
:init

BUILD SUCCESSFUL

Total time: 4.28 secs
ihiroky@LZ750HS:~/t$ ls
build.gradle  gradle  gradlew  gradlew.bat  settings.gradle  src
ihiroky@LZ750HS:~/t$ find src/
src/
src/main
src/main/java
src/main/java/Library.java
src/test
src/test/java
src/test/java/LibraryTest.java

他にもGroovy等のtypeが選べる.

ihiroky@LZ750HS:~/t$ gradle help --task init
:help
Detailed task information for init

Path
     :init

Type
     InitBuild (org.gradle.buildinit.tasks.InitBuild)

Options
     --type     Set type of build to create.
                Available values are:
                     basic
                     groovy-library
                     java-library
                     pom
                     scala-library

Description
     Initializes a new Gradle build. [incubating]


BUILD SUCCESSFUL

とりあえず gradle help --task タスク名 とタイプすると、先人の知恵にあやかれるかもしれない.