Skip to content

Commit c442eaa

Browse files
committed
t
1 parent 9ec75f2 commit c442eaa

File tree

3 files changed

+5
-28
lines changed

3 files changed

+5
-28
lines changed

dist/bin/common.ps1

+2-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
### POWERSHELL COMMON SCRIPT ###
33
### ###
44
### Author: Hamza REMMAL <[email protected]> ###
5-
### Since : Scala 3.5.0 ###
5+
### Since : Scala 3.6.0 ###
66
###################################################################################################
77

88

@@ -31,24 +31,6 @@ function Scala-FetchScalaVersion {
3131
}
3232
}
3333

34-
function Scala-LoadClasspathFromFile {
35-
param ( [string] $file )
36-
$_CLASS_PATH_RESULT = ""
37-
if (Test-Path $file) {
38-
foreach ($line in Get-Content $file) {
39-
$lib = "$_PROG_HOME/maven2/$line"
40-
if (!$_CLASS_PATH_RESULT) {
41-
$_CLASS_PATH_RESULT = $lib
42-
} else {
43-
$_CLASS_PATH_RESULT += "$_PSEP$lib"
44-
}
45-
}
46-
}
47-
48-
return $_CLASS_PATH_RESULT
49-
}
50-
51-
5234
###################################################################################################
5335
############################################ LOAD JAVA ############################################
5436
###################################################################################################
@@ -70,7 +52,7 @@ if (-not $_PROG_HOME) {
7052
######################################## VARIOUS VARIABLES ########################################
7153
###################################################################################################
7254

73-
$_ETC_DIR = Join-Path $_PROG_HOME "etc"
55+
$_LIB_DIR = Join-Path $_PROG_HOME "lib"
7456
$_BIN_DIR = Join-Path $_PROG_HOME "bin"
7557
$_MVN_REPOSITORY = "file:///$($_PROG_HOME -replace '\\', '/')/maven2"
7658
$_VERSION_FILE = Join-Path $_PROG_HOME "VERSION"

dist/bin/scalac.ps1

+1-5
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,10 @@ function Scala-ArgumentParsing {
6363
function Scala-LoadCompilerClasspath {
6464
param ( [string] $SCALA_CLASSPATH )
6565

66-
$__TOOLCHAIN_1 = Scala-LoadClasspathFromFile "$_ETC_DIR/scala.classpath"
67-
$__TOOLCHAIN_2 = Scala-LoadClasspathFromFile "$_ETC_DIR/with_compiler.classpath"
68-
$__TOOLCHAIN = "$__TOOLCHAIN_1$_PSEP$__TOOLCHAIN_2"
69-
66+
$__TOOLCHAIN = "$_LIB_DIR/scala.jar$_PSEP$_LIB_DIR/with_compiler.jar"
7067
if ($SCALA_CLASSPATH) {
7168
$__TOOLCHAIN += "$_PSEP$SCALA_CLASSPATH"
7269
}
73-
7470
return $__TOOLCHAIN
7571
}
7672

dist/bin/scaladoc.ps1

+2-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ function Scaladoc-ArgumentParsing {
9696
$scaladocParameters = Scaladoc-ArgumentParsing $args
9797

9898
# Main
99-
$_CLASS_PATH = Scala-LoadClasspathFromFile "$_ETC_DIR/scaladoc.classpath"
10099

101100
if ($JAVA_OPTS) {
102101
$_JAVA_OPTS = $JAVA_OPTS
@@ -116,7 +115,7 @@ if (-not [string]::IsNullOrEmpty($_JAVA_OPTS)) { $command += $_JAVA_OPTS }
116115
if (-not [string]::IsNullOrEmpty($_JAVA_DEBUG)) { $command += $_JAVA_DEBUG }
117116
if (-not [string]::IsNullOrEmpty($_JAVA_ARGS)) { $command += $_JAVA_ARGS }
118117
$command += "-classpath"
119-
$command += $_CLASS_PATH
118+
$command += "$_LIB_DIR/scaladoc.jar"
120119
$command += "-Dscala.usejavacp=true"
121120
$command += "-Dscala.home=$_PROG_HOME"
122121
$command += "dotty.tools.scaladoc.Main"
@@ -126,7 +125,7 @@ if (-not [string]::IsNullOrEmpty($_RESIDUAL_ARGS)) { $command += $_RESIDUAL_ARGS
126125
$commandString = $command -join ' '
127126

128127
Start-Process -FilePath $_JAVACMD -ArgumentList $commandString -NoNewWindow -Wait
129-
Write-Output $LASTEXITCODE
128+
130129
if ($LASTEXITCODE -ne 0) { exit 1 }
131130

132131
exit 0

0 commit comments

Comments
 (0)