diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-02-18 15:01:49 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-02-18 15:01:49 -0800 |
commit | 7a872f4ed261947070a2937982efa9f35684a8dd (patch) | |
tree | bf217dbf3c8992bdaab6d3d1cc8a0db576882e61 /src/compiler | |
parent | e8cf90221190a8642bd3f27b9f1f2b7b0c22eee6 (diff) | |
parent | 32c422a5188c6c2c4ff8d75d018e9bb0508c0776 (diff) | |
download | scala-7a872f4ed261947070a2937982efa9f35684a8dd.tar.gz scala-7a872f4ed261947070a2937982efa9f35684a8dd.tar.bz2 scala-7a872f4ed261947070a2937982efa9f35684a8dd.zip |
Merge pull request #4335 from lylek/issue/4959
SI-4959 - UNIX bin scripts now work for paths with spaces
Diffstat (limited to 'src/compiler')
-rwxr-xr-x | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index 7acb3632d2..9862ea7987 100755 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -109,9 +109,6 @@ if [[ -n "$cygwin" ]]; then JAVA_HOME="$(cygpath --$format "$JAVA_HOME")" fi TOOL_CLASSPATH="$(cygpath --path --$format "$TOOL_CLASSPATH")" -elif [[ -n "$mingw" ]]; then - SCALA_HOME="$(cmd //c echo "$SCALA_HOME")" - TOOL_CLASSPATH="$(cmd //c echo "$TOOL_CLASSPATH")" fi if [[ -n "$cygwin$mingw" ]]; then @@ -131,23 +128,6 @@ fi declare -a java_args declare -a scala_args -# default to the boot classpath for speed, except on cygwin/mingw because -# JLine on Windows requires a custom DLL to be loaded. -unset usebootcp -if [[ -z "$cygwin$mingw" ]]; then - usebootcp="true" -fi - -# If using the boot classpath, also pass an empty classpath -# to java to suppress "." from materializing. -classpathArgs () { - if [[ -n $usebootcp ]]; then - echo "-Xbootclasspath/a:$TOOL_CLASSPATH -classpath \"\"" - else - echo "-classpath $TOOL_CLASSPATH" - fi -} - # SI-8358, SI-8368 -- the default should really be false, # but I don't want to flip the default during 2.11's RC cycle OVERRIDE_USEJAVACP="-Dscala.usejavacp=true" @@ -200,6 +180,23 @@ if [[ -z "$JAVACMD" && -n "$JAVA_HOME" && -x "$JAVA_HOME/bin/java" ]]; then JAVACMD="$JAVA_HOME/bin/java" fi +declare -a classpath_args + +# default to the boot classpath for speed, except on cygwin/mingw because +# JLine on Windows requires a custom DLL to be loaded. +unset usebootcp +if [[ -z "$cygwin$mingw" ]]; then + usebootcp="true" +fi + +# If using the boot classpath, also pass an empty classpath +# to java to suppress "." from materializing. +if [[ -n $usebootcp ]]; then + classpath_args=("-Xbootclasspath/a:$TOOL_CLASSPATH" -classpath "\"\"") +else + classpath_args=(-classpath "$TOOL_CLASSPATH") +fi + # note that variables which may intentionally be empty must not # be quoted: otherwise an empty string will appear as a command line # argument, and java will think that is the program to run. @@ -207,7 +204,7 @@ execCommand \ "${JAVACMD:=java}" \ $JAVA_OPTS \ "${java_args[@@]}" \ - $(classpathArgs) \ + "${classpath_args[@@]}" \ -Dscala.home="$SCALA_HOME" \ $OVERRIDE_USEJAVACP \ "$EMACS_OPT" \ |