/gradle-initializr

A web-based quickstart generator for Gradle projects

Primary LanguageJavaApache License 2.0Apache-2.0

Gradle Initializer Build Status

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 Tooling API to invoke the functionality of the 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 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.

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.

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.

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.

Value Description

junit-jupiter

JUnit Jupiter

testng

TestNG

spock

Spock framework