Skip to content

Conversation

adammurdoch
Copy link
Contributor

Context

This PR contains a bunch of changes to the build init plugin implemented to fill in time on some long haul flights. And to improve the bootstrap experience of course.

  • Interactive mode prompts the user for details when gradle init is run from an interactive console.
  • Kotlin library and application build types.
  • Configurable project name and source package name.
  • Generate resource directories.
  • Generate a simple .gitignore file.
  • Use the BuildScriptBuilder infrastructure for Maven conversion. For now, this just means more consistent formatting in the generated scripts, but later will make it much easier to generate Kotlin DSL scripts instead.
  • Improve the internal UserInputHandler service to allow prompting the user with various kinds of questions. This could later evolve into a public service.
  • Much better error reporting from the init task on validation failures.
  • Run fewer duplicate test cases in the CI pipeline.

Contributor Checklist

  • Review Contribution Guidelines
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective
  • Provide unit tests (under <subproject>/src/test) to verify logic
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:check

Gradle Core Team Checklist

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation
  • Recognize contributor in release notes

… build init generator implementation and apply as a decoration instead.
…own options or unsupported combinations of options.
…w the name of the generated project to be specified.
… package used for generated source files to be specified.
… that were not specified on the command-line.
…when they enter a value that isn't valid for the question. Add some test coverage for user prompting.
…emon and no-daemon execution. Instead, the test runs with whichever execution the current test suite is using, and all of the execution modes will be covered at least once in various stages of CI.
…so that it lives in only one place. The flag is still on `StartParameter` but is unused and should later be deprecated and removed.
… used by the `init` task. Ideally, the console infrastructure would better handle the prompts but this requires some deeper changes. The work-arounds allow us to try out the interactive behaviour and can be fixed later.
…verting a Maven build.

- Do not suggest `pom` as a build type when there is no `pom.xml` present, as the conversion makes no sense in this case.
- Do not prompt for a DSL or project name when converting a Maven build, as these are not supported or ignored by the Maven build conversion.
- When the `--project` or `--package` options are used with the `init` task, fail when the selected build type does not support these options, e.g. when converting to Maven build.
…ownloading all of the external tools on each test invocation.
…s present in the current directory, by first asking the user if they would like to generate a Gradle build for the Maven build. If the user answers 'yes', proceed without asking any further questions. If the user answers 'no', only then ask the user to select which type of build they would like to create.
…izers that generate a Gradle build from some existing build and those that generate a new build an supporting files from scratch.
… is derived from the project name, rather than an empty package name.
…ture to generate the Gradle settings file for a Maven build, rather than creating a string with ad hoc formatting.
…cture to generate part of the root build script when generating a Gradle build from a Maven build.
…the Gradle build scripts when converting a Maven build.
…the Gradle build scripts when converting a Maven build.
…the Gradle build scripts when converting a Maven build.
…the Gradle build scripts when converting a Maven build.
…the Gradle build scripts when converting a Maven build.
…ndencies in the Gradle build scripts when converting a Maven build.
…o generate all build and settings scripts, including for Maven build conversion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant