Wrapper (Gradle API 2.14.1)

Package: org.gradle.api.tasks.wrapper

## [Java] Class Wrapper

- org.gradle.api.tasks.wrapper.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 delegates to this JAR.

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `enum` | `Wrapper.PathBase` | Specifies how the wrapper path should be interpreted.

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `DEFAULT_DISTRIBUTION_PARENT_NAME` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class org.gradle.api.internal.AbstractTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Wrapper ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Wrapper.PathBase` | `getArchiveBase()` The archive base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.
    `String` | `getArchivePath()` Returns the path where the gradle distributions archive should be saved (i.e. the parent dir).
    `File` | `getBatchScript()` Returns the file to write the wrapper batch script to.
    `Wrapper.PathBase` | `getDistributionBase()` The distribution base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.
    `String` | `getDistributionPath()` Returns the path where the gradle distributions needed by the wrapper are unzipped.
    `String` | `getDistributionUrl()` The URL to download the gradle distribution from.
    `protected org.gradle.api.internal.file.FileLookup` | `getFileLookup()`
    `String` | `getGradleVersion()` Returns the gradle version for the wrapper.
    `File` | `getJarFile()` Returns the file to write the wrapper jar file to.
    `File` | `getPropertiesFile()` Returns the file to write the wrapper properties to.
    `File` | `getScriptFile()` Returns the file to write the wrapper script to.
    `void` | `setArchiveBase(Wrapper.PathBase archiveBase)` The archive base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.
    `void` | `setArchivePath(String archivePath)` Set's the path where the gradle distributions archive should be saved (i.e. the parent dir).
    `void` | `setDistributionBase(Wrapper.PathBase distributionBase)` The distribution base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir.
    `void` | `setDistributionPath(String distributionPath)` Sets the path where the gradle distributions needed by the wrapper are unzipped.
    `void` | `setDistributionUrl(String url)`
    `void` | `setGradleVersion(String gradleVersion)` The version of the gradle distribution required by the wrapper.
    `void` | `setJarFile(Object jarFile)`
    `void` | `setScriptFile(Object scriptFile)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class org.gradle.api.internal.AbstractTask` | `org.gradle.api.internal.AbstractTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.AbstractTask#toString(), org.gradle.api.internal.AbstractTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.AbstractTask#compareTo(java.lang.Object), org.gradle.api.internal.AbstractTask#getName(), org.gradle.api.internal.AbstractTask#getActions(), org.gradle.api.internal.AbstractTask#setName(java.lang.String), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#getPath(), org.gradle.api.internal.AbstractTask#getExtensions(), org.gradle.api.internal.AbstractTask#getLogger(), org.gradle.api.internal.AbstractTask#execute(), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#getDescription(), org.gradle.api.internal.AbstractTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#property(java.lang.String), org.gradle.api.internal.AbstractTask#isEnabled(), org.gradle.api.internal.AbstractTask#setEnabled(boolean), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setDidWork(boolean), org.gradle.api.internal.AbstractTask#getDidWork(), org.gradle.api.internal.AbstractTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doLast(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doLast(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#deleteAllActions(), org.gradle.api.internal.AbstractTask#getEnabled(), org.gradle.api.internal.AbstractTask#getAnt(), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#hasProperty(java.lang.String), org.gradle.api.internal.AbstractTask#getConvention(), org.gradle.api.internal.AbstractTask#setDescription(java.lang.String), org.gradle.api.internal.AbstractTask#getGroup(), org.gradle.api.internal.AbstractTask#setGroup(java.lang.String), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.AbstractTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#getProject(), org.gradle.api.internal.AbstractTask#setActions(java.util.List), org.gradle.api.internal.AbstractTask#getDependsOn(), org.gradle.api.internal.AbstractTask#dependsOnTaskDidWork(), org.gradle.api.internal.AbstractTask#getInputs(), org.gradle.api.internal.AbstractTask#getTemporaryDir(), org.gradle.api.internal.AbstractTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getMustRunAfter(), org.gradle.api.internal.AbstractTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getFinalizedBy(), org.gradle.api.internal.AbstractTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getShouldRunAfter(), org.gradle.api.internal.AbstractTask#getStandardOutputCapture(), org.gradle.api.internal.AbstractTask#getAsDynamicObject(), org.gradle.api.internal.AbstractTask#setProject(org.gradle.api.Project), org.gradle.api.internal.AbstractTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.lang.Class, java.util.concurrent.Callable), org.gradle.api.internal.AbstractTask#prependParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#getOnlyIf(), org.gradle.api.internal.AbstractTask#getImpliesSubProjects(), org.gradle.api.internal.AbstractTask#setImpliesSubProjects(boolean), org.gradle.api.internal.AbstractTask#getExecuter(), org.gradle.api.internal.AbstractTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.AbstractTask#getTemporaryDirFactory(), org.gradle.api.internal.AbstractTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.AbstractTask#getValidators(), org.gradle.api.internal.AbstractTask#appendParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#isHasCustomActions(), org.gradle.api.internal.AbstractTask#getTaskActions(), org.gradle.api.internal.AbstractTask#wait(long, int), org.gradle.api.internal.AbstractTask#wait(long), org.gradle.api.internal.AbstractTask#wait(), org.gradle.api.internal.AbstractTask#equals(java.lang.Object), org.gradle.api.internal.AbstractTask#hashCode(), org.gradle.api.internal.AbstractTask#getClass(), org.gradle.api.internal.AbstractTask#notify(), org.gradle.api.internal.AbstractTask#notifyAll()`

- - ### Field Detail

    - #### public static final String DEFAULT_DISTRIBUTION_PARENT_NAME

  - ### Constructor Detail

    - #### public Wrapper()

  - ### Method Detail

    - #### @Input public Wrapper.PathBase getArchiveBase()

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

    - #### @Input public String getArchivePath()

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

    - #### @OutputFile public File getBatchScript()

      Returns the file to write the wrapper batch script to.

    - #### @Input public Wrapper.PathBase getDistributionBase()

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

    - #### @Input public String getDistributionPath()

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

      See Also:
        setDistributionPath(String)

    - #### @Input public String getDistributionUrl()

      The URL to download the gradle distribution from.

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

      If 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.

    - #### @javax.inject.Inject protected org.gradle.api.internal.file.FileLookup getFileLookup()

    - #### @Input public String getGradleVersion()

      Returns the gradle version for the wrapper.

      See Also:
        setGradleVersion(String)

    - #### @OutputFile public File getJarFile()

      Returns the file to write the wrapper jar file to.

    - #### @OutputFile public File getPropertiesFile()

      Returns the file to write the wrapper properties to.

    - #### @OutputFile public File getScriptFile()

      Returns the file to write the wrapper script to.

    - #### public void setArchiveBase(Wrapper.PathBase archiveBase)

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

    - #### public void setArchivePath(String archivePath)

      Set's the path where the gradle distributions archive should be saved (i.e. the parent dir). The path is relative to the parent dir specified with getArchiveBase().

    - #### public void setDistributionBase(Wrapper.PathBase distributionBase)

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

    - #### public void setDistributionPath(String distributionPath)

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

      See Also:
        setDistributionPath(String)

    - #### @org.gradle.api.internal.tasks.options.Option(option = "gradle-distribution-url", description = "The URL to download the gradle distribution from.") public void setDistributionUrl(String url)

    - #### @org.gradle.api.internal.tasks.options.Option(option = "gradle-version", description = "The version of the Gradle distribution required by the wrapper.") public void setGradleVersion(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.

    - #### public void setJarFile(Object jarFile)

    - #### public void setScriptFile(Object scriptFile)