File tree 8 files changed +44
-25
lines changed
8 files changed +44
-25
lines changed Original file line number Diff line number Diff line change @@ -233,17 +233,14 @@ jobs:
233
233
run : sbt "dist-win-x64/pack" & bash -version
234
234
shell : cmd
235
235
236
- # skip while Windows runner is on Java 8, and we use jar launcher for Scala CLI
237
236
- name : cygwin tests
238
237
run : ' "C:\Program Files\cygwin64\bin\bash" ./project/scripts/winCmdTests'
239
238
shell : cmd
240
239
241
- # skip while Windows runner is on Java 8, and we use jar launcher for Scala CLI
242
240
- name : msys tests
243
241
run : ' "C:\Program Files\Git\bin\bash" ./project/scripts/winCmdTests'
244
242
shell : cmd
245
243
246
- # skip while Windows runner is on Java 8, and we use jar launcher for Scala CLI
247
244
- name : win tests
248
245
run : ' ./project/scripts/winCmdTests.bat'
249
246
shell : cmd
Original file line number Diff line number Diff line change @@ -9,15 +9,43 @@ target="$1"
9
9
10
10
shift # Mutates $@ by deleting the first element ($1)
11
11
12
+ unset cygwin mingw msys darwin
13
+
14
+ # COLUMNS is used together with command line option '-pageWidth'.
15
+ if command -v tput > /dev/null 2>&1 ; then
16
+ export COLUMNS=" $( tput -Tdumb cols) "
17
+ fi
18
+
19
+ case " ` uname` " in
20
+ CYGWIN* ) cygwin=true
21
+ ;;
22
+ MINGW* ) mingw=true
23
+ ;;
24
+ MSYS* ) msys=true
25
+ ;;
26
+ Darwin* ) darwin=true
27
+ ;;
28
+ esac
29
+
30
+ unset DIST_PROJECT DIST_DIR
31
+
32
+ if [[ ${cygwin-} || ${mingw-} || ${msys-} ]]; then
33
+ DIST_PROJECT=" dist-win-x64"
34
+ DIST_DIR=" dist/win-x64"
35
+ else
36
+ DIST_PROJECT=" dist"
37
+ DIST_DIR=" dist"
38
+ fi
39
+
12
40
# Marker file used to obtain the date of latest call to sbt-back
13
- version=" $ROOT /dist /target/pack/VERSION"
41
+ version=" $ROOT /$DIST_DIR /target/pack/VERSION"
14
42
15
43
# Create the target if absent or if file changed in ROOT/compiler
16
44
new_files=" $( find " $ROOT /compiler" \( -iname " *.scala" -o -iname " *.java" \) -newer " $version " 2> /dev/null) "
17
45
18
46
if [ ! -f " $version " ] || [ ! -z " $new_files " ]; then
19
47
echo " Building Dotty..."
20
- (cd $ROOT && sbt " dist /pack" )
48
+ (cd $ROOT && sbt " $DIST_PROJECT /pack" )
21
49
fi
22
50
23
- " $target " " $@ "
51
+ " $ROOT / $DIST_DIR /target/pack/bin/ $ target" " $@ "
Original file line number Diff line number Diff line change @@ -35,4 +35,4 @@ scala_args() {
35
35
echo " --power ${CLI_ARGS[@]} ${SCRIPT_ARGS[@]} "
36
36
}
37
37
38
- " $ROOT /bin/common" " $ROOT /dist/target/pack/bin/ scala" $( scala_args " $@ " )
38
+ " $ROOT /bin/common" " scala" $( scala_args " $@ " )
Original file line number Diff line number Diff line change 2
2
3
3
ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " >& /dev/null && pwd) /.."
4
4
5
- " $ROOT /bin/common" " $ROOT /dist/target/pack/bin/ scalac" " $@ "
5
+ " $ROOT /bin/common" " scalac" " $@ "
Original file line number Diff line number Diff line change 2
2
3
3
ROOT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " >& /dev/null && pwd) /.."
4
4
5
- " $ROOT /bin/common" " $ROOT /dist/target/pack/bin/ scaladoc" " $@ "
5
+ " $ROOT /bin/common" " scaladoc" " $@ "
Original file line number Diff line number Diff line change @@ -71,16 +71,16 @@ if [[ ${cygwin-} || ${mingw-} || ${msys-} ]]; then
71
71
esac
72
72
fi
73
73
74
- source " $PROG_HOME /bin/cli-common-platform"
75
-
76
74
CLASSPATH_SUFFIX=" "
77
75
# Path separator used in EXTRA_CLASSPATH
78
76
PSEP=" :"
77
+ PROG_HOME_URI=" file://$PROG_HOME "
79
78
80
79
# translate paths to Windows-mixed format before running java
81
80
if [ -n " ${CYGPATHCMD-} " ]; then
82
81
[ -n " ${PROG_HOME-} " ] &&
83
82
PROG_HOME=` " $CYGPATHCMD " -am " $PROG_HOME " `
83
+ PROG_HOME_URI=" file:///$PROG_HOME " # Add extra root dir prefix
84
84
[ -n " $JAVA_HOME " ] &&
85
85
JAVA_HOME=` " $CYGPATHCMD " -am " $JAVA_HOME " `
86
86
CLASSPATH_SUFFIX=" ;"
@@ -89,12 +89,15 @@ elif [[ ${mingw-} || ${msys-} ]]; then
89
89
# For Mingw / Msys, convert paths from UNIX format before anything is touched
90
90
[ -n " $PROG_HOME " ] &&
91
91
PROG_HOME=" ` (cd " $PROG_HOME " ; pwd -W | sed ' s|/|\\\\|g' )` "
92
+ PROG_HOME_URI=" file:///$PROG_HOME " # Add extra root dir prefix
92
93
[ -n " $JAVA_HOME " ] &&
93
94
JAVA_HOME=" ` (cd " $JAVA_HOME " ; pwd -W | sed ' s|/|\\\\|g' )` "
94
95
CLASSPATH_SUFFIX=" ;"
95
96
PSEP=" ;"
96
97
fi
97
98
99
+ source " $PROG_HOME /bin/cli-common-platform"
100
+
98
101
# /*--------------------------------------------------
99
102
# * The code below is for Dotty
100
103
# *-------------------------------------------------*/
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ if [ -z "$SCALA_VERSION" ]; then
44
44
exit 1
45
45
fi
46
46
47
- MVN_REPOSITORY=" file:// $PROG_HOME /maven2"
47
+ MVN_REPOSITORY=" $PROG_HOME_URI /maven2"
48
48
49
49
# escape all script arguments
50
50
while [[ $# -gt 0 ]]; do
@@ -61,6 +61,7 @@ eval "${SCALA_CLI_CMD_BASH[@]}" \
61
61
" --cli-default-scala-version \" $SCALA_VERSION \" " \
62
62
" -r \" $MVN_REPOSITORY \" " \
63
63
" ${scala_args[@]} "
64
+
64
65
scala_exit_status=$?
65
66
66
67
onExit
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ if not %_EXITCODE%==0 goto end
19
19
20
20
call :setScalaOpts
21
21
22
+ call " %_PROG_HOME% \bin\cli-common-platform.bat"
23
+
22
24
@ rem SCALA_CLI_CMD_WIN is an array, set in cli-common-platform.bat
23
25
call %SCALA_CLI_CMD_WIN% " --prog-name" " scala" " --cli-default-scala-version" " %_SCALA_VERSION% " " -r" " %MVN_REPOSITORY% " %*
24
26
@@ -41,20 +43,8 @@ if not "%char%"==":" (
41
43
goto :findColon
42
44
)
43
45
44
- @ REM set _PROG_HOME to the substring from the first colon to the end
45
- set " _PROG_HOME_SUB = !_PROG_HOME:~%index%! "
46
- @ REM strip initial character
47
- set " _PROG_HOME_SUB = !_PROG_HOME_SUB:~1 ! "
48
-
49
- @ REM set drive to substring from 0 to the first colon
50
- set " _PROG_HOME_DRIVE = !_PROG_HOME:~0 ,%index%! "
51
-
52
-
53
-
54
46
set " _SCALA_VERSION = "
55
- set " MVN_REPOSITORY = file://%_PROG_HOME_DRIVE% \%_PROG_HOME_SUB:\ =/ % /maven2"
56
-
57
- call " %_PROG_HOME% \bin\cli-common-platform.bat"
47
+ set " MVN_REPOSITORY = file:///%_PROG_HOME:\ =/ % /maven2"
58
48
59
49
@ rem read for version:=_SCALA_VERSION in VERSION_FILE
60
50
FOR /F " usebackq delims=" %%G IN (" %_PROG_HOME% \VERSION" ) DO (
You can’t perform that action at this time.
0 commit comments