@groovy.transform.CompileStatic @SuppressWarnings(value: AbstractClassWithoutAbstractMethod) abstract class AbstractBaseDistributionInstaller extends Object implements BaseDistributionInstaller
Base functionality for installing single files or distributions.
| Modifiers | Name | Description |
|---|---|---|
class |
AbstractBaseDistributionInstaller.1 |
| Modifiers | Name | Description |
|---|---|---|
static boolean |
IS_MACOSX |
|
static boolean |
IS_WINDOWS |
|
protected ConfigCacheSafeOperations |
ccso |
Project operations that can used during downloading. |
protected String |
distributionName |
Name of the distribution. |
protected java.util.List<String> |
execPatterns |
Defined execution patterns. |
| Type | Name and description |
|---|---|
ArtifactRootVerification |
artifactRootVerification |
ArtifactUnpacker |
artifactUnpacker |
| Constructor and description |
|---|
protected AbstractBaseDistributionInstaller
(String distributionName, String basePath, ConfigCacheSafeOperations ccso) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
addExecPattern(String[] relPaths)Add patterns for files to be marked exe, |
|
protected String |
extractFinalExtension(String filename)Extract the last extension in a file name. |
|
protected File |
getDistFromCache(URI distUri, String decorativeName)Creates a distribution if it does not exist already. |
|
protected java.util.List<File> |
listDirs(File distDir)Provides a list of directories below an unpacked distribution |
|
void |
setChecksum(String cs)Set a checksum that needs to be verified against downloaded archive |
|
void |
setDownloadRoot(Object downloadRootDir)Sets a download root directory for the distribution. |
|
protected void |
unpack(File srcArchive, File destDir)Unpacks a downloaded archive. |
|
protected Parameters |
unpackParametersForExtension(String extension)Returns custom parameters for initialising an unpack engine. |
|
protected File |
verifyDistributionRoot(File distDir)Validates that the unpacked distribution is good. |
|
protected void |
verifyDownloadChecksum(String sourceUrl, File localCompressedFile, String expectedSum)Verifies the checksum (if provided) of a newly downloaded distribution archive. |
Project operations that can used during downloading.
Name of the distribution.
Defined execution patterns.
Add patterns for files to be marked exe, Calling this method multiple times simply appends for patterns
relPaths - One or more ANT-stype include patternsExtract the last extension in a file name.
filename - FilenameCreates a distribution if it does not exist already.
distUri - URI where distribution is located.decorativeName - A name to using during download process.Provides a list of directories below an unpacked distribution
distDir - Unpacked distribution directorySet 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.Unpacks a downloaded archive.
The default implementation supports the following formats:
srcArchive - The location of the download archivedestDir - The directory where the archive needs to be unpacked intoReturns custom parameters for initialising an unpack engine.
Implementors can override this to return specific parameters depending on the kind of extension to unpack.
The default implementation sets a relative path for .dmg files and a basic environment
for .msi files.
extension - Archive or compressed file extension.null if no specific parameters exist.Validates that the unpacked distribution is good.
The default implementation simply checks that only one directory should exist and then uses that. You should override this method if your distribution in question does not follow the common practice of one top-level directory.
distDir - Directory where distribution was unpacked to.distDir.Verifies the checksum (if provided) of a newly downloaded distribution archive.
Only SHA-256 is supported at this point in time.
sourceUrl - The URL/URI where it was downloaded fromlocalCompressedFile - The location of the downloaded archiveexpectedSum - The expected checksum. Can be null in which case no checks will be performed.Groovy Documentation