Skip to content

Commit 33eed71

Browse files
committed
fix loading classpath in batch script
1 parent 5b0044c commit 33eed71

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

dist/bin/common.bat

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,3 @@ if not defined _PROG_HOME (
4141
set "_ETC_DIR=%_PROG_HOME%\etc"
4242

4343
set _PSEP=;
44-
45-
@rem input parameter: %1=command for classpath file
46-
@rem output parameter: _CLASS_PATH
47-
:loadClasspathFromFile
48-
set "__COMMAND=%~1"
49-
set _CLASS_PATH=
50-
for /f "delims=" %%f in ("%_ETC_DIR%\%__COMMAND%.classpath") do (
51-
set "relpath=%%f"
52-
set "relpath=!relpath:/=\!"
53-
54-
set "_CLASS_PATH=!_CLASS_PATH!%_PROG_HOME%\maven2\%relpath%%_PSEP%"
55-
)
56-
goto :eof

dist/bin/scalac.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ goto :eof
8989
@rem output parameter: _JVM_CP_ARGS
9090
:compilerJavaClasspathArgs
9191

92-
call :loadClasspathFromFile "scala"
92+
call :loadClasspathFromFile
9393

9494
set "__TOOLCHAIN=%_CLASS_PATH%"
9595

@@ -100,6 +100,22 @@ if defined _SCALA_CPATH (
100100
)
101101
goto :eof
102102

103+
@REM concatentate every line in "%_ETC_DIR%\scala.classpath" with _PSEP
104+
:loadClasspathFromFile
105+
set _CLASS_PATH=
106+
if exist "%_ETC_DIR%\scala.classpath" (
107+
for /f "usebackq delims=" %%i in ("%_ETC_DIR%\scala.classpath") do (
108+
set "_LIB=%_PROG_HOME%\maven2\%%i"
109+
set "_LIB=!_LIB:/=\!"
110+
if not defined _CLASS_PATH (
111+
set "_CLASS_PATH=!_LIB!"
112+
) else (
113+
set "_CLASS_PATH=!_CLASS_PATH!%_PSEP%!_LIB!"
114+
)
115+
)
116+
)
117+
goto :eof
118+
103119
@rem #########################################################################
104120
@rem ## Cleanups
105121

dist/bin/scaladoc.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,23 @@ goto :eof
107107
:classpathArgs
108108
set "_ETC_DIR=%_PROG_HOME%\etc"
109109
@rem keep list in sync with bash script `bin\scaladoc` !
110-
call :loadClasspathFromFile "scaladoc"
110+
call :loadClasspathFromFile
111+
goto :eof
112+
113+
@REM concatentate every line in "%_ETC_DIR%\scaladoc.classpath" with _PSEP
114+
:loadClasspathFromFile
115+
set _CLASS_PATH=
116+
if exist "%_ETC_DIR%\scaladoc.classpath" (
117+
for /f "usebackq delims=" %%i in ("%_ETC_DIR%\scaladoc.classpath") do (
118+
set "_LIB=%_PROG_HOME%\maven2\%%i"
119+
set "_LIB=!_LIB:/=\!"
120+
if not defined _CLASS_PATH (
121+
set "_CLASS_PATH=!_LIB!"
122+
) else (
123+
set "_CLASS_PATH=!_CLASS_PATH!%_PSEP%!_LIB!"
124+
)
125+
)
126+
)
111127
goto :eof
112128

113129
@rem #########################################################################

0 commit comments

Comments
 (0)