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

Commit 1c26320

Browse files
committed
Mixed Java/Scala compilation like sbt's "Mixed" compileOrder
Partest used to follow an old recommendation for mixed compilation: first all files are passed to scalac, then the Java files to javac (with the Scala classfiles on the classpath), and finally the Scala files again to the Scala compiler (with the existing classfiles on the classpath). SBT and the other build tools stop after the second round, so it makes sense for our partest to do the same by default. Separate compilation (Java then Scala) can still be tested using filename groups (`_N`).
1 parent 143562f commit 1c26320

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ scalaModuleSettings
44

55
name := "scala-partest"
66

7-
version := "1.0.13-SNAPSHOT"
7+
version := "1.0.19-SNAPSHOT"
88

99
scalaVersion := crossScalaVersions.value.head
1010

1111
crossScalaVersions := {
1212
val java = System.getProperty("java.version")
1313
if (java.startsWith("1.6."))
14-
Seq("2.11.7", "2.12.0-M1")
14+
Seq("2.11.8")
1515
else if (java.startsWith("1.8."))
16-
Seq("2.12.0-M4")
16+
Seq("2.12.1")
1717
else
1818
sys.error(s"don't know what Scala versions to build on $java")
1919
}
2020

2121
scalaXmlVersion := {
22-
if(scalaVersion.value.startsWith("2.11.") || scalaVersion.value == "2.12.0-M2") "1.0.4" else "1.0.5"
22+
if (scalaVersion.value.startsWith("2.11.")) "1.0.4" else "1.0.6"
2323
}
2424

2525
scalaCheckVersion := "1.11.6"

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,10 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
502502
)
503503
def mixedCompileGroup(allFiles: List[File]): List[CompileRound] = {
504504
val (scalaFiles, javaFiles) = allFiles partition (_.isScala)
505-
val isMixed = javaFiles.nonEmpty && scalaFiles.nonEmpty
506505
val round1 = if (scalaFiles.isEmpty) None else Some(ScalaAndJava(allFiles))
507506
val round2 = if (javaFiles.isEmpty) None else Some(OnlyJava(javaFiles))
508-
val round3 = if (!isMixed) None else Some(OnlyScala(scalaFiles))
509507

510-
List(round1, round2, round3).flatten
508+
List(round1, round2).flatten
511509
}
512510

513511
def runNegTest() = runInContext {

0 commit comments

Comments
 (0)