public interface DistributionInstaller
Interface for a downloader and unpacker of distributions.
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addExecPattern(String relPaths) Add patterns for files to be marked executable. |
|
public Provider<File> |
getDistributionFile(String version, String fileRelPath) Locates a file within the distribution |
|
public Provider<File> |
getDistributionRoot(String version) Returns the location which is the top or home folder for a distribution. |
|
public String |
getSdkManCandidateName() SDKman candidate name for distribution. |
|
public File |
locateDistributionInCustomLocation(String version) Provide alternative means to look for distributions. |
|
public void |
setArtifactRootVerification(ArtifactRootVerification arv) Sets the method by which to verify an artifact root where package has been unpacked to. |
|
public void |
setArtifactUnpacker(ArtifactUnpacker unpacker) Sets the method by which to unpack a downloaded archive. |
|
public void |
setChecksum(String cs) Set a checksum that needs to be verified against downloaded archive |
|
public void |
setDownloadRoot(Object downloadRootDir) Sets a download root directory for the distribution. |
|
public void |
setSdkManCandidateName(String sdkCandidateName) Set candidate name for SdkMan if the latter should be searched for installed versions |
|
public URI |
uriFromVersion(String version) Creates a download URI from a given distribution version |
Add patterns for files to be marked executable.
Calling this method multiple times simply appends for patterns
relPaths
- One or more ANT-stype include patternsLocates a file within the distribution
version
- Version of distribution to search.fileRelPath
- Relative path to the distribution root.Returns the location which is the top or home folder for a distribution.
If the distribution is not local, this will invoke a download. Implementations of this function should take care to cache the download as to not unnecessarily use bandwidth and slow builds down.
version
- The version that will require locating or downloading.SDKman candidate name for distribution.
null
.Provide alternative means to look for distributions.
version
- Version of distribution to locateSets the method by which to verify an artifact root where package has been unpacked to.
arv
- VerifierSets the method by which to unpack a downloaded archive. It could also be a way to copy a single downloaded file to a location.
unpacker
- Unpack mechanism.Set a checksum that needs to be verified against downloaded archive
cs
- SHA-256 Hex-encoded checksumSets a download root directory for the distribution.
If not supplied the default is to use the Gradle User Home. This method is provided for convenience and is mostly only used for testing purposes.
The folder will be created at download time if it does not exist.
downloadRootDir
- Any writeable directory on the filesystem.Set candidate name for SdkMan if the latter should be searched for installed versions
sdkCandidateName
- SDK Candidate name. This is the same names that will be shown when
running sdk list candidates
on the script-line.