public static class NodeTasks.Builder extends Object implements Serializable
NodeExecutor
instance.Constructor and Description |
---|
Builder(Lookup lookup,
File npmFolder,
File generatedPath,
File frontendDirectory,
String buildDirectory)
Create a builder instance with all parameters.
|
Builder(Lookup lookup,
File npmFolder,
File generatedPath,
String buildDirectory)
Create a builder instance with custom npmFolder and generatedPath
|
Builder(Lookup lookup,
File npmFolder,
String buildDirectory)
Create a builder instance given an specific npm folder.
|
Modifier and Type | Method and Description |
---|---|
NodeTasks |
build()
Creates a
NodeExecutor using this configuration. |
NodeTasks.Builder |
copyLocalResources(File localResourcesFolder)
Set local frontend files to be copied from given folder.
|
NodeTasks.Builder |
copyResources(Set<File> jars)
Sets whether copy resources from classpath to the appropriate npm
package folder so as they are available for webpack build.
|
NodeTasks.Builder |
copyTemplates(boolean copyTemplates)
Sets whether copy templates to
META-INF/VAADIN/config/templates . |
NodeTasks.Builder |
createMissingPackageJson(boolean create)
Sets whether to create the package file if missing.
|
NodeTasks.Builder |
enableImportsUpdate(boolean enableImportsUpdate)
Sets whether to enable imports file update.
|
NodeTasks.Builder |
enablePackagesUpdate(boolean enablePackagesUpdate)
Sets whether to enable packages and webpack file updates.
|
NodeTasks.Builder |
enablePnpm(boolean enable)
Enables pnpm tool.
|
String |
getBuildDirectory()
Get the name of the used build directory.
|
protected FeatureFlags |
getFeatureFlags() |
File |
getFlowResourcesFolder() |
File |
getFrontendDirectory()
Get the defined frontend directory.
|
File |
getGeneratedFolder()
Get the generated folder for this build.
|
File |
getNpmFolder()
Get the npm folder used for this build.
|
File |
getWebappResourcesDirectory()
Get the output directory for webpack output.
|
NodeTasks.Builder |
populateTokenFileData(elemental.json.JsonObject object)
Fill token file data into the provided
object . |
NodeTasks.Builder |
runNpmInstall(boolean runNpmInstall)
Sets whether run
npm install after updating
dependencies. |
NodeTasks.Builder |
setJavaResourceFolder(File javaResourceFolder)
Set the java resources folder to be checked for feature file.
|
NodeTasks.Builder |
setNodeAutoUpdate(boolean update)
Sets whether it is fine to automatically update the alternate node
installation if installed version is older than the current default.
|
NodeTasks.Builder |
useByteCodeScanner(boolean byteCodeScanner)
Sets frontend scanner strategy: byte code scanning strategy is used
if
byteCodeScanner is true , full classpath scanner
strategy is used otherwise (by default). |
NodeTasks.Builder |
useGlobalPnpm(boolean useGlobalPnpm)
Uses globally installed pnpm tool for frontend packages installation.
|
NodeTasks.Builder |
useV14Bootstrap(boolean useDeprecatedV14Bootstrapping)
Use V14 bootstrapping that disables index.html entry point.
|
NodeTasks.Builder |
withEmbeddableWebComponents(boolean generateEmbeddableWebComponents)
Sets whether to collect and package
WebComponentExporter dependencies. |
NodeTasks.Builder |
withFlowResourcesFolder(File flowResourcesFolder)
Sets the appropriate npm package folder for copying flow resources in
jars.
|
NodeTasks.Builder |
withFusionApplicationProperties(File applicationProperties)
Set application properties file for Spring project.
|
NodeTasks.Builder |
withFusionClientAPIFolder(File fusionClientTsApiFolder)
Set the folder where Ts files should be generated.
|
NodeTasks.Builder |
withFusionGeneratedOpenAPIJson(File generatedOpenAPIFile)
Set output location for the generated OpenAPI file.
|
NodeTasks.Builder |
withFusionJavaSourceFolder(File fusionJavaSourceFolder)
Set source paths that OpenAPI generator searches for endpoints.
|
NodeTasks.Builder |
withHomeNodeExecRequired(boolean requireHomeNodeExec)
Requires node executable to be installed in vaadin home folder.
|
NodeTasks.Builder |
withNodeDownloadRoot(URI nodeDownloadRoot)
Sets the download node.js URL.
|
NodeTasks.Builder |
withNodeVersion(String nodeVersion)
Sets the node.js version to be used when node.js is installed
automatically by Vaadin, for example
"v16.0.0" . |
NodeTasks.Builder |
withProductionMode(boolean productionMode)
Sets the production mode.
|
NodeTasks.Builder |
withTokenFile(File tokenFile)
Sets the token file (flow-build-info.json) path.
|
NodeTasks.Builder |
withWebpack(File webappResourcesDirectory,
File resourceOutputDirectory,
String webpackTemplate,
String webpackGeneratedTemplate)
Sets the webpack related properties.
|
public Builder(Lookup lookup, File npmFolder, String buildDirectory)
lookup
- a Lookup
to discover services used by Flow (SPI)npmFolder
- folder with the `package.json` filebuildDirectory
- project build directorypublic Builder(Lookup lookup, File npmFolder, File generatedPath, String buildDirectory)
lookup
- a Lookup
to discover services used by Flow (SPI)npmFolder
- folder with the `package.json` filegeneratedPath
- folder where flow generated files will be placed.buildDirectory
- project build directorypublic Builder(Lookup lookup, File npmFolder, File generatedPath, File frontendDirectory, String buildDirectory)
lookup
- a Lookup
to discover services used by Flow (SPI)npmFolder
- folder with the `package.json` filegeneratedPath
- folder where flow generated files will be placed.frontendDirectory
- a directory with project's frontend filesbuildDirectory
- project build directorypublic NodeTasks build()
NodeExecutor
using this configuration.NodeExecutor
instancepublic NodeTasks.Builder withWebpack(File webappResourcesDirectory, File resourceOutputDirectory, String webpackTemplate, String webpackGeneratedTemplate)
webappResourcesDirectory
- the directory to set for webpack to output its build
results, meant for serving from context root.resourceOutputDirectory
- the directory to output generated non-served resources,
such as the "config/stats.json" stats file, and the
"config/flow-build-info.json" token file.webpackTemplate
- name of the webpack resource to be used as template when
creating the webpack.config.js
file.webpackGeneratedTemplate
- name of the webpack resource to be used as template when
creating the webpack.generated.js
file.public NodeTasks.Builder enablePackagesUpdate(boolean enablePackagesUpdate)
true
.enablePackagesUpdate
- true
to enable packages and webpack update,
otherwise false
public NodeTasks.Builder enableImportsUpdate(boolean enableImportsUpdate)
false
. This will also enable creation of missing package
files if set to true.enableImportsUpdate
- true
to enable imports file update, otherwise
false
public NodeTasks.Builder runNpmInstall(boolean runNpmInstall)
npm install
after updating
dependencies.runNpmInstall
- run npm install. Default is false
public NodeTasks.Builder withFlowResourcesFolder(File flowResourcesFolder)
flowResourcesFolder
- target folderpublic NodeTasks.Builder copyResources(Set<File> jars)
jars
- set of class nodes to be visited. Not null
public NodeTasks.Builder copyTemplates(boolean copyTemplates)
META-INF/VAADIN/config/templates
.copyTemplates
- whether to copy templatespublic NodeTasks.Builder withEmbeddableWebComponents(boolean generateEmbeddableWebComponents)
WebComponentExporter
dependencies.generateEmbeddableWebComponents
- collect dependencies. Default is true
public NodeTasks.Builder createMissingPackageJson(boolean create)
create
- create the packagepublic NodeTasks.Builder copyLocalResources(File localResourcesFolder)
localResourcesFolder
- folder to copy local frontend files frompublic NodeTasks.Builder useV14Bootstrap(boolean useDeprecatedV14Bootstrapping)
useDeprecatedV14Bootstrapping
- true
to use legacy V14 bootstrappingpublic NodeTasks.Builder withFusionClientAPIFolder(File fusionClientTsApiFolder)
fusionClientTsApiFolder
- folder for Ts files in the frontend.public NodeTasks.Builder withFusionApplicationProperties(File applicationProperties)
applicationProperties
- application properties file.public NodeTasks.Builder withFusionGeneratedOpenAPIJson(File generatedOpenAPIFile)
generatedOpenAPIFile
- the generated output file.public NodeTasks.Builder withFusionJavaSourceFolder(File fusionJavaSourceFolder)
fusionJavaSourceFolder
- java source folderpublic NodeTasks.Builder useByteCodeScanner(boolean byteCodeScanner)
byteCodeScanner
is true
, full classpath scanner
strategy is used otherwise (by default).byteCodeScanner
- if true
then byte code scanner is used, full
scanner is used otherwise (by default).public NodeTasks.Builder populateTokenFileData(elemental.json.JsonObject object)
object
.object
- the object to fill with token file datapublic NodeTasks.Builder withTokenFile(File tokenFile)
tokenFile
- token file pathpublic NodeTasks.Builder enablePnpm(boolean enable)
"pnpm" will be used instead of "npm".
enable
- enables pnpm.public NodeTasks.Builder useGlobalPnpm(boolean useGlobalPnpm)
useGlobalPnpm
- uses globally installed pnpm instead of default one, see
FrontendTools.DEFAULT_PNPM_VERSION
.public NodeTasks.Builder withHomeNodeExecRequired(boolean requireHomeNodeExec)
requireHomeNodeExec
- requires vaadin home node execpublic NodeTasks.Builder withNodeVersion(String nodeVersion)
"v16.0.0"
. Defaults
to .nodeVersion
- the new node version to download, not null.public NodeTasks.Builder withNodeDownloadRoot(URI nodeDownloadRoot)
NodeInstaller.DEFAULT_NODEJS_DOWNLOAD_ROOT
.nodeDownloadRoot
- the new download URL to set, not null.public NodeTasks.Builder withProductionMode(boolean productionMode)
productionMode
- true
to enable production mode, otherwise
false
public NodeTasks.Builder setNodeAutoUpdate(boolean update)
update
- true to update alternate node when usedpublic File getNpmFolder()
public File getGeneratedFolder()
public File getWebappResourcesDirectory()
public File getFrontendDirectory()
public String getBuildDirectory()
By default this will be target
for maven and build
for gradle.
public NodeTasks.Builder setJavaResourceFolder(File javaResourceFolder)
Needed for plugin execution.
javaResourceFolder
- java resources folderprotected FeatureFlags getFeatureFlags()
public File getFlowResourcesFolder()
Copyright © 2022. All rights reserved.