Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit 972d488

Browse files
committed
Remove ant support
Now that scala/scala#6255 is merged
1 parent b44ccb0 commit 972d488

File tree

6 files changed

+2
-275
lines changed

6 files changed

+2
-275
lines changed

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ Test categories (subdirectories under `test/files`)
1919
As partest links directly against the compiler being tested, it's cross-versioned against
2020
the compiler version that it's intended for.
2121

22-
There are three ways of invoking partest:
23-
24-
- ant (see https://github.com/scala/scala/blob/2.11.x/test/build-partest.xml and https://github.com/scala/scala-partest/blob/master/src/main/scala/scala/tools/partest/PartestTask.scala)
25-
- sbt (details below)
26-
- the [test/partest script](https://github.com/scala/scala/blob/2.11.x/test/partest), which uses ant to set up the classpath in the same way as the ant task, but then launches [ConsoleRunner](https://github.com/scala/scala-partest/blob/master/src/main/scala/scala/tools/partest/nest/ConsoleRunner.scala) directly.
22+
Partest is invoked from sbt.
2723

2824
The compiler to be tested must be on the classpath.
2925
The corresponding jar or class directory is detected by [FileManager::findArtifact](https://github.com/scala/scala-partest/blob/master/src/main/scala/scala/tools/partest/nest/FileManager.scala#L123).

build.sbt

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ enableOptimizer
2121

2222
// dependencies
2323
// versions involved in integration builds / that change frequently should be keys, set above!
24-
libraryDependencies += "org.apache.ant" % "ant" % "1.8.4" % "provided"
2524
libraryDependencies += "com.googlecode.java-diff-utils" % "diffutils" % "1.3.0"
2625
libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0"
2726
// mark all scala dependencies as provided which means one has to explicitly provide them when depending on partest

src/main/resources/scala/tools/partest/antlib.xml

-4
This file was deleted.

src/main/scala/scala/tools/partest/PartestTask.scala

-160
This file was deleted.

src/main/scala/scala/tools/partest/nest/AntRunner.scala

-64
This file was deleted.

src/main/scala/scala/tools/partest/nest/Runner.scala

+1-41
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
8989

9090
lazy val outDir = { outFile.mkdirs() ; outFile }
9191

92-
// oh boy...
93-
private lazy val antLauncher = SFile(Path(envOrNone("ANT_HOME") getOrElse "/opt/ant/") / "lib/ant-launcher.jar")
94-
9592
type RanOneTest = (Boolean, LogContext)
9693

9794
def showCrashInfo(t: Throwable) {
@@ -594,42 +591,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
594591
compilationRounds(testFile).forall(x => nextTestActionExpectTrue("compilation failed", x.isOk)) && andAlso
595592
}
596593

597-
// Apache Ant 1.6 or newer
598-
def ant(args: Seq[String], output: File): Boolean = {
599-
val antOptions =
600-
if (nestUI.verbose) List("-verbose", "-noinput")
601-
else List("-noinput")
602-
val cmd = javaCmdPath +: (
603-
suiteRunner.javaOpts.split(' ').map(_.trim).filter(_ != "") ++ Seq(
604-
"-classpath",
605-
antLauncher.path,
606-
"org.apache.tools.ant.launch.Launcher"
607-
) ++ antOptions ++ args
608-
)
609-
610-
runCommand(cmd, output)
611-
}
612-
613-
def runAntTest(): (Boolean, LogContext) = {
614-
val (swr, wr) = newTestWriters()
615-
616-
val succeeded = try {
617-
val binary = "-Dbinary="+ fileManager.distKind
618-
val args = Array(binary, "-logfile", logFile.getPath, "-file", testFile.getPath)
619-
nestUI.verbose("ant "+args.mkString(" "))
620-
621-
pushTranscript(s"ant ${args.mkString(" ")}")
622-
nextTestActionExpectTrue("ant failed", ant(args, logFile)) && diffIsOk
623-
}
624-
catch { // *catch-all*
625-
case e: Exception =>
626-
nestUI.warning("caught "+e)
627-
false
628-
}
629-
630-
(succeeded, LogContext(logFile, swr, wr))
631-
}
632-
633594
def extraClasspath = kind match {
634595
case "specialized" => List(PathSettings.srcSpecLib.fold(sys.error, identity))
635596
case _ => Nil
@@ -714,7 +675,6 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
714675
if (kind == "neg" || (kind endsWith "-neg")) runNegTest()
715676
else kind match {
716677
case "pos" => runTestCommon(true)
717-
case "ant" => runAntTest()
718678
case "res" => runResidentTest()
719679
case "scalap" => runScalapTest()
720680
case "script" => runScriptTest()
@@ -792,7 +752,7 @@ object Properties extends scala.util.PropertiesTrait {
792752
protected def pickJarBasedOn = classOf[SuiteRunner]
793753
}
794754

795-
/** Extended by Ant- and ConsoleRunner for running a set of tests. */
755+
/** Used by SBT- and ConsoleRunner for running a set of tests. */
796756
class SuiteRunner(
797757
val testSourcePath: String, // relative path, like "files", or "pending"
798758
val fileManager: FileManager,

0 commit comments

Comments
 (0)