@@ -101,16 +101,14 @@ object MainGenericCompiler {
101101 process(tail, settings.withScalaArgs(" -verbose" ))
102102 case (" -q" | " -quiet" ) :: tail =>
103103 process(tail, settings.withQuiet)
104- case " -Oshort" :: tail =>
105- process(tail, settings.withJavaArgs(" -XX:+TieredCompilation" , " -XX:TieredStopAtLevel=1" ))
106104 case " -repl" :: tail =>
107105 process(tail, settings.withCompileMode(CompileMode .Repl ))
108106 case " -script" :: targetScript :: tail =>
109107 process(Nil , settings
110108 .withCompileMode(CompileMode .Script )
111109 .withJavaProps(" script.path" -> targetScript)
112110 .withTargetScript(targetScript)
113- .withScriptArgs(tail.toList * ))
111+ .withScriptArgs(tail* ))
114112 case " -compile" :: tail =>
115113 process(tail, settings.withCompileMode(CompileMode .Compile ))
116114 case " -decompile" :: tail =>
@@ -126,23 +124,18 @@ object MainGenericCompiler {
126124 case " -with-compiler" :: tail =>
127125 process(tail, settings.withCompiler)
128126 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)
142128 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 =>
144137 process(tail, settings.withJavaArgs(stripped))
145- case ( javaPropOption(opt, value) ) :: tail =>
138+ case javaPropOption(opt, value) :: tail =>
146139 process(tail, settings.withJavaProps(opt -> value))
147140 case arg :: tail =>
148141 process(tail, settings.withResidualArgs(arg))
0 commit comments