Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
import com.vaadin.flow.di.ResourceProvider;
import com.vaadin.flow.internal.AnnotationReader;
import com.vaadin.flow.internal.FileIOUtils;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.internal.Pair;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.DependencyFilter;
import com.vaadin.flow.server.VaadinService;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.shared.ui.Dependency;
import com.vaadin.flow.shared.ui.LoadMode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
import com.vaadin.flow.component.dependency.JavaScript;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.plugin.base.BuildFrontendUtil;
import com.vaadin.flow.plugin.base.PluginAdapterBase;
import com.vaadin.flow.plugin.base.PluginAdapterBuild;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.InitParameters;
import com.vaadin.flow.server.frontend.ExecutionFailedException;
import com.vaadin.flow.server.frontend.FrontendTools;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.server.frontend.installer.NodeInstaller;
import com.vaadin.flow.server.frontend.installer.Platform;
import com.vaadin.flow.server.frontend.scanner.ClassFinder;
Expand All @@ -72,7 +72,6 @@
import static com.vaadin.flow.server.Constants.META_INF;
import static com.vaadin.flow.server.Constants.VAADIN_SERVLET_RESOURCES;
import static com.vaadin.flow.server.Constants.VAADIN_WEBAPP_RESOURCES;
import static com.vaadin.flow.server.frontend.FrontendUtils.FRONTEND;

/**
* Goal that builds the dev frontend bundle to be used in Express Build mode.
Expand Down Expand Up @@ -179,7 +178,8 @@ public class BuildDevBundleMojo extends AbstractMojo
/**
* A directory with project's frontend source files.
*/
@Parameter(defaultValue = "${project.basedir}/src/main/" + FRONTEND)
@Parameter(defaultValue = "${project.basedir}/src/main/"
+ FrontendUtils.FRONTEND)
private File frontendDirectory;

