public static class MigrationConfiguration.Builder extends Object
MigrationConfiguration. Allows to set all required
parameters via setters fluent API.| Constructor and Description |
|---|
Builder(File baseDir)
Creates a new instance of the builded with provided
baseDir. |
| Modifier and Type | Method and Description |
|---|---|
MigrationConfiguration |
build()
Builds the immutable configuration based on the builder.
|
MigrationConfiguration.Builder |
setAnnotationRewriteStrategy(AnnotationsRewriteStrategy strategy)
Sets the annotation rewrite strategy.
|
MigrationConfiguration.Builder |
setClassFinder(ClassFinder finder)
Sets the class finder instance.
|
MigrationConfiguration.Builder |
setCompiledClassDirectory(File classDirectory)
Sets java binary (compiled) classes directory.
|
MigrationConfiguration.Builder |
setIgnoreModulizerErrors(boolean ignoreModulizerErrors)
Sets whether the build should be considered successful even if there
are Modulizer errors.
|
MigrationConfiguration.Builder |
setJavaSourceRoots(File[] sourceRoots)
Sets java source roots.
|
MigrationConfiguration.Builder |
setKeepOriginalFiles(boolean keepOriginal)
Sets whether the original resources should be preserved.
|
void |
setPnpmEnabled(boolean enable)
Enables "pnpm" tool so that it will be used instead of "npm" to
install frontend resources.
|
MigrationConfiguration.Builder |
setResourceDirectories(File[] resourceDirs)
Sets the resource files directories.
|
MigrationConfiguration.Builder |
setTargetDirectory(File targetDir)
Sets the target directory where the resource files will be stored
after the migration.
|
MigrationConfiguration.Builder |
setTemporaryMigrationFolder(File file)
Sets temporary migration folder where the migration happens.
|
public Builder(File baseDir)
baseDir.baseDir - base project directorypublic MigrationConfiguration.Builder setTemporaryMigrationFolder(File file)
The folder value is not required. It it's not set then temporary folder will be used. This folder will be removed once the migration happens regardless of result.
file - the migration folderpublic MigrationConfiguration.Builder setResourceDirectories(File[] resourceDirs)
There can be several resource roots. They contains HTML tempate files
and stylesheet files. The hierarchical structure will be transfered
into the target directory (see setTargetDirectory(File) as
is (except "frontend" directory whose files and subdirs are moved
ignoring the "frontend" dir).
resourceDirs - resource rootspublic MigrationConfiguration.Builder setTargetDirectory(File targetDir)
This directory is usually is "frontend" folder inside base dir
targetDir - the target directorypublic MigrationConfiguration.Builder setKeepOriginalFiles(boolean keepOriginal)
By default the original resources are removed if there were no errors during migration.
keepOriginal - whether the original resources should be preservedpublic MigrationConfiguration.Builder setIgnoreModulizerErrors(boolean ignoreModulizerErrors)
Modulizer is an external tool which is used internally for converting resource files. Modulizer process exit status may be non zero even if all files have been converted correctly. By default the exit status code is ignored.
ignoreModulizerErrors - whether the tool should fail is Modulizer failspublic MigrationConfiguration.Builder setClassFinder(ClassFinder finder)
finder - a class finderpublic MigrationConfiguration.Builder setJavaSourceRoots(File[] sourceRoots)
Java source roots contain java files which should be rewritten to use
JsModule annotation instead of HtmlImport and
StyleSheet.
sourceRoots - java source rootspublic MigrationConfiguration.Builder setCompiledClassDirectory(File classDirectory)
The java files from source roots (setJavaSourceRoots(File[])
must be compiled when the migration is done into this directory.
classDirectory - compiled java classes directorypublic MigrationConfiguration.Builder setAnnotationRewriteStrategy(AnnotationsRewriteStrategy strategy)
This strategy is used to control annotation ( HtmlImport and
StyleSheet rewrite logic. By default the annotation are
always rewritten regardless of conversation status.
strategy - the annotation rewrite strategypublic void setPnpmEnabled(boolean enable)
enable - enable pnpmpublic MigrationConfiguration build()
Copyright © 2000–2025 Vaadin Ltd. All rights reserved.