public class JkNodeJs
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_NODE_VERSION |
| Modifier and Type | Method and Description |
|---|---|
JkNodeJs |
configure(dev.jeka.core.api.project.JkProject project,
java.lang.String clientBaseDir,
java.lang.String clientBuildDir,
java.lang.String... buildCommands)
Configures the specified project to include a nodeJs build right after main compilation.
|
JkNodeJs |
exec(java.lang.String commandLine)
Executes the specified 'npm or npx' command line.
|
java.lang.String |
getVersion() |
java.nio.file.Path |
getWorkingDir() |
JkNodeJs |
npm(java.lang.String commandLine)
Executes the specified npm command line.
|
JkNodeJs |
npx(java.lang.String commandLine)
Executes the specified npx command line.
|
static JkNodeJs |
of(java.nio.file.Path nodeJsInstallDir)
Creates a
JkNodeJs wrapping on a nodeJs distribution located in the specified install dir. |
static JkNodeJs |
ofDefaultVersion()
Creates a
JkNodeJs wrapping the default version. |
static JkNodeJs |
ofVersion(java.lang.String version)
Creates a
JkNodeJs wrapping the specified version. |
JkNodeJs |
setWorkingDir(java.nio.file.Path workingDir)
Sets the working directory from where
npm(String) and npx(String) should be run. |
public static final java.lang.String DEFAULT_NODE_VERSION
public static JkNodeJs of(java.nio.file.Path nodeJsInstallDir)
JkNodeJs wrapping on a nodeJs distribution located in the specified install dir.nodeJsInstallDir - Path to nodeJs installation directorypublic static JkNodeJs ofVersion(java.lang.String version)
JkNodeJs wrapping the specified version.
Jeka caches nodeJs distribution in a specific directory. If the specified version is not
present in cache, it is downloaded automatically.version - Version of nodeJs to use.public static JkNodeJs ofDefaultVersion()
JkNodeJs wrapping the default version.ofVersion(String)public JkNodeJs setWorkingDir(java.nio.file.Path workingDir)
npm(String) and npx(String) should be run.public java.nio.file.Path getWorkingDir()
public java.lang.String getVersion()
public JkNodeJs npm(java.lang.String commandLine)
commandLine - Command line to be executed by npm. The 'npm' command should
not be included in the command line.public JkNodeJs npx(java.lang.String commandLine)
commandLine - Command line to be executed by npx. The 'npx' command should
not be included in the command line.public JkNodeJs exec(java.lang.String commandLine)
commandLine - mMst start with either 'npm' nor 'npx'.public JkNodeJs configure(dev.jeka.core.api.project.JkProject project, java.lang.String clientBaseDir, java.lang.String clientBuildDir, java.lang.String... buildCommands)
project - The project to configureclientBaseDir - The path, relative to project base dir, of the nodeJs subproject.clientBuildDir - The path, relative to @clientBuildDir, of the directory containing the build result.buildCommands - The commands (npm o npx) to execute to build the nodeJs project.