@@ -16,7 +16,7 @@ import scala.io.Codec
16
16
import scala .reflect .internal .FatalError
17
17
import scala .reflect .internal .util .ScalaClassLoader
18
18
import scala .sys .process .{ Process , ProcessLogger }
19
- import scala .tools .nsc .Properties .{ envOrElse , isWin , jdkHome , javaHome , propOrElse , propOrEmpty , setProp , versionMsg , javaVmName , javaVmVersion , javaVmInfo }
19
+ import scala .tools .nsc .Properties .{ envOrNone , isWin , jdkHome , javaHome , propOrEmpty , setProp , versionMsg , javaVmName , javaVmVersion , javaVmInfo }
20
20
import scala .tools .nsc .{ Settings , CompilerCommand , Global }
21
21
import scala .tools .nsc .io .{ AbstractFile }
22
22
import scala .tools .nsc .reporters .ConsoleReporter
@@ -75,6 +75,9 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
75
75
76
76
lazy val outDir = { outFile.mkdirs() ; outFile }
77
77
78
+ // oh boy...
79
+ private lazy val antLauncher = SFile (Path (envOrNone(" ANT_HOME" ) getOrElse " /opt/ant/" ) / " lib/ant-launcher.jar" )
80
+
78
81
type RanOneTest = (Boolean , LogContext )
79
82
80
83
def showCrashInfo (t : Throwable ) {
@@ -293,7 +296,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
293
296
def gitDiff (f1 : File , f2 : File ): Option [String ] = {
294
297
try gitRunner map { git =>
295
298
val cmd = s " $git diff $gitDiffOptions $f1 $f2"
296
- val diff = Process (cmd).lines_ !.drop(4 ).map(_ + " \n " ).mkString
299
+ val diff = Process (cmd).lineStream_ !.drop(4 ).map(_ + " \n " ).mkString
297
300
298
301
" \n " + diff
299
302
}
@@ -510,16 +513,13 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
510
513
511
514
// Apache Ant 1.6 or newer
512
515
def ant (args : Seq [String ], output : File ): Boolean = {
513
- val antDir = Directory (envOrElse(" ANT_HOME" , " /opt/ant/" ))
514
- val antLibDir = Directory (antDir / " lib" )
515
- val antLauncherPath = SFile (antLibDir / " ant-launcher.jar" ).path
516
516
val antOptions =
517
517
if (NestUI ._verbose) List (" -verbose" , " -noinput" )
518
518
else List (" -noinput" )
519
519
val cmd = javaCmdPath +: (
520
520
PartestDefaults .javaOpts.split(' ' ).map(_.trim).filter(_ != " " ) ++ Seq (
521
521
" -classpath" ,
522
- antLauncherPath ,
522
+ antLauncher.path ,
523
523
" org.apache.tools.ant.launch.Launcher"
524
524
) ++ antOptions ++ args
525
525
)
0 commit comments