Skip to content

Commit 74c2e23

Browse files
committed
Merge pull request #709 from alexander-myltsev/703-fix_dotc_cygwin
Fix Cygwin launch
2 parents b823132 + 3daa5ce commit 74c2e23

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

bin/dotc

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fi
9191

9292
if [ "$JLINE_JAR" == "" ]
9393
then
94-
JLINE_JAR=$HOME/.ivy2//cache/jline/jline/jars/jline-$JLINE_VERSION.jar
94+
JLINE_JAR=$HOME/.ivy2/cache/jline/jline/jars/jline-$JLINE_VERSION.jar
9595
fi
9696

9797
if [ ! -f "$SCALA_LIBRARY_JAR" -o ! -f "$SCALA_REFLECT_JAR" -o ! -f "$SCALA_COMPILER_JAR" -o ! -f "$JLINE_JAR" ]
@@ -188,11 +188,30 @@ trap onExit INT
188188
# If using the boot classpath, also pass an empty classpath
189189
# to java to suppress "." from materializing.
190190
classpathArgs () {
191-
if [[ -n $bootcp ]]; then
192-
echo "-Xbootclasspath/a:$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR:$MAIN_JAR -classpath $MAIN_JAR:$TEST_JAR"
191+
toolchain="$SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR"
192+
if [[ -n "$cygwin" ]]; then
193+
if [[ "$OS" = "Windows_NT" ]] && cygpath -m .>/dev/null 2>/dev/null ; then
194+
format=mixed
195+
else
196+
format=windows
197+
fi
198+
199+
if [[ -n $bootcp ]]; then
200+
boot_classpath="$(cygpath --path --$format "$toolchain:$MAIN_JAR")"
201+
classpath="$(cygpath --path --$format "$MAIN_JAR:$TEST_JAR")"
202+
cpArgs="-Xbootclasspath/a:$boot_classpath -classpath $classpath"
203+
else
204+
classpath="$(cygpath --path --$format "$toolchain:$MAIN_JAR:$TEST_JAR")"
205+
cpArgs="-classpath $classpath"
206+
fi
193207
else
194-
echo "-classpath $SCALA_LIBRARY_JAR:$SCALA_REFLECT_JAR:$SCALA_COMPILER_JAR:$JLINE_JAR:$MAIN_JAR:$TEST_JAR"
208+
if [[ -n $bootcp ]]; then
209+
cpArgs="-Xbootclasspath/a:$toolchain:$MAIN_JAR -classpath $MAIN_JAR:$TEST_JAR"
210+
else
211+
cpArgs="-classpath $toolchain:$MAIN_JAR:$TEST_JAR"
212+
fi
195213
fi
214+
echo ${cpArgs}
196215
}
197216

198217
# e.g. path -java-home /path/to/java_home

0 commit comments

Comments
 (0)