public interface NpmExtensionMethods extends NpmConfigCacheSafeOperations
Methods than Npm extension is required to implement.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public NpmExecSpec |
createExecSpec()Create execution specification. |
|
public void |
executableIsBundled()Use the NPM that is bundled with Node. |
|
public File |
getGlobalConfig()Location and name of global NPM config file. |
|
public File |
getHomeDirectory()The NPM home directory - the parent directory of node_modules, |
|
public File |
getLocalConfig()Location and name of local NPM config file. |
|
public Provider<File> |
getProjectConfig()Location of .npmrc for a project. |
|
public void |
globalConfig(Object path)Sets global config file. |
|
public void |
homeDirectory(Object homeDir)Sets the home directory. |
|
public void |
localConfig(Object path)Sets local config file. |
|
public void |
setGlobalConfig(Object path)Sets global config file. |
|
public void |
setHomeDirectory(Object homeDir)Sets the home directory. |
|
public void |
setLocalConfig(Object path)Sets local config file. |
|
public Provider<File> |
useGlobalGradleLocation()Sets it to use the equivalent of getGradleHomeDir()/.npmrc. |
|
public Provider<File> |
useGlobalSystemLocation()Tries to determine the location where global config will typically be placed. |
|
public Provider<File> |
useLocalProjectLocation()Use to indicate that userconfig should be retrieved from the NPM home directory as configured by getHomeDirectory(). |
|
public Provider<File> |
useLocalUserProfileLocation()Use to indicate that userconfig should be retrieved from the user's home directory. |
|
public void |
usePackageJsonVersionAsProjectVersion()Use the version specified in package.json as the version of the project. |
| Methods inherited from class | Name |
|---|---|
interface NpmConfigCacheSafeOperations |
from, getExecutable, getGlobalConfigProvider, getHomeDirectoryProvider, getLocalConfigProvider, getNpxCliJsProvider, getProjectConfigProvider, getVersionProvider |
Create execution specification.
Use the NPM that is bundled with Node.
This is the default and should rarely be required.
Location and name of global NPM config file.
When this extension is attached to a project, the default location is set to
"${project.gradle.gradleUserHomeDir/npmrc"}
The NPM home directory - the parent directory of node_modules,
node_modules. Never null if the extension is tied to a project,
in which case it defaults to project.projectDir. Location and name of local NPM config file.
When this extension is attached to a project, the default location is set to
"${project.rootProject.projectDir/npmrc"}
Location of .npmrc for a project.
Sets global config file.
path - Anything that can be converted using project.file.Sets the home directory.
homeDir - A directory in which node_modules will be created as a child folder.
Anything that can be resolved with project.file is acceptableSets local config file.
path - Anything that can be converted using project.file.Sets global config file.
path - Anything that can be converted using project.file.Sets the home directory.
homeDir - A directory in which node_modules will be created as a child folder.
Anything that can be resolved with project.file is acceptableSets local config file.
path - Anything that can be converted using project.file. Sets it to use the equivalent of getGradleHomeDir()/.npmrc.
This allows Gradle projects to be custom configured on local system without being affected by any system-wide node installations.
Tries to determine the location where global config will typically be placed.
Use to indicate that userconfig should be retrieved from the NPM home directory as configured by getHomeDirectory().
.npmrcUse to indicate that userconfig should be retrieved from the user's home directory.
Typically, this is ~/.npmrc or %APPDATA\npm\.npmrc
.npmrc Use the version specified in package.json as the version of the project.
If package.json does not exist, then undefined is used as the version.