|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gradle.api.internal.AbstractTask org.gradle.api.DefaultTask org.gradle.api.tasks.wrapper.Wrapper
public class Wrapper extends DefaultTask
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 | |
---|---|
enum |
Wrapper.PathBase
Specifies how the wrapper path should be interpreted. |
Field Summary | |
---|---|
static String |
DEFAULT_DISTRIBUTION_PARENT_NAME
|
Constructor Summary | |
Wrapper()
|
Method Summary | |
---|---|
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. |
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)
|
Field Detail |
---|
public static final String DEFAULT_DISTRIBUTION_PARENT_NAME
Constructor Detail |
---|
public Wrapper()
Method Detail |
---|
public Wrapper.PathBase getArchiveBase()
public String getArchivePath()
@OutputFile public File getBatchScript()
public Wrapper.PathBase getDistributionBase()
public String getDistributionPath()
@Input public String getDistributionUrl()
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.
public String getGradleVersion()
@OutputFile public File getJarFile()
@OutputFile public File getPropertiesFile()
@OutputFile public File getScriptFile()
public void setArchiveBase(Wrapper.PathBase archiveBase)
public void setArchivePath(String archivePath)
public void setDistributionBase(Wrapper.PathBase distributionBase)
public void setDistributionPath(String distributionPath)
public void setDistributionUrl(String url)
public void setGradleVersion(String gradleVersion)
public void setJarFile(Object jarFile)
public void setScriptFile(Object scriptFile)
Gradle API 1.12