Package com.vaadin.flow.plugin.base
Class BuildFrontendUtil
- java.lang.Object
-
- com.vaadin.flow.plugin.base.BuildFrontendUtil
-
public class BuildFrontendUtil extends Object
Util class provides all methods a Plugin will need.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 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 voidrunWebpack(PluginAdapterBase adapter, FrontendTools frontendTools)Runs the Webpack buildstatic voidupdateBuildFile(PluginAdapterBuild adapter)Add the devMode token to build token file so we don't try to start the dev server.
-
-
-
Method Detail
-
getClassFinder
public static ClassFinder getClassFinder(List<String> classpathElements)
creates aClassFinderfrom a List of classpathElements.- Parameters:
classpathElements- the list of classpath elements- Returns:
- the
ClassFinderthat uses the classpathElements
-
getTokenFile
public static File getTokenFile(PluginAdapterBase adapter)
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
public static File propagateBuildInfo(PluginAdapterBase adapter)
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().
-
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
-
runWebpack
public static void runWebpack(PluginAdapterBase adapter, FrontendTools frontendTools) throws TimeoutException, URISyntaxException
Runs the Webpack build- Parameters:
adapter- - the PluginAdapterBase.frontendTools- - frontend tools access object- Throws:
TimeoutException- - while run webpackURISyntaxException- - 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
public static void updateBuildFile(PluginAdapterBuild adapter)
Add the devMode token to build token file so we don't try to start the dev server. Remove the abstract folder paths as they should not be used for prebuilt bundles.- Parameters:
adapter- - the PluginAdapterBase.
-
-