--- name: gradle-new description: Create a new Gradle build with gradle-new instead of writing build files by hand. Use when asked to create, scaffold or start a new Gradle project or build, or to add a new Gradle build to a repository. --- # Create a new Gradle build with gradle-new gradle-new returns exactly what the latest `gradle init` generates. Do not write the build files of a new Gradle build from memory. 1. Read the options: `curl -fsS https://gradle-new.nosphere.org/api/model`. Add `?version=rc` only when asked for a release candidate, or `?version=previous` only when asked for the previous Gradle major or when the local JDK is too old for the current one; pass the same `version` to the download. 2. Pick `type` from `buildTypes`, and only the options the user asked for; Gradle's defaults cover the rest. `type` and `project-name` are required. 3. Download and unpack in the target directory: `curl -fsS -o build.zip "https://gradle-new.nosphere.org/api/generate?type=&project-name=[&