1- @ ECHO OFF
2-
3- SETLOCAL EnableDelayedExpansion
4-
5- SET METAFACTURE_HOME = %~dp0
6-
7- REM Use the java command available on the path by default.
8- REM Define FLUX_JAVA_BIN in your environment to use a
9- REM different executable.
10- IF " x%FLUX_JAVA_BIN% " == " x" (
11- SET FLUX_JAVA_BIN = java
12- )
13-
14- SET JAVA_OPTS_FILE = " %METAFACTURE_HOME% / config/ java-options.conf"
15- SET JAR_FILE = " %METAFACTURE_HOME% ${project.build.finalName}.jar"
16-
17- REM Read JVM options from configuration file. Lines starting
18- REM with # are treated as comments. Empty lines are ignored.
19- REM
20- REM The space character at the end of the following
21- REM line is important and must not be removed:
22- SET JAVA_OPTS =
23- < %JAVA_OPTS_FILE% (
24- FOR /F %%I IN ('FINDSTR /N " ^" %JAVA_OPTS_FILE% ') DO (
25- SET /P LINE =
26- IF NOT " x!LINE! " == " x" (
27- SET FIRST = !LINE:~0 ,1 !
28- IF NOT " !FIRST! " == " #" (
29- SET JAVA_OPTS = !JAVA_OPTS! !LINE!
30- )
31- )
32- SET LINE =
33- )
34- )
35-
36- REM Substitute environment variables in the configuration.
37- REM Undefined variables remain in the configuration. Since
38- REM FLUX_JAVA_OPTIONS is included in the configuration by
39- REM default we make sure that it can always be substituted.
40- IF " x%FLUX_JAVA_OPTIONS% " == " x" (
41- REM The space character at the end of the following
42- REM line is important and must not be removed:
43- SET FLUX_JAVA_OPTIONS =
44- )
45- FOR /F " tokens=1,* delims==" %%I IN ('SET') DO (
46- SET JAVA_OPTS = !JAVA_OPTS:$ %%I =%%J !
47- )
48-
49- REM Start flux:
50- %FLUX_JAVA_BIN% !JAVA_OPTS! -jar %JAR_FILE% %*
51-
1+ @ ECHO OFF
2+
3+ SETLOCAL EnableDelayedExpansion
4+
5+ SET METAFACTURE_HOME = %~dp0
6+
7+ REM Use the java command available on the path by default.
8+ REM Define FLUX_JAVA_BIN in your environment to use a
9+ REM different executable.
10+ IF " x%FLUX_JAVA_BIN% " == " x" (
11+ SET FLUX_JAVA_BIN = java
12+ )
13+
14+ SET JAVA_OPTS_FILE = " %METAFACTURE_HOME% \ config\ java-options.conf"
15+ SET JAR_FILE = " %METAFACTURE_HOME% ${project.build.finalName}.jar"
16+
17+ REM Read JVM options from configuration file. Lines starting
18+ REM with # are treated as comments. Empty lines are ignored.
19+ REM
20+ REM The space character at the end of the following
21+ REM line is important and must not be removed:
22+ SET JAVA_OPTS =
23+ < %JAVA_OPTS_FILE% (
24+ FOR /F %%I IN ('FINDSTR /N " ^" %JAVA_OPTS_FILE% ') DO (
25+ SET /P LINE =
26+ IF NOT " x!LINE! " == " x" (
27+ SET FIRST = !LINE:~0 ,1 !
28+ IF NOT " !FIRST! " == " #" (
29+ SET JAVA_OPTS = !JAVA_OPTS! !LINE!
30+ )
31+ )
32+ SET LINE =
33+ )
34+ )
35+
36+ REM Substitute environment variables in the configuration.
37+ REM Undefined variables remain in the configuration. Since
38+ REM FLUX_JAVA_OPTIONS is included in the configuration by
39+ REM default we make sure that it can always be substituted.
40+ IF " x%FLUX_JAVA_OPTIONS% " == " x" (
41+ REM The space character at the end of the following
42+ REM line is important and must not be removed:
43+ SET FLUX_JAVA_OPTIONS =
44+ )
45+ FOR /F " tokens=1,* delims==" %%I IN ('SET') DO (
46+ SET JAVA_OPTS = !JAVA_OPTS:$ %%I =%%J !
47+ )
48+
49+ REM Start flux:
50+ %FLUX_JAVA_BIN% !JAVA_OPTS! -jar %JAR_FILE% %*
51+
5252ENDLOCAL
0 commit comments