@@ -101,16 +101,14 @@ object MainGenericCompiler {
101
101
process(tail, settings.withScalaArgs(" -verbose" ))
102
102
case (" -q" | " -quiet" ) :: tail =>
103
103
process(tail, settings.withQuiet)
104
- case " -Oshort" :: tail =>
105
- process(tail, settings.withJavaArgs(" -XX:+TieredCompilation" , " -XX:TieredStopAtLevel=1" ))
106
104
case " -repl" :: tail =>
107
105
process(tail, settings.withCompileMode(CompileMode .Repl ))
108
106
case " -script" :: targetScript :: tail =>
109
107
process(Nil , settings
110
108
.withCompileMode(CompileMode .Script )
111
109
.withJavaProps(" script.path" -> targetScript)
112
110
.withTargetScript(targetScript)
113
- .withScriptArgs(tail.toList * ))
111
+ .withScriptArgs(tail* ))
114
112
case " -compile" :: tail =>
115
113
process(tail, settings.withCompileMode(CompileMode .Compile ))
116
114
case " -decompile" :: tail =>
@@ -126,23 +124,18 @@ object MainGenericCompiler {
126
124
case " -with-compiler" :: tail =>
127
125
process(tail, settings.withCompiler)
128
126
case (" -cp" | " -classpath" | " --class-path" ) :: cp :: tail =>
129
- val cpEntries = cp.split(classpathSeparator).toList
130
- val singleEntryClasspath : Boolean = cpEntries.sizeIs == 1
131
- val globdir : String = if singleEntryClasspath then cp.replaceAll(" [\\\\ /][^\\\\ /]*$" , " " ) else " " // slash/backslash agnostic
132
- def validGlobbedJar (s : String ): Boolean = s.startsWith(globdir) && ((s.toLowerCase.endsWith(" .jar" ) || s.toLowerCase.endsWith(" .zip" )))
133
- val (tailargs, newEntries) = if singleEntryClasspath && validGlobbedJar(cpEntries.head) then
134
- // reassemble globbed wildcard classpath
135
- // globdir is wildcard directory for globbed jar files, reconstruct the intended classpath
136
- val cpJars = tail.takeWhile( f => validGlobbedJar(f) )
137
- val remainingArgs = tail.drop(cpJars.size)
138
- (remainingArgs, cpEntries ++ cpJars)
139
- else
140
- (tail, cpEntries)
141
-
127
+ val (tailargs, newEntries) = MainGenericRunner .processClasspath(cp, tail)
142
128
process(tailargs, settings.copy(classPath = settings.classPath ++ newEntries.filter(_.nonEmpty)))
143
- case (o @ javaOption(stripped)) :: tail =>
129
+ case " -Oshort" :: tail =>
130
+ // Nothing is to be done here. Request that the user adds the relevant flags manually.
131
+ // i.e this has no effect when MainGenericRunner is invoked programatically.
132
+ val addTC = " -XX:+TieredCompilation"
133
+ val tStopAtLvl = " -XX:TieredStopAtLevel=1"
134
+ println(s " ignoring deprecated -Oshort flag, please add `-J $addTC` and `-J $tStopAtLvl` flags manually " )
135
+ process(tail, settings)
136
+ case javaOption(stripped) :: tail =>
144
137
process(tail, settings.withJavaArgs(stripped))
145
- case ( javaPropOption(opt, value) ) :: tail =>
138
+ case javaPropOption(opt, value) :: tail =>
146
139
process(tail, settings.withJavaProps(opt -> value))
147
140
case arg :: tail =>
148
141
process(tail, settings.withResidualArgs(arg))
0 commit comments