Base class for configuring project defaults or task specifics for Node.js.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
NODEJS_DEFAULT |
The default version of Node.js that will be used on a supported platform if nothing else is configured. |
protected java.util.concurrent.Callable<NpmExtension> |
locateNpm |
| Fields inherited from class | Fields |
|---|---|
class org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension |
__$stMC, __$stMC, __$stMC |
| Type | Name and description |
|---|---|
java.util.Map<java.lang.String, ?> |
environment |
| Constructor and description |
|---|
protected BaseNodeJSExtension
(org.gradle.api.Project project)Constructs a new extension which is attached to the provided project. |
protected BaseNodeJSExtension
(org.gradle.api.Task task, T alternativeProjectExt)Constructs a new extension which is attached to the provided task. |
protected BaseNodeJSExtension
(org.gradle.api.Task task, java.lang.String projectExtName)Constructs a new extension which is attached to the provided task. |
protected BaseNodeJSExtension
(org.gradle.api.Task task, java.lang.Class<? super T> extClass)Constructs a new extension which is attached to the provided task. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
appendPath(org.gradle.api.provider.Provider<java.lang.String> postfix)Add search to system path. |
|
void |
environment(java.util.Map<java.lang.String, ?> args)Add environmental variables to be passed to the exe. |
|
protected org.ysb33r.grolifant.api.core.downloader.ExecutableDownloader |
getDownloader()Gets the downloader implementation. |
|
java.util.Map<java.lang.String, java.lang.String> |
getEnvironment()Environment for running the exe |
|
org.gradle.api.provider.Provider<java.io.File> |
getNpmCliJsProvider()Resolves a path to a npm executable that is associated with the configured Node.js. |
|
void |
prefixPath(org.gradle.api.provider.Provider<java.lang.String> prefix)Add search to system path |
|
protected java.lang.String |
runExecutableAndReturnVersion()Runs the executable and returns the version. |
|
void |
setEnvironment(java.util.Map<java.lang.String, ?> args)Replace current environment with new one. |
|
void |
useSystemPath()Adds the system path to the execution environment. |
| Methods inherited from class | Name |
|---|---|
class org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension |
org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#executableByVersion(java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#this$dist$invoke$3(java.lang.String, java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#this$dist$set$3(java.lang.String, java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#this$dist$get$3(java.lang.String), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#executableByPath(java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#executableBySearchPath(java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#setWindowsExtensionSearchOrder(java.lang.Iterable), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#setWindowsExtensionSearchOrder([Ljava.lang.String;), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#getWindowsExtensionSearchOrder(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#resolvedExecutableVersion(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#this$dist$invoke$2(java.lang.String, java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#this$dist$set$2(java.lang.String, java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#this$dist$get$2(java.lang.String), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#getExecutable(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#getProjectOperations(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#invokeMethod(java.lang.String, java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#getMetaClass(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#setMetaClass(groovy.lang.MetaClass), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#setProperty(java.lang.String, java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#getProperty(java.lang.String), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#wait(long, int), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#wait(long), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#wait(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#equals(java.lang.Object), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#toString(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#hashCode(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#getClass(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#notify(), org.ysb33r.grolifant.api.core.runnable.AbstractToolExtension#notifyAll() |
The default version of Node.js that will be used on a supported platform if nothing else is configured.
Constructs a new extension which is attached to the provided project.
project - Project this extension is associated with.Constructs a new extension which is attached to the provided task.
project - Project this extension is associated with.alternativeProjectExt - Alternative extension to use, rather than the default project extensionConstructs a new extension which is attached to the provided task. This is meant for other plugins that want to provide their own NodeJSExtension implementation
project - Project this extension is associated with.projectExtName - Name of the extension that is attached to the project.Constructs a new extension which is attached to the provided task. This is meant for other plugins that want to provide their own NodeJSExtension implementation
project - Project this extension is associated with.extClass - Type of the extension that is attached to the project.Add search to system path. In the case of a task this will be appended to both the task and project extension's version of the system path.
postfix - Provider of a path item that can be appended to the current system path.Add environmental variables to be passed to the exe.
args - Environmental variable key-value map.Gets the downloader implementation. Can throw an exception if downloading is not supported.
Environment for running the exe
Calling this will resolve all lazy-values in the variable map.
Resolves a path to a npm executable that is associated with the configured Node.js.
npm executable.ExecConfigurationException if executable was not configured.Add search to system path In the case of a task this will be prefixed to both the task and project extension's version of the system path.
prefix - Provider of a path item that can be prefixed to the current system path.Runs the executable and returns the version. See org.ysb33r.grolifant.internal.core.executable.ExecUtils#parseVersionFromOutput as a helper to implement this method.
Replace current environment with new one. If this is called on the task extension, no project extension environment will be used.
args - New environment key-value map of properties.Adds the system path to the execution environment.
Groovy Documentation