Class GenerateMainImports
java.lang.Object
io.jmix.flowui.devserver.frontend.GenerateMainImports
- All Implemented Interfaces:
Runnable
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.
-
Constructor Summary
ConstructorDescriptionGenerateMainImports
(com.vaadin.flow.server.frontend.scanner.ClassFinder classFinder, com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner frontendDepScanner, Options options, com.vaadin.flow.theme.AbstractTheme theme, elemental.json.JsonObject statsJson) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addCssLines
(Collection<String> lines, com.vaadin.flow.server.frontend.scanner.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) getCssLines
(List<com.vaadin.flow.server.frontend.scanner.CssData> css) Returns the JS code lines representing the CSS data provided as a parameter.protected String
getLines()
protected org.slf4j.Logger
Get logger for this instance.protected String
protected boolean
importedFileExists
(String importName) Validate that the fileimportName
can be found.protected boolean
If in memory collection we are collecting for devBundle check.protected String
resolveResource
(String importPath) void
run()
protected void
writeOutput
(Map<File, List<String>> outputFiles)
-
Constructor Details
-
GenerateMainImports
public GenerateMainImports(com.vaadin.flow.server.frontend.scanner.ClassFinder classFinder, com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner frontendDepScanner, Options options, com.vaadin.flow.theme.AbstractTheme theme, elemental.json.JsonObject statsJson)
-
-
Method Details
-
getLines
-
writeOutput
-
addCssLines
protected boolean addCssLines(Collection<String> lines, com.vaadin.flow.server.frontend.scanner.CssData cssData, int i) 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 counter- Returns:
- true if the imported CSS files does exist, false otherwise
-
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 fileimportName
can be found.- Parameters:
importName
- name of the file- Returns:
true
if file is found
-
run
public void run() -
getCssLines
Returns the JS code lines representing the CSS data provided as a parameter.Deduplicates the data so that each CSSData instance is loaded / injected only once.
- Parameters:
css
- the CSS import data- Returns:
- the JS statements needed to import and apply the CSS data
-
resolveResource
-
addLines
-
getThemeIdPrefix
-
merge
-