Having to create a
build.gradle file, a
settings.gradle file and the necessary project layout manually for ever new Gradle project can be a drag. Gradle provides the build init plugin for generating new projects with different flavors from the command line. The downside of this approach is that you already have to have the Gradle runtime installed on your machine. You will likely also have to look up the right combination of command line options from the user manual.
Generating new Gradle projects should be easy, fast-forward and accessible from different user interfaces. 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.
The screencast below shows the web interface in action. In this sample, the user creates a Java library project equipped with the build logic to enable testing with Spock. The generated DSL of the build script is based on Kotlin.
Alternatively, you can invoke the
curl command to generate a project with the same setup from the command line. You can find all relevant options in the README file.
Gradle Initializr is fully open sourced and licensed under the Apache License 2.0. I’d love to hear your feedback on the functionality! Would you personally use Gradle Initializr to get started with your project? Are you missing any features? Feel free to leave a comment below or open an issue on GitHub.