How/when to generate Gradle wrapper files?

I am trying to understand how the Gradle Wrapper works. In many source repos, I see the following structure:

projectRoot/
    src/
    build.gradle
    gradle.properties
    settings.gradle
    gradlew
    gradlew.bat
    gradle/
        wrapper/
            gradle-wrapper.jar
            gradle-wrapper.properties

My questions:

  1. How/when does one generate gradlew/gradlew.bat? Are you supposed to generate them only one time when the project is first created, do you generate them every time you commit/push changes? And how are they generated?
  2. Same question above, but for the gradle/wrapper/* files (gradle-wrapper.jar and gradle-wrapper.properties)?
  3. Some times I see other *.gradle files inside the project’s gradle directory. What are these additional Gradle files and what do they represent/do? Custom plugins?
  4. What is the difference in properties that go into settings.gradle vs what should be defined inside gradle.properties?

7 Answers
7

Leave a Comment