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
ConstructorsConstructorDescriptionGenerateMainImports(com.vaadin.flow.server.frontend.scanner.ClassFinder classFinder, com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner frontendDepScanner, Options options, com.vaadin.flow.theme.ThemeDefinition themeDefinition, elemental.json.JsonObject statsJson) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddCssLines(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 voidaddLines(Collection<String> lines, String content) protected Set<com.vaadin.flow.server.frontend.scanner.CssData>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 StringgetLines()protected org.slf4j.LoggerGet logger for this instance.Get all ES6 modules needed for run the application.protected URLgetResource(String name) Get a resource from the classpath.Get all the JS files used by the application.protected com.vaadin.flow.theme.AbstractThemegetTheme()Get theAbstractThemeinstance used in the application.protected com.vaadin.flow.theme.ThemeDefinitionGet theThemeDefinitionof the application.protected Stringprotected Collection<String>Get theme lines for the generated imports file content.protected booleanimportedFileExists(String importName) Validate that the fileimportNamecan be found.protected booleanIf in memory collection we are collecting for devBundle check.protected StringresolveResource(String importPath) voidrun()protected voidupdateImportsFile(File importsFile, List<String> newContent) protected voidwriteImportLines(List<String> lines)
-
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.ThemeDefinition themeDefinition, elemental.json.JsonObject statsJson)
-
-
Method Details
-
getLines
-
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
-
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 literal- Returns:
- the resource
-
getGeneratedModules
Get generated modules to import.- Returns:
- generated modules
-
getThemeDefinition
protected com.vaadin.flow.theme.ThemeDefinition getThemeDefinition()Get theThemeDefinitionof the application.- Returns:
- the theme definition
-
getTheme
protected com.vaadin.flow.theme.AbstractTheme getTheme()Get theAbstractThemeinstance 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:
trueif devBundle in memory collecting
-
getImportsNotFoundMessage
-
importedFileExists
Validate that the fileimportNamecan be found.- Parameters:
importName- name of the file- Returns:
trueif file is found
-
run
public void run() -
getExportLines
Get exported modules.- Returns:
- exported lines.
-
getCssLines
-
updateImportsFile
- Throws:
IOException
-
resolveResource
-
addLines
-
getThemeIdPrefix
-