Skip to content

Commit bf753c7

Browse files
committed
remove debug-assist method; cleanup solitary jar test
1 parent eda3104 commit bf753c7

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

compiler/src/dotty/tools/MainGenericRunner.scala

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ object MainGenericRunner {
106106
process(tail, settings.withExecuteMode(ExecuteMode.Run).withTargetToRun(fqName))
107107
case ("-cp" | "-classpath" | "--class-path") :: cp :: tail =>
108108
val cpEntries = cp.split(classpathSeparator).toList
109-
val singleEntryClasspath: Boolean = cpEntries.nonEmpty && cpEntries.drop(1).isEmpty
109+
val singleEntryClasspath: Boolean = cpEntries.take(2).size == 1
110110
val globdir: String = if singleEntryClasspath then cp.replaceAll("[\\\\/][^\\\\/]*$", "") else "" // slash/backslash agnostic
111111
def validGlobbedJar(s: String): Boolean = s.startsWith(globdir) && ((s.toLowerCase.endsWith(".jar") || s.toLowerCase.endsWith(".zip")))
112112
val (tailargs, newEntries) = if singleEntryClasspath && validGlobbedJar(cpEntries.head) then
@@ -243,22 +243,4 @@ object MainGenericRunner {
243243
e.foreach(_.printStackTrace())
244244
!isFailure
245245
}
246-
247-
def display(settings: Settings)= Seq(
248-
s"verbose: ${settings.verbose}",
249-
s"classPath: ${settings.classPath.mkString("\n ","\n ","")}",
250-
s"executeMode: ${settings.executeMode}",
251-
s"exitCode: ${settings.exitCode}",
252-
s"javaArgs: ${settings.javaArgs}",
253-
s"scalaArgs: ${settings.scalaArgs}",
254-
s"residualArgs: ${settings.residualArgs}",
255-
s"possibleEntryPaths: ${settings.possibleEntryPaths}",
256-
s"scriptArgs: ${settings.scriptArgs}",
257-
s"targetScript: ${settings.targetScript}",
258-
s"targetToRun: ${settings.targetToRun}",
259-
s"save: ${settings.save}",
260-
s"modeShouldBePossibleRun: ${settings.modeShouldBePossibleRun}",
261-
s"modeShouldBeRun: ${settings.modeShouldBeRun}",
262-
s"compiler: ${settings.compiler}",
263-
)
264246
}

compiler/test/dotty/tools/scripting/ClasspathTests.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ class ClasspathTests:
5050
val hashbangClasspathJars = scriptCp.split(psep).map { _.getName }.sorted.distinct
5151
val packlibJars = listJars(s"$scriptCwd/$packLibDir").sorted.distinct
5252

53+
printf("%d jar files in dist/target/pack/lib\n", packlibJars.size)
54+
printf("%d test script jars in classpath\n", hashbangClasspathJars.size)
55+
5356
// verify that the classpath set in the hashbang line is effective
5457
if hashbangClasspathJars.size != packlibJars.size then
55-
printf("%d test script jars in classpath\n", hashbangClasspathJars.size)
56-
printf("%d jar files in dist/target/pack/lib\n", packlibJars.size)
58+
printf("hashbangClasspathJars: %s\n", hashbangClasspathJars.mkString("\n ", "\n ", ""))
5759

5860
assert(hashbangClasspathJars.size == packlibJars.size)
5961
}

0 commit comments

Comments
 (0)