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

Build for Scala 2.11.7, 2.12.0-M1, 2.12.0-M2 and 2.12.0-M3 #43

Merged
merged 2 commits into from
Dec 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ scalaModuleSettings

name := "scala-partest"

version := "1.0.11-SNAPSHOT"
version := "1.0.12-SNAPSHOT"

scalaVersion := crossScalaVersions.value.head

crossScalaVersions := {
val java = System.getProperty("java.version")
if (java.startsWith("1.6."))
Seq("2.11.6", "2.12.0-M1")
Seq("2.11.7", "2.12.0-M1")
else if (java.startsWith("1.8."))
Seq("2.12.0-M2")
Seq("2.12.0-M2", "2.12.0-M3")
else
sys.error(s"don't know what Scala versions to build on $java")
}

scalaXmlVersion := "1.0.4"
scalaXmlVersion := {
if(scalaVersion.value == "2.12.0-M3") "1.0.5" else "1.0.4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this break as soon as we do M4? how about if(scalaVersion.value == "2.12.0-M2") "1.0.4" else "1.0.5"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we do M4 (and it's not binary compatible), we need to update scala-partest anyway (and scala-xml may well be an even newer version then), so I don't think it really makes a difference which way you write that check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the way it is at the moment is easier. We need 1.0.5 for 2.12.0-M3 and 1.0.4 for 2.12.0-M2, 2.12.0-M1 and 2.11.

}

scalaCheckVersion := "1.11.6"

Expand Down
10 changes: 6 additions & 4 deletions src/main/scala/scala/tools/partest/nest/FileManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class FileManager(val testClassLoader: URLClassLoader) {
lazy val libraryUnderTest: Path = findArtifact("library")
lazy val reflectUnderTest: Path = findArtifact("reflect")
lazy val compilerUnderTest: Path = findArtifact("compiler")
lazy val agentLib: Path = findArtifact("javaagent")

lazy val testClassPath = testClassLoader.getURLs().map(url => Path(new File(url.toURI))).toList

Expand All @@ -126,13 +127,14 @@ class FileManager(val testClassLoader: URLClassLoader) {
else "installed"
}

// find library/reflect/compiler jar or subdir under build/$stage/classes/
// find library/reflect/compiler/javaagent jar or subdir under build/$stage/classes/
private def findArtifact(name: String): Path = {
val canaryClass =
name match {
case "library" => Class.forName("scala.Unit", false, testClassLoader)
case "reflect" => Class.forName("scala.reflect.api.Symbols", false, testClassLoader)
case "compiler" => Class.forName("scala.tools.nsc.Main", false, testClassLoader)
case "library" => Class.forName("scala.Unit", false, testClassLoader)
case "reflect" => Class.forName("scala.reflect.api.Symbols", false, testClassLoader)
case "compiler" => Class.forName("scala.tools.nsc.Main", false, testClassLoader)
case "javaagent" => Class.forName("scala.tools.partest.javaagent.ProfilingAgent", false, testClassLoader)
}

val path = Path(canaryClass.getProtectionDomain.getCodeSource.getLocation.getPath)
Expand Down
7 changes: 0 additions & 7 deletions src/main/scala/scala/tools/partest/nest/PathSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ object PathSettings {
// Directory <root>/test/files or .../scaladoc
def srcDir = Directory(testRoot / testSourcePath toCanonical)

// Directory <root>/build/pack/lib
private def buildPackLibDir = Directory(buildDir / "pack" / "lib")

// Directory <root>/test/files/lib
private def srcLibDir = Directory(srcDir / "lib")

Expand All @@ -60,8 +57,4 @@ object PathSettings {

def srcSpecLib = findJar("instrumented", Directory(srcDir / "speclib"))
def srcCodeLib = findJar("code", Directory(srcDir / "codelib"), Directory(testRoot / "files" / "codelib") /* work with --srcpath pending */)
def agentLib = findJar("scala-partest-javaagent", buildPackLibDir)
def scalaCheck = findJar("scalacheck", buildPackLibDir, srcLibDir)
def testInterface = findJar("test-interface", buildPackLibDir, srcLibDir)
def diffUtils = findJar("diffutils", buildPackLibDir)
}
2 changes: 1 addition & 1 deletion src/main/scala/scala/tools/partest/nest/Runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
case _ => Nil
}
def extraJavaOptions = kind match {
case "instrumented" => ("-javaagent:"+PathSettings.agentLib.fold(sys.error, identity)).split(' ')
case "instrumented" => ("-javaagent:"+agentLib).split(' ')
case _ => Array.empty[String]
}

Expand Down