@groovy.transform.CompileStatic @groovy.util.logging.Slf4j class Downloader extends org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller
Downloads specific versions of NodeJS. Currently limited to Windows (x86, x86_64), MacOS, Linux (x86, x86_64).
There are more binary packages are available from the NodeJS site, but currently these are not being tested not implemented. This includes:
(Patches welcome!)
| Modifiers | Name | Description |
|---|---|---|
class |
Downloader.1 |
|
class |
Downloader.2 |
| Modifiers | Name | Description |
|---|---|---|
static org.ysb33r.grolifant5.api.core.OperatingSystem$Arch |
ARCH |
|
static String |
BASE_URI |
|
static String |
DOWNLOADER_NAME |
|
static String |
DOWNLOADER_SUBPATH |
|
static org.ysb33r.grolifant5.api.core.OperatingSystem |
OS |
| Fields inherited from class | Fields |
|---|---|
class org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller |
IS_WINDOWS, IS_MACOSX, __$stMC |
| Type | Name and description |
|---|---|
org.ysb33r.grolifant5.api.core.downloader.ExecutableDownloader |
executableDownloader |
| Constructor and description |
|---|
Downloader
(org.ysb33r.grolifant5.api.core.ConfigCacheSafeOperations projectOperations)Creates a Node downloader. |
Downloader
(org.ysb33r.grolifant5.api.core.ProjectOperations projectOperations)Creates a Node downloader. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
File |
getNodeExecutablePath(String version)Returns the path to the node executable.
|
|
File |
getNpmExecutablePath(String version)Returns the path to the included npm-cli.js Node.js executable JavaScript.
|
|
URI |
uriFromVersion(String ver)Provides an appropriate URI to download a specific tag of NodeJS. |
|
protected File |
verifyDistributionRoot(File distDir)Validates that the unpacked distribution is good. |
| Methods inherited from class | Name |
|---|---|
class org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller |
org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#this$dist$invoke$1(java.lang.String, java.lang.Object), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#this$dist$set$1(java.lang.String, java.lang.Object), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#this$dist$get$1(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#access$0(org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller, org.gradle.api.file.FileCopyDetails), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setSdkManCandidateName(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getSdkManCandidateName(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#addExecPattern([Ljava.lang.String;), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setChecksum(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getDistributionRoot(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setDownloadRoot(java.lang.Object), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getDistributionFile(java.lang.String, java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getArtifactRootVerification(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setArtifactRootVerification(org.ysb33r.grolifant5.api.core.downloader.ArtifactRootVerification), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getArtifactUnpacker(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setArtifactUnpacker(org.ysb33r.grolifant5.api.core.downloader.ArtifactUnpacker), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getMetaClass(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setMetaClass(groovy.lang.MetaClass), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#equals(java.lang.Object), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#toString(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#hashCode(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getClass(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#notify(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#notifyAll(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#wait(long), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#wait(long, int), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#wait(), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#locateDistributionInCustomLocation(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#uriFromVersion(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#getProperty(java.lang.String), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#setProperty(java.lang.String, java.lang.Object), org.ysb33r.grolifant5.api.core.downloader.AbstractDistributionInstaller#invokeMethod(java.lang.String, java.lang.Object) |
Creates a Node downloader.
projectOperations - Project operations context.Creates a Node downloader.
projectOperations - Project operations context. Returns the path to the node executable.
Will force a download if not already downloaded.
node or null if not a supported operating system. Returns the path to the included npm-cli.js Node.js executable JavaScript.
Will force a download if not already downloaded.
npm-cli.js or null if not a supported operating system.Provides an appropriate URI to download a specific tag of NodeJS.
ver - Version of Node to downloadnull otherwise.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.Groovy Documentation