Package com.vaadin.flow.plugin.base
Class BuildFrontendUtil
java.lang.Object
com.vaadin.flow.plugin.base.BuildFrontendUtil
Util class provides all methods a Plugin will need.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassFindergetClassFinder(List<String> classpathElements) creates aClassFinderfrom a List of classpathElements.static FilegetTokenFile(PluginAdapterBase adapter) Location of the Token File.static voidprepareFrontend(PluginAdapterBase adapter) Prepares the Frontendstatic FilepropagateBuildInfo(PluginAdapterBase adapter) Propagates the BuildInfo.static voidremoveBuildFile(PluginAdapterBuild adapter) Delete the build token file.static voidrunDevBuildNodeUpdater(PluginAdapterBuild adapter) Run a dev-bundle build.static voidrunFrontendBuild(PluginAdapterBase adapter) Execute the frontend build with the wanted build system.static voidrunNodeUpdater(PluginAdapterBuild adapter) runs the node-Updater.static voidrunVite(PluginAdapterBase adapter, FrontendTools frontendTools) Runs the Vite buildstatic voidupdateBuildFile(PluginAdapterBuild adapter) Updates the build info after the bundle has been built by build-frontend.
-
Method Details
-
getClassFinder
creates aClassFinderfrom a List of classpathElements.- Parameters:
classpathElements- the list of classpath elements- Returns:
- the
ClassFinderthat uses the classpathElements
-
getTokenFile
Location of the Token File.- Parameters:
adapter- - the PluginAdapterBase.- Returns:
Filethe Token File
-
prepareFrontend
public static void prepareFrontend(PluginAdapterBase adapter) throws IOException, ExecutionFailedException, URISyntaxException Prepares the Frontend- Parameters:
adapter- - the PluginAdapterBase.- Throws:
IOException- - Could not forceMkdir(adapter.generatedFolder());ExecutionFailedException- - While NodeTasks.execute()URISyntaxException- - Could not build an URI from nodeDownloadRoot().
-
propagateBuildInfo
Propagates the BuildInfo.- Parameters:
adapter- - the PluginAdapterBase.- Returns:
- the Token
File.
-
runNodeUpdater
public static void runNodeUpdater(PluginAdapterBuild adapter) throws ExecutionFailedException, URISyntaxException runs the node-Updater.- Parameters:
adapter- - the PluginAdapterBase.- Throws:
ExecutionFailedException- - a ExecutionFailedException.URISyntaxException- - - Could not build an URI from nodeDownloadRoot().
-
runDevBuildNodeUpdater
public static void runDevBuildNodeUpdater(PluginAdapterBuild adapter) throws ExecutionFailedException, URISyntaxException, IOException Run a dev-bundle build.- Parameters:
adapter- - the PluginAdapterBase.- Throws:
ExecutionFailedException- - a ExecutionFailedException.URISyntaxException- - - Could not build an URI from nodeDownloadRoot().IOException
-
runFrontendBuild
public static void runFrontendBuild(PluginAdapterBase adapter) throws TimeoutException, URISyntaxException Execute the frontend build with the wanted build system.- Parameters:
adapter- - the PluginAdapterBase.- Throws:
TimeoutException- - while running build systemURISyntaxException- - while parsing nodeDownloadRoot()) to URI
-
runVite
public static void runVite(PluginAdapterBase adapter, FrontendTools frontendTools) throws TimeoutException, URISyntaxException Runs the Vite build- Parameters:
adapter- - the PluginAdapterBase.frontendTools- - frontend tools access object- Throws:
TimeoutException- - while running viteURISyntaxException- - while parsing nodeDownloadRoot()) to URI
-
updateBuildFile
Updates the build info after the bundle has been built by build-frontend.Removes the abstract folder paths as they should not be used for prebuilt bundles and ensures production mode is set to true.
- Parameters:
adapter- - the PluginAdapterBase.
-
removeBuildFile
Delete the build token file. This is used with dev-bundle build as token file should never be added to the package.- Parameters:
adapter- used plugin adapter implementation- Throws:
IOException
-