# Wrapper

API Documentation: | `Wrapper`

Generates scripts (for *nix and windows) which allow you to build your project with Gradle, without having to install Gradle.

When a user executes a wrapper script the first time, the script downloads and installs the appropriate Gradle distribution and runs the build against this downloaded distribution. Any installed Gradle distribution is ignored when using the wrapper scripts.

The scripts generated by this task are intended to be committed to your version control system. This task also generates a small `gradle-wrapper.jar` bootstrap JAR file and properties file which should also be committed to your VCS. The scripts delegate to this JAR.

### Properties

Property | Description
`archiveBase` | The archive base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.
`archivePath` | The path where the gradle distributions archive should be saved (i.e. the parent dir). The path is relative to the archive base directory.
`distributionBase` | The distribution base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.
`distributionPath` | The path where the gradle distributions needed by the wrapper are unzipped. The path is relative to the distribution base directory
`distributionType` | The type of the Gradle distribution to be used by the wrapper. By default, this is `DistributionType.BIN`, which is the binary-only Gradle distribution without documentation.
`distributionUrl` | The URL to download the gradle distribution from.
`gradleVersion` | The version of the gradle distribution required by the wrapper. This is usually the same version of Gradle you use for building your project. The following labels are allowed to specify a version: `latest`, `release-candidate`, `release-milestone`, `release-nightly`, and `nightly`
`jarFile` | The file to write the wrapper jar file to.
`networkTimeout` | The network timeout specifies how many ms to wait for when the wrapper is performing network operations, such as downloading the wrapper jar.
`propertiesFile` | The file to write the wrapper properties to.
`scriptFile` | The file to write the wrapper script to.
`validateDistributionUrl` | Incubating Indicates if this task will validate the distribution url that has been configured.

### Methods

No methods

### Script blocks

No script blocks

### Property details

#### ``Property`<`PathBase`>` `archiveBase`

The archive base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.

Default:
  `PathBase.GRADLE_USER_HOME`

#### ``Property`<`String`>` `archivePath`

The path where the gradle distributions archive should be saved (i.e. the parent dir). The path is relative to the archive base directory.

Default:
  `'wrapper/dists'`

#### ``Property`<`PathBase`>` `distributionBase`

The distribution base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.

Default:
  `PathBase.GRADLE_USER_HOME`

#### ``Property`<`String`>` `distributionPath`

The path where the gradle distributions needed by the wrapper are unzipped. The path is relative to the distribution base directory

Default:
  `'wrapper/dists'`

#### ``Property`<`DistributionType`>` `distributionType`

The type of the Gradle distribution to be used by the wrapper. By default, this is `DistributionType.BIN`, which is the binary-only Gradle distribution without documentation.

Default:
  `DistributionType.BIN`

#### ``Property`<`String`>` `distributionUrl`

The URL to download the gradle distribution from.

If not set, the download URL is the default for the specified `Wrapper.getGradleVersion()`.

If `Wrapper.getGradleVersion()` is not set, will return null.

The wrapper downloads a certain distribution only once and caches it. If your distribution base is the project, you might submit the distribution to your version control system. That way no download is necessary at all. This might be in particular interesting, if you provide a custom gradle snapshot to the wrapper, because you don't need to provide a download server then.

The distribution url is validated before it is written to the gradle-wrapper.properties file.

Default:
  `"http\://services.gradle.org/distributions/gradle-${gradleVersion}-bin.zip"` (or `"http\://services.gradle.org/distributions-snapshots/gradle-${gradleVersion}-bin.zip"` for snapshot versions).

#### ``Property`<`String`>` `gradleVersion`

The version of the gradle distribution required by the wrapper. This is usually the same version of Gradle you use for building your project. The following labels are allowed to specify a version: `latest`, `release-candidate`, `release-milestone`, `release-nightly`, and `nightly`

The resulting distribution url is validated before it is written to the gradle-wrapper.properties file.

Default:
  `gradle.gradleVersion`

#### `RegularFileProperty` `jarFile`

The file to write the wrapper jar file to.

Default:
  ``${project.projectDir}`/gradle/wrapper/gradle-wrapper.jar`

#### ``Property`<`Integer`>` `networkTimeout`

The network timeout specifies how many ms to wait for when the wrapper is performing network operations, such as downloading the wrapper jar.

Default:
  `10000`ms

#### ``Provider`<`RegularFile`>` `propertiesFile`

The file to write the wrapper properties to.

Default:
  `jarFile`, replacing `.jar` with `.properties`

#### `RegularFileProperty` `scriptFile`

The file to write the wrapper script to.

Default:
  ``${project.projectDir}`/gradlew`

#### ``Property`<`Boolean`>` `validateDistributionUrl`

Note: This property is incubating and may change in a future version of Gradle.

Indicates if this task will validate the distribution url that has been configured.

Default:
  `true`