public class FrontendToolsSettings extends Object implements Serializable
FrontendTools
features.
This can be modified, but the choices will be locked in FrontendTools
when it is initialized. Until then any settings can be changed.
Constructor and Description |
---|
FrontendToolsSettings(String baseDir,
SerializableSupplier<String> alternativeDirGetter)
Create a tools configuration object.
|
Modifier and Type | Method and Description |
---|---|
Supplier<String> |
getAlternativeDirGetter()
Get the alternative directory getter.
|
String |
getBaseDir()
Get the defined base dir.
|
URI |
getNodeDownloadRoot()
Get the node download root to be used for downloading node.
|
String |
getNodeVersion()
Get the defined node version.
|
boolean |
isAutoUpdate()
Check if automatic updates are enabled.
|
boolean |
isForceAlternativeNode()
Check if alternative node usage should be forced.
|
boolean |
isIgnoreVersionChecks()
Check if version checks should be ignored.
|
boolean |
isUseGlobalPnpm()
Check if global pnpm should be used.
|
void |
setAlternativeDirGetter(SerializableSupplier<String> alternativeDirGetter)
Set the installation directory if no tools are found.
|
void |
setAutoUpdate(boolean autoUpdate)
When set to true the alternative version is updated to the latest default
node version as defined for the framework.
|
void |
setBaseDir(String baseDir)
Set the base directory for locating tools.
|
void |
setForceAlternativeNode(boolean forceAlternativeNode)
Set if the alternative folder should always be used even if a global
installation exists.
|
void |
setIgnoreVersionChecks(boolean ignoreVersionChecks)
Set if node and npm versions should be checked or not.
|
void |
setNodeDownloadRoot(URI nodeDownloadRoot)
Set the root URI for downloading node.
|
void |
setNodeVersion(String nodeVersion)
Set the node version to install when installation is required.
|
void |
setUseGlobalPnpm(boolean useGlobalPnpm)
Force usage of global pnpm.
|
public FrontendToolsSettings(String baseDir, SerializableSupplier<String> alternativeDirGetter)
The baseDir
is used as a base directory to locate the tools and
alternativeDirGetter
is the directory to install tools if they
are not found.
Note that if alternativeDir
is null
tools won't be
installed.
baseDir
- the base directory to locate the tools, not null
alternativeDirGetter
- the getter for a directory where tools will be installed if
they are not found globally or in the baseDir
, may be
null
public void setBaseDir(String baseDir)
baseDir
- the base directory to locate the tools, not null
public void setAlternativeDirGetter(SerializableSupplier<String> alternativeDirGetter)
alternativeDirGetter
- the getter for a directory where tools will be installed if
they are not found globally or in the baseDir
, may be
null
public void setNodeDownloadRoot(URI nodeDownloadRoot)
nodeDownloadRoot
- node download root uri, default is
public void setNodeVersion(String nodeVersion)
nodeVersion
- The node.js version to be used when node.js is installed
automatically, default is
public void setIgnoreVersionChecks(boolean ignoreVersionChecks)
ignoreVersionChecks
- set if versions should be validated, default is system
property for
public void setForceAlternativeNode(boolean forceAlternativeNode)
This will force the installation if a version doesn't exist in the folder
defined in alternativeDirGetter
.
forceAlternativeNode
- if true
force usage of node executable from
alternative directorypublic void setUseGlobalPnpm(boolean useGlobalPnpm)
useGlobalPnpm
- use globally installed pnpm instead of the default version
public void setAutoUpdate(boolean autoUpdate)
autoUpdate
- update node in alternativeDirGetter
if version older
than the current default
public String getBaseDir()
public Supplier<String> getAlternativeDirGetter()
public String getNodeVersion()
public URI getNodeDownloadRoot()
public boolean isIgnoreVersionChecks()
public boolean isForceAlternativeNode()
public boolean isUseGlobalPnpm()
public boolean isAutoUpdate()
Copyright © 2024. All rights reserved.