@Parameter(property = InitParameters.NPM_EXCLUDE_WEB_COMPONENTS, defaultValue = "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import kotlin.test.expect
import com.vaadin.flow.internal.JacksonUtils
import com.vaadin.flow.internal.StringUtil
import com.vaadin.flow.server.InitParameters
import com.vaadin.flow.server.frontend.FrontendUtils
import tools.jackson.databind.JsonNode
import com.vaadin.flow.internal.FrontendUtils
import tools.jackson.databind.JsonNode
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.TaskOutcome
import org.junit.Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package com.vaadin.flow.gradle
import java.io.File
import com.vaadin.flow.plugin.base.BuildFrontendUtil
import com.vaadin.flow.server.Constants
import com.vaadin.flow.server.frontend.FrontendUtils
import com.vaadin.flow.internal.FrontendUtils
import org.gradle.api.provider.Property
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.OutputFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import com.vaadin.flow.plugin.base.BuildFrontendUtil
import com.vaadin.flow.server.Constants
import com.vaadin.flow.server.InitParameters
import com.vaadin.flow.server.frontend.BundleValidationUtil
import com.vaadin.flow.server.frontend.FrontendUtils
import com.vaadin.flow.internal.FrontendUtils
import com.vaadin.flow.server.frontend.Options
import com.vaadin.flow.server.frontend.TaskCleanFrontendFiles
import com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner
import com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner.FrontendDependenciesScannerFactory
import com.vaadin.flow.server.frontend.FrontendBuildUtils
import com.vaadin.pro.licensechecker.LicenseChecker
import com.vaadin.pro.licensechecker.MissingLicenseKeyException
import org.gradle.api.DefaultTask
Expand Down Expand Up @@ -151,7 +152,7 @@ public abstract class VaadinBuildFrontendTask : DefaultTask() {
* @return `true` to remove created files, `false` to keep the files
*/
protected open fun cleanFrontendFiles(): Boolean {
if (FrontendUtils.isHillaUsed(BuildFrontendUtil.getFrontendDirectory(adapter.get()),
if (FrontendBuildUtils.isHillaUsed(BuildFrontendUtil.getFrontendDirectory(adapter.get()),
adapter.get().classFinder)) {
/*
* Override this to not clean generated frontend files after the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.vaadin.flow.server.Constants
import com.vaadin.flow.server.InitParameters
import com.vaadin.flow.server.frontend.FrontendTools
import com.vaadin.flow.server.frontend.FrontendToolsSettings
import com.vaadin.flow.server.frontend.FrontendUtils
import com.vaadin.flow.internal.FrontendUtils
import com.vaadin.flow.server.frontend.installer.NodeInstaller
import com.vaadin.flow.server.frontend.installer.Platform
import groovy.lang.Closure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
import com.vaadin.flow.component.dependency.JavaScript;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.plugin.base.BuildFrontendUtil;
import com.vaadin.flow.plugin.base.PluginAdapterBuild;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.InitParameters;
import com.vaadin.flow.server.frontend.BundleValidationUtil;
import com.vaadin.flow.server.frontend.ExecutionFailedException;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.server.frontend.Options;
import com.vaadin.flow.server.frontend.TaskCleanFrontendFiles;
import com.vaadin.flow.server.frontend.scanner.FrontendDependenciesScanner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.build.BuildContext;

import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.internal.StringUtil;
import com.vaadin.flow.plugin.base.BuildFrontendUtil;
import com.vaadin.flow.plugin.base.PluginAdapterBase;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.InitParameters;
import com.vaadin.flow.server.frontend.FrontendTools;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.server.frontend.installer.NodeInstaller;
import com.vaadin.flow.server.frontend.installer.Platform;
import com.vaadin.flow.server.frontend.scanner.ClassFinder;
import com.vaadin.flow.server.scanner.ReflectionsClassFinder;

import static com.vaadin.flow.server.Constants.VAADIN_SERVLET_RESOURCES;
import static com.vaadin.flow.server.Constants.VAADIN_WEBAPP_RESOURCES;
import static com.vaadin.flow.server.frontend.FrontendUtils.FRONTEND;
import static com.vaadin.flow.server.frontend.FrontendUtils.GENERATED;

/**
* The base class of Flow Mojos in order to compute correctly the modes.
Expand Down Expand Up @@ -92,7 +90,8 @@ public abstract class FlowModeAbstractMojo extends AbstractMojo
/**
* A directory with project's frontend source files.
*/
@Parameter(defaultValue = "${project.basedir}/src/main/" + FRONTEND)
@Parameter(defaultValue = "${project.basedir}/src/main/"
+ FrontendUtils.FRONTEND)
private File frontendDirectory;

/**
Expand Down Expand Up @@ -476,7 +475,7 @@ public File generatedTsFolder() {
if (generatedTsFolder != null) {
return generatedTsFolder;
}
return new File(frontendDirectory(), GENERATED);
return new File(frontendDirectory(), FrontendUtils.GENERATED);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import org.apache.maven.shared.invoker.MavenInvocationException;

import com.vaadin.flow.di.Lookup;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.server.frontend.ExecutionFailedException;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.server.frontend.NodeTasks;
import com.vaadin.flow.server.frontend.Options;
import com.vaadin.flow.server.frontend.scanner.ClassFinder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;

import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.plugin.base.BuildFrontendUtil;
import com.vaadin.flow.server.frontend.FrontendUtils;

/**
* This goal checks that node and npm tools are installed and creates or updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
import tools.jackson.databind.node.ObjectNode;

import com.vaadin.flow.di.Lookup;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.internal.JacksonUtils;
import com.vaadin.flow.internal.StringUtil;
import com.vaadin.flow.plugin.TestUtils;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.InitParameters;
import com.vaadin.flow.server.frontend.EndpointGeneratorTaskFactory;
import com.vaadin.flow.server.frontend.FrontendTools;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.server.frontend.installer.NodeInstaller;
import com.vaadin.flow.server.frontend.scanner.ClassFinder;
import com.vaadin.pro.licensechecker.LicenseException;
Expand All @@ -84,14 +84,6 @@
import static com.vaadin.flow.server.InitParameters.APPLICATION_IDENTIFIER;
import static com.vaadin.flow.server.InitParameters.FRONTEND_HOTDEPLOY;
import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_PRODUCTION_MODE;
import static com.vaadin.flow.server.frontend.FrontendUtils.DEFAULT_FRONTEND_DIR;
import static com.vaadin.flow.server.frontend.FrontendUtils.FRONTEND_FOLDER_ALIAS;
import static com.vaadin.flow.server.frontend.FrontendUtils.IMPORTS_D_TS_NAME;
import static com.vaadin.flow.server.frontend.FrontendUtils.IMPORTS_NAME;
import static com.vaadin.flow.server.frontend.FrontendUtils.NODE_MODULES;
import static com.vaadin.flow.server.frontend.FrontendUtils.TOKEN_FILE;
import static com.vaadin.flow.server.frontend.FrontendUtils.VITE_CONFIG;
import static com.vaadin.flow.server.frontend.FrontendUtils.VITE_GENERATED_CONFIG;
import static java.io.File.pathSeparator;

@NotThreadSafe
Expand Down Expand Up @@ -125,18 +117,20 @@
projectBase = temporaryFolder.getRoot();

tokenFile = new File(temporaryFolder.getRoot(),
VAADIN_SERVLET_RESOURCES + TOKEN_FILE);
VAADIN_SERVLET_RESOURCES + FrontendUtils.TOKEN_FILE);

File npmFolder = projectBase;
nodeModulesPath = new File(npmFolder, NODE_MODULES);
frontendDirectory = new File(npmFolder, DEFAULT_FRONTEND_DIR);
nodeModulesPath = new File(npmFolder, FrontendUtils.NODE_MODULES);
frontendDirectory = new File(npmFolder,
FrontendUtils.DEFAULT_FRONTEND_DIR);
importsFile = FrontendUtils.getFlowGeneratedImports(frontendDirectory);
jarResourcesFolder = new File(
new File(frontendDirectory, FrontendUtils.GENERATED),
FrontendUtils.JAR_RESOURCES_FOLDER);
packageJson = new File(npmFolder, PACKAGE_JSON).getAbsolutePath();
viteConfig = new File(npmFolder, VITE_CONFIG).getAbsolutePath();
viteGenerated = new File(npmFolder, VITE_GENERATED_CONFIG)
viteConfig = new File(npmFolder, FrontendUtils.VITE_CONFIG)
.getAbsolutePath();
viteGenerated = new File(npmFolder, FrontendUtils.VITE_GENERATED_CONFIG)
.getAbsolutePath();
webpackOutputDirectory = new File(projectBase, VAADIN_WEBAPP_RESOURCES);
resourceOutputDirectory = new File(projectBase,
Expand Down Expand Up @@ -223,7 +217,7 @@
}

@After
public void teardown() throws IOException {

Check warning on line 220 in flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the declaration of thrown exception 'java.io.IOException', as it cannot be thrown from method's body.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZsSlXoa3XHNufa5Dl5c&open=AZsSlXoa3XHNufa5Dl5c&pullRequest=22982
if (FileUtils.fileExists(packageJson)) {
FileUtils.fileDelete(packageJson);
}
Expand Down Expand Up @@ -338,8 +332,8 @@
"build");

List<File> initialFiles = gatherFiles(jarResourcesFolder);
initialFiles.forEach(file -> Assert.assertFalse(String.format(
"Test resource shouldn't exist before running mojo.", file),

Check warning on line 336 in flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

String contains no format specifiers.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZsSlXoa3XHNufa5Dl5e&open=AZsSlXoa3XHNufa5Dl5e&pullRequest=22982
TEST_PROJECT_RESOURCE_JS.equals(file.getName())));
mojo.execute();

Expand All @@ -364,10 +358,11 @@

String generated = "'%s' should have been generated into 'build/frontend'";

Assert.assertTrue(String.format(generated, IMPORTS_NAME),
generatedFiles.contains(IMPORTS_NAME));
Assert.assertTrue(String.format(generated, IMPORTS_D_TS_NAME),
generatedFiles.contains(IMPORTS_D_TS_NAME));
Assert.assertTrue(String.format(generated, FrontendUtils.IMPORTS_NAME),
generatedFiles.contains(FrontendUtils.IMPORTS_NAME));
Assert.assertTrue(
String.format(generated, FrontendUtils.IMPORTS_D_TS_NAME),
generatedFiles.contains(FrontendUtils.IMPORTS_D_TS_NAME));

Assert.assertFalse("No 'target' directory should exist after build.",
target.exists());
Expand Down Expand Up @@ -494,10 +489,10 @@
throws IOException, IllegalAccessException, MojoExecutionException,
MojoFailureException {

File projectBase = temporaryFolder.getRoot();

Check warning on line 492 in flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "projectBase" which hides the field declared at line 98.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZsSlXoa3XHNufa5Dl5f&open=AZsSlXoa3XHNufa5Dl5f&pullRequest=22982
File webpackOutputDirectory = new File(projectBase,

Check warning on line 493 in flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "webpackOutputDirectory" which hides the field declared at line 103.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZsSlXoa3XHNufa5Dl5g&open=AZsSlXoa3XHNufa5Dl5g&pullRequest=22982
VAADIN_WEBAPP_RESOURCES);
File resourceOutputDirectory = new File(projectBase,

Check warning on line 495 in flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/BuildFrontendMojoTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename "resourceOutputDirectory" which hides the field declared at line 104.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZsSlXoa3XHNufa5Dl5h&open=AZsSlXoa3XHNufa5Dl5h&pullRequest=22982
VAADIN_SERVLET_RESOURCES);

ReflectionUtils.setVariableValueInObject(mojo, "webpackOutputDirectory",
Expand Down Expand Up @@ -767,7 +762,7 @@

private String addFrontendPrefix(String s) {
if (s.startsWith("./")) {
return FRONTEND_FOLDER_ALIAS + s.substring(2);
return FrontendUtils.FRONTEND_FOLDER_ALIAS + s.substring(2);
}
return s;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import tools.jackson.databind.JsonNode;
import tools.jackson.databind.node.ObjectNode;

import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.internal.JacksonUtils;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.frontend.FrontendTools;
Expand All @@ -45,7 +46,6 @@
import static com.vaadin.flow.server.Constants.PACKAGE_JSON;
import static com.vaadin.flow.server.Constants.VAADIN_SERVLET_RESOURCES;
import static com.vaadin.flow.server.Constants.VAADIN_WEBAPP_RESOURCES;
import static com.vaadin.flow.server.frontend.FrontendUtils.NODE_MODULES;

public class CleanFrontendMojoTest {
@Rule
Expand Down Expand Up @@ -115,7 +115,8 @@ public void mavenGoal_when_packageJsonMissing() throws Exception {
@Test
public void should_removeNodeModulesFolder()
throws MojoFailureException, MojoExecutionException {
final File nodeModules = new File(projectBase, NODE_MODULES);
final File nodeModules = new File(projectBase,
FrontendUtils.NODE_MODULES);
Assert.assertTrue("Failed to create 'node_modules'",
nodeModules.mkdirs());
mojo.execute();
Expand All @@ -127,7 +128,8 @@ public void should_removeNodeModulesFolder()
public void should_notRemoveNodeModulesFolder_hilla()
throws MojoFailureException, IOException, MojoExecutionException {
enableHilla();
final File nodeModules = new File(projectBase, NODE_MODULES);
final File nodeModules = new File(projectBase,
FrontendUtils.NODE_MODULES);
Assert.assertTrue("Failed to create 'node_modules'",
nodeModules.mkdirs());
mojo.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.mockito.Mockito;

import com.vaadin.flow.di.Lookup;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.plugin.TestUtils;
import com.vaadin.flow.server.frontend.EndpointGeneratorTaskFactory;
import com.vaadin.flow.server.frontend.FrontendTools;
Expand All @@ -40,7 +41,6 @@
import static com.vaadin.flow.plugin.maven.BuildFrontendMojoTest.setProject;
import static com.vaadin.flow.server.Constants.PACKAGE_JSON;
import static com.vaadin.flow.server.Constants.VAADIN_SERVLET_RESOURCES;
import static com.vaadin.flow.server.frontend.FrontendUtils.DEFAULT_FRONTEND_DIR;

public class GenerateNpmBOMMojoTest {

Expand All @@ -63,7 +63,8 @@ public void setUp() throws Exception {
this.mojo = Mockito.spy(new GenerateNpmBOMMojo());

File projectBase = temporaryFolder.getRoot();
File frontendDirectory = new File(projectBase, DEFAULT_FRONTEND_DIR);
File frontendDirectory = new File(projectBase,
FrontendUtils.DEFAULT_FRONTEND_DIR);
resourceOutputDirectory = new File(projectBase,
VAADIN_SERVLET_RESOURCES);
jarResourcesSource = new File(projectBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.mockito.Mockito;
import tools.jackson.databind.node.ObjectNode;

import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.internal.JacksonUtils;
import com.vaadin.flow.plugin.TestUtils;
import com.vaadin.flow.server.Constants;
Expand All @@ -50,14 +51,13 @@
import static com.vaadin.flow.server.Constants.VAADIN_WEBAPP_RESOURCES;
import static com.vaadin.flow.server.InitParameters.FRONTEND_HOTDEPLOY;
import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_PRODUCTION_MODE;
import static com.vaadin.flow.server.frontend.FrontendUtils.TOKEN_FILE;

public class PrepareFrontendMojoTest {
@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();

@Rule
public ExpectedException exception = ExpectedException.none();

Check warning on line 60 in flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/PrepareFrontendMojoTest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of "none"; it is deprecated.

See more on https://sonarcloud.io/project/issues?id=vaadin_flow&issues=AZsSlXnm3XHNufa5Dl5b&open=AZsSlXnm3XHNufa5Dl5b&pullRequest=22982

private final PrepareFrontendMojo mojo = new PrepareFrontendMojo();
private String packageJson;
Expand All @@ -75,7 +75,7 @@
projectBase = temporaryFolder.getRoot();

tokenFile = new File(temporaryFolder.getRoot(),
VAADIN_SERVLET_RESOURCES + TOKEN_FILE);
VAADIN_SERVLET_RESOURCES + FrontendUtils.TOKEN_FILE);

packageJson = new File(projectBase, PACKAGE_JSON).getAbsolutePath();
webpackOutputDirectory = new File(projectBase, VAADIN_WEBAPP_RESOURCES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@

import com.vaadin.flow.di.Lookup;
import com.vaadin.flow.internal.FileIOUtils;
import com.vaadin.flow.internal.FrontendUtils;
import com.vaadin.flow.internal.JacksonUtils;
import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.InitParameters;
import com.vaadin.flow.server.frontend.ExecutionFailedException;
import com.vaadin.flow.server.frontend.FrontendTools;
import com.vaadin.flow.server.frontend.FrontendToolsSettings;
import com.vaadin.flow.server.frontend.FrontendUtils;
import com.vaadin.flow.server.frontend.NodeTasks;
import com.vaadin.flow.server.frontend.Options;
import com.vaadin.flow.server.frontend.ProdBundleUtils;
Expand Down Expand Up @@ -85,8 +85,6 @@
import static com.vaadin.flow.server.InitParameters.REACT_ENABLE;
import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_INITIAL_UIDL;
import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_PRODUCTION_MODE;
import static com.vaadin.flow.server.frontend.FrontendUtils.GENERATED;
import static com.vaadin.flow.server.frontend.FrontendUtils.TOKEN_FILE;

/**
* Util class provides all methods a Plugin will need.
Expand Down Expand Up @@ -124,7 +122,8 @@ public static ClassFinder getClassFinder(List<String> classpathElements) {
*/
public static File getTokenFile(PluginAdapterBase adapter) {

return new File(adapter.servletResourceOutputDirectory(), TOKEN_FILE);
return new File(adapter.servletResourceOutputDirectory(),
FrontendUtils.TOKEN_FILE);
}

/**
Expand Down Expand Up @@ -228,7 +227,7 @@ public static File propagateBuildInfo(PluginAdapterBase adapter) {
// For forked processes not accessing to System.properties we leave a
// token file with the information about the build
File token = new File(adapter.servletResourceOutputDirectory(),
TOKEN_FILE);
FrontendUtils.TOKEN_FILE);
ObjectNode buildInfo = JacksonUtils.createObjectNode();
buildInfo.put(SERVLET_PARAMETER_PRODUCTION_MODE, false);
buildInfo.put(SERVLET_PARAMETER_INITIAL_UIDL,
Expand Down Expand Up @@ -482,7 +481,7 @@ public static File getGeneratedFrontendDirectory(
.startsWith(adapter.frontendDirectory().toPath())) {
// Possibly move frontend folder.
File frontendDirectory = getFrontendDirectory(adapter);
return new File(frontendDirectory, GENERATED);
return new File(frontendDirectory, FrontendUtils.GENERATED);
}
// Return given generated folder
return adapter.generatedTsFolder();
Expand Down
Loading
Loading