@@ -85,7 +85,7 @@ public class FrontendUtils {
85
85
/**
86
86
* Default folder for the node related content. It's the base directory for
87
87
* {@link Constants#PACKAGE_JSON} and {@link FrontendUtils#NODE_MODULES}.
88
- *
88
+ * <p>
89
89
* By default it's the project root folder.
90
90
*/
91
91
public static final String DEFAULT_NODE_DIR = "./" ;
@@ -111,7 +111,7 @@ public class FrontendUtils {
111
111
/**
112
112
* Path of the folder containing application frontend source files, it needs
113
113
* to be relative to the {@link FrontendUtils#DEFAULT_NODE_DIR}
114
- *
114
+ * <p>
115
115
* By default it is <code>/src/main/frontend</code> in the project folder.
116
116
*/
117
117
public static final String DEFAULT_FRONTEND_DIR = DEFAULT_NODE_DIR
@@ -120,7 +120,7 @@ public class FrontendUtils {
120
120
/**
121
121
* Path of the old folder containing application frontend source files, it
122
122
* needs to be relative to the {@link FrontendUtils#DEFAULT_NODE_DIR}
123
- *
123
+ * <p>
124
124
* By default the old folder is <code>/frontend</code> in the project
125
125
* folder.
126
126
*/
@@ -260,7 +260,7 @@ public class FrontendUtils {
260
260
/**
261
261
* A parameter for overriding the {@link FrontendUtils#DEFAULT_FRONTEND_DIR}
262
262
* folder.
263
- *
263
+ * <p>
264
264
* NOTE: For internal use only.
265
265
*/
266
266
public static final String PARAM_FRONTEND_DIR = "vaadin.frontend.folder" ;
@@ -484,7 +484,6 @@ public static ProcessBuilder createProcessBuilder(List<String> command,
484
484
* found.
485
485
* @throws IOException
486
486
* on error when reading file
487
- *
488
487
*/
489
488
public static String getIndexHtmlContent (VaadinService service )
490
489
throws IOException {
@@ -507,7 +506,6 @@ public static String getIndexHtmlContent(VaadinService service)
507
506
* not found.
508
507
* @throws IOException
509
508
* on error when reading file
510
- *
511
509
*/
512
510
public static String getWebComponentHtmlContent (VaadinService service )
513
511
throws IOException {
@@ -646,28 +644,17 @@ public static File getFrontendFolder(File projectRoot, File frontendDir) {
646
644
File legacyDir = new File (projectRoot , LEGACY_FRONTEND_DIR );
647
645
648
646
if (legacyDir .exists ()) {
649
- boolean configParamPointsToLegacyDir = legacyDir .toPath ().toString ()
650
- .replace ("./" , "" ).equals (frontendDir .toPath ().toString ());
651
- if (configParamPointsToLegacyDir ) {
652
- if (new File (projectRoot , DEFAULT_FRONTEND_DIR ).exists ()) {
653
- getLogger ().warn (
654
- "This project has both default ({}) frontend directory"
655
- + " and legacy ({})- frontend directory present, and "
656
- + "'frontendDirectory' parameter points to the legacy directory."
657
- + "\n \n Default frontend directory will be ignored." ,
658
- DEFAULT_FRONTEND_DIR , LEGACY_FRONTEND_DIR );
659
- }
660
- return frontendDir ;
661
- } else {
662
- throw new RuntimeException (
663
- "This project has a legacy fronted directory ("
664
- + LEGACY_FRONTEND_DIR
665
- + ") frontend directory present, but no 'frontendDirectory' "
666
- + "configuration parameter set. "
667
- + "Please set the parameter or move the legacy directory contents "
668
- + "to the default frontend folder ("
669
- + DEFAULT_FRONTEND_DIR + ")." );
670
- }
647
+ getLogger ().warn (
648
+ "This project has a legacy frontend directory ({}) "
649
+ + "present and it will be used as a fallback."
650
+ + "\n \n Support for the legacy directory will be removed "
651
+ + "in a future release. Please move its contents to "
652
+ + "the default frontend directory ({}), or delete it "
653
+ + "if its contents are not needed in the project. "
654
+ + "Also remove 'frontendDirectory' parameter that "
655
+ + "points to the legacy directory, if present." ,
656
+ LEGACY_FRONTEND_DIR , DEFAULT_FRONTEND_DIR );
657
+ return legacyDir ;
671
658
}
672
659
673
660
// Legacy dir does not exist. Use default or custom-set dir.
@@ -754,7 +741,6 @@ private static String buildTooOldString(String tool, String version,
754
741
*
755
742
* @param configuration
756
743
* the current deployment configuration
757
- *
758
744
* @return {@link #DEFAULT_FRONTEND_DIR} or value of
759
745
* {@link #PARAM_FRONTEND_DIR} if it is set.
760
746
*/
@@ -955,14 +941,14 @@ public static String executeCommand(List<String> command,
955
941
956
942
/**
957
943
* Reads input and error stream from the give process asynchronously.
958
- *
944
+ * <p>
959
945
* The method returns a {@link CompletableFuture} that is completed when
960
946
* both the streams are consumed.
961
- *
947
+ * <p>
962
948
* Streams are converted into strings and wrapped into a {@link Pair},
963
949
* mapping input stream into {@link Pair#getFirst()} and error stream into
964
950
* {@link Pair#getSecond()}.
965
- *
951
+ * <p>
966
952
* This method should be mainly used to avoid that {@link Process#waitFor()}
967
953
* hangs indefinitely on some operating systems because process streams are
968
954
* not consumed. See https://github.com/vaadin/flow/issues/15339 for an
0 commit comments