|
|||||||||
PREV CLASS NEXT CLASS | 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
Generates scripts (for *nix and windows) which enable to build your project with Gradle, without having to install Gradle. The scripts generated by this task are supposed to be committed to your version control system. This tasks also copies a gradle-wrapper.jar to your project dir which needs also be committed into your VCS. The scripts delegates to this jar. If a user execute a wrapper script the first time, the script downloads the gradle-distribution and runs the build against the downloaded distribution. Any installed Gradle distribution is ignored when using the wrapper scripts. Alternatively you can store the distribution for the wrapper in your version control system.
Nested Class Summary | |
---|---|
static class |
Wrapper.PathBase
Specifies how the wrapper path should be interpreted. |
Field Summary | |
---|---|
static String |
DEFAULT_ARCHIVE_CLASSIFIER
|
static String |
DEFAULT_ARCHIVE_NAME
|
static String |
DEFAULT_DISTRIBUTION_PARENT_NAME
|
static String |
DEFAULT_URL_ROOT
|
static String |
WRAPPER_JAR_BASE_NAME
|
Fields inherited from interface org.gradle.api.Task |
---|
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_NAME, TASK_OVERWRITE, TASK_TYPE |
Constructor Summary | |
---|---|
Wrapper()
|
Method Summary | |
---|---|
Wrapper.PathBase |
getArchiveBase()
Returns the archive base. |
String |
getArchiveClassifier()
Returns the archive classifier. |
String |
getArchiveName()
Returnes the archive name. |
String |
getArchivePath()
Returns the archive path. |
Wrapper.PathBase |
getDistributionBase()
Returns the distribution base. |
String |
getDistributionPath()
Returns the distribution path. |
String |
getGradleVersion()
Returns the gradle version for the wrapper. |
String |
getJarPath()
Returns the jar path. |
String |
getScriptDestinationPath()
Returns the script destination path. |
org.gradle.api.tasks.wrapper.internal.WrapperScriptGenerator |
getUnixWrapperScriptGenerator()
|
String |
getUrlRoot()
|
void |
setArchiveBase(Wrapper.PathBase archiveBase)
The distribution base specifies whether the unpacked wrapper distribution should be stored in the project or in the gradle user home dir. |
void |
setArchiveClassifier(String archiveClassifier)
Specifies the classifier of the archive as part of the download URL. |
void |
setArchiveName(String archiveName)
Specifies the name of the archive as part of the download URL. |
void |
setArchivePath(String archivePath)
Set's the path where the gradle distributions archive should be saved (i.e. |
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)
Set's the path where the gradle distributions needed by the wrapper are unzipped. |
void |
setGradleVersion(String gradleVersion)
The version of the gradle distribution required by the wrapper. |
void |
setJarPath(String jarPath)
When executing the wrapper task, the jar path specifies the path where the gradle-wrapper.jar is copied to. |
void |
setScriptDestinationPath(String scriptDestinationPath)
Specifies a path as the parent dir of the scripts which are generated when executing the wrapper task. |
void |
setUnixWrapperScriptGenerator(org.gradle.api.tasks.wrapper.internal.WrapperScriptGenerator wrapperScriptGenerator)
|
void |
setUrlRoot(String urlRoot)
A URL where to download the gradle distribution from. |
Methods inherited from class org.gradle.api.internal.AbstractTask |
---|
captureStandardOutput, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doFirst, doLast, doLast, equals, execute, getActions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuter, getGroup, getInputs, getLogger, getLogging, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getStandardOutputCapture, getState, getTaskDependencies, getTemporaryDir, hashCode, hasProperty, injectIntoNewInstance, isEnabled, leftShift, onlyIf, onlyIf, property, setActions, setConvention, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setGroup, setName, setOnlyIf, setOnlyIf, setProject, setProperty, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_URL_ROOT
public static final String WRAPPER_JAR_BASE_NAME
public static final String DEFAULT_DISTRIBUTION_PARENT_NAME
public static final String DEFAULT_ARCHIVE_NAME
public static final String DEFAULT_ARCHIVE_CLASSIFIER
Constructor Detail |
---|
public Wrapper()
Method Detail |
---|
public String getScriptDestinationPath()
setScriptDestinationPath(String)
public void setScriptDestinationPath(String scriptDestinationPath)
scriptDestinationPath
- Any object which toString
method specifies the path.
Most likely a String or File object.public String getJarPath()
setJarPath(String)
public void setJarPath(String jarPath)
jarPath
- public String getDistributionPath()
setDistributionPath(String)
public void setDistributionPath(String distributionPath)
distributionBase
.
distributionPath
- public String getGradleVersion()
setGradleVersion(String)
public void setGradleVersion(String gradleVersion)
gradleVersion
- public String getUrlRoot()
public void setUrlRoot(String urlRoot)
getUrlRoot()
/getArchiveName()
-getArchiveClassifier()
-getGradleVersion()
.zip
.
The default for the URL root is DEFAULT_URL_ROOT
.
The wrapper downloads a certain distribution only ones and caches it.
If your getDistributionBase()
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.
urlRoot
- public Wrapper.PathBase getDistributionBase()
setDistributionBase(org.gradle.api.tasks.wrapper.Wrapper.PathBase)
public void setDistributionBase(Wrapper.PathBase distributionBase)
distributionPath
is a relative path to either of those
dirs.
distributionBase
- public String getArchivePath()
setArchivePath(String)
public void setArchivePath(String archivePath)
getArchiveBase()
.
archivePath
- public Wrapper.PathBase getArchiveBase()
setArchiveBase(org.gradle.api.tasks.wrapper.Wrapper.PathBase)
public void setArchiveBase(Wrapper.PathBase archiveBase)
getArchivePath()
is a relative path to etiher of those dirs.
archiveBase
- public String getArchiveName()
setArchiveName(String)
public void setArchiveName(String archiveName)
getUrlRoot()
/getArchiveName()
-getArchiveClassifier()
-getGradleVersion()
.zip
The default for the archive name is DEFAULT_ARCHIVE_NAME
.
archiveName
- public String getArchiveClassifier()
setArchiveClassifier(String)
public void setArchiveClassifier(String archiveClassifier)
getUrlRoot()
/getArchiveName()
-getArchiveClassifier()
-getGradleVersion()
.zip
The default for the archive classifier is DEFAULT_ARCHIVE_CLASSIFIER
.
archiveClassifier
- public org.gradle.api.tasks.wrapper.internal.WrapperScriptGenerator getUnixWrapperScriptGenerator()
public void setUnixWrapperScriptGenerator(org.gradle.api.tasks.wrapper.internal.WrapperScriptGenerator wrapperScriptGenerator)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |