bmuschko / Gradle Initializr
Programming Languages
= Gradle Initializer image:https://travis-ci.org/bmuschko/gradle-initializr.svg?branch=master["Build Status", link="https://travis-ci.org/bmuschko/gradle-initializr"]
Gradle Initializer provides a web-based service for generating quickstart Gradle projects. The application provides two different interfaces: a web-based UI and an endpoint for generating projects via curl
. Under the covers, Gradle Initializer uses the link:https://docs.gradle.org/current/userguide/embedding.html[Tooling API] to invoke the functionality of the link:https://docs.gradle.org/current/userguide/build_init_plugin.html[Build Init plugin]. A quickstart project is bundled and downloaded as ZIP or TAR file.
== Using the web UI
The web user interface is available by opening the URL link:https://gradle-initializr.cleverapps.io/[https://gradle-initializr.cleverapps.io/] in the browser of your choice. Simply select the options for your target project and press the "Generate" button to download the archive containing the project files.
== Using curl
Gradle Initializer can generate and download projects from the terminal with the help of the curl
command. By default, the generated type is a plain Gradle project using the latest, packaged version of the Gradle Wrapper.
$ curl https://gradle-initializr.cleverapps.io/starter.zip -o starter.zip
$ curl https://gradle-initializr.cleverapps.io/starter.tgz -o starter.tar.gz
Additionally, the following parameters can be specified.
[options="header"]
|=======
|Parameter |Description
|type
|The type of project to generate
|projectName
|The name of the project to generate
|packageName
|The package of the project to generate (only applies to JVM projects)
|dsl
|The DSL to use for the generate project
|gradleVersion
|The Gradle version used for the Wrapper
|testFramework
|The test framework used for some of the project types
|=======
=== Specifying the project type
To generate a specific project type add the type
parameter to the command. The following example generates a Java library project with the test framework TestNG:
$ curl https://gradle-initializr.cleverapps.io/starter.zip -d type=java-library -d testFramework=testng -o starter.zip
The table below presents the available project types by providing the parameter type
. The parameter is mandatory.
[options="header"]
|=======
|Value |Description
|basic
|The most-basic Gradle project
|cpp-application
|A C++ application project
|cpp-library
|A C++ library project
|java-application
|A Java application project
|java-library
|A Java library project
|java-gradle-plugin
|A Gradle plugin project in Java
|groovy-application
|A Groovy application project
|groovy-library
|A Groovy library project
|groovy-gradle-plugin
|A Gradle plugin project in Groovy
|kotlin-application
|A Kotlin application project
|kotlin-library
|A Kotlin library project
|kotlin-gradle-plugin
|A Gradle plugin project in Kotlin
|scala-library
|A Scala library project
|=======
=== Specifying the project DSL
The generated project can used two different DSLs starting with Gradle version 4.5. Use the parameter dsl
to set the DSL.
[options="header"]
|=======
|Value |Description
|groovy
|The project is generated with the Groovy DSL
|kotlin
|The project is generated with the Kotlin DSL
|=======
=== Specifying the Wrapper version
The generated project provides a Gradle Wrapper with a specific version. The version can be provided with the parameter gradleVersion
. The minimum supported version of the Gradle Wrapper is 4.4.
=== Specifying the test framework
The following test frameworks can be selected for the project types java-application
and java-library
by providing the parameter testFramework
. The parameter is optional. The test framework JUnit 4 is used if the parameter isn't provided.
[options="header"]
|=======
|Value |Description
|junit-jupiter
|link:https://junit.org/junit5/[JUnit Jupiter]
|testng
|link:http://testng.org/[TestNG]
|spock
|link:http://spockframework.org/[Spock framework]
|=======