com.vaadin.flow.server.frontend.
Class GenerateMainImports
All Implemented Interfaces:
Collect generated-flow-imports content for project to use to determine if dev-bundle contains all required imports.
Only used when checking if dev bundle need to be rebuild in dev mode without a dev server.
For internal use only. May be renamed or removed in a future release.
-
Constructor Summary
ConstructorsConstructorDescriptionGenerateMainImports
(ClassFinder classFinder, FrontendDependenciesScanner frontendDepScanner, Options options, elemental.json.JsonObject statsJson) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addCssLines
(Collection<String> lines, CssData cssData, int i) Adds CSS imports to the generated flow imports file based on the given CssImport data.
protected void
addLines
(Collection<String> lines, String content) getCss()
Get all the CSS files used by the application.
protected Collection<String>
protected Collection<String>
Get exported modules.
protected Collection<String>
Get generated modules to import.
protected String
getLines()
protected org.slf4j.Logger
Get logger for this instance.
Get all ES6 modules needed for run the application.
protected URL
getResource
(String name) Get a resource from the classpath.
Get all the JS files used by the application.
protected AbstractTheme
getTheme()
Get the
AbstractTheme
instance used in the application.protected ThemeDefinition
Get the
ThemeDefinition
of the application.protected String
protected Collection<String>
Get theme lines for the generated imports file content.
protected boolean
importedFileExists
(String importName) Validate that the file
importName
can be found.protected boolean
If in memory collection we are collecting for devBundle check.
protected String
resolveResource
(String importPath) void
run()
protected void
updateImportsFile
(File importsFile, List<String> newContent) protected void
writeImportLines
(List<String> lines)
-
Constructor Details
-
GenerateMainImports
public GenerateMainImports(ClassFinder classFinder, FrontendDependenciesScanner frontendDepScanner, Options options, elemental.json.JsonObject statsJson)
-
-
Method Details
-
getLines
-
addCssLines
Adds CSS imports to the generated flow imports file based on the given CssImport data.
Parameters:
lines
- collection of generated file lines to add imports tocssData
- CssImport datai
- imported CSS counterReturns:
true if the imported CSS files does exist, false otherwise
-
writeImportLines
-
getModules
Get all ES6 modules needed for run the application. Modules that are theme dependencies are guaranteed to precede other modules in the result.
Returns:
list of JS modules
-
getScripts
Get all the JS files used by the application.
Returns:
the set of JS files
-
getResource
Get a resource from the classpath.
Parameters:
name
- class literalReturns:
the resource
-
getGeneratedModules
Get generated modules to import.
Returns:
generated modules
-
getThemeDefinition
Get the
ThemeDefinition
of the application.Returns:
the theme definition
-
getTheme
Get the
AbstractTheme
instance used in the application.Returns:
the theme instance
-
getCss
Get all the CSS files used by the application.
Returns:
the set of CSS files
-
getThemeLines
Get theme lines for the generated imports file content.
Returns:
theme related generated JS lines
-
getLogger
protected org.slf4j.Logger getLogger()Get logger for this instance.
Returns:
a logger
-
inMemoryCollection
protected boolean inMemoryCollection()If in memory collection we are collecting for devBundle check.
Returns:
true
if devBundle in memory collecting -
getImportsNotFoundMessage
-
importedFileExists
Validate that the file
importName
can be found.Parameters:
importName
- name of the fileReturns:
true
if file is found -
run
public void run() -
getExportLines
Get exported modules.
Returns:
exported lines.
-
getCssLines
-
updateImportsFile
Throws:
-
resolveResource
-
addLines
-
getThemeIdPrefix
-