mirror of https://github.com/sbt/sbt.git
Fixes tests/scala-instance-classloader
This commit is contained in:
parent
c72ca77c29
commit
2f8d7c2f7a
|
|
@ -43,7 +43,7 @@ The Scala Center is working with Lightbend to provide [an automatic migration to
|
||||||
#### Zinc API changes
|
#### Zinc API changes
|
||||||
|
|
||||||
- Java classes under the `xsbti.compile` package such as `IncOptions` hides the constructor. Use the factory method `xsbti.compile.Foo.of(...)`.
|
- Java classes under the `xsbti.compile` package such as `IncOptions` hides the constructor. Use the factory method `xsbti.compile.Foo.of(...)`.
|
||||||
- Renames `ivyScala: IvyScala` to `scalaModuleInfo: ScalaModuleInfo`.
|
- Renames `ivyScala: IvyScala` key to `scalaModuleInfo: ScalaModuleInfo`.
|
||||||
- `xsbti.Reporter#log(...)` takes `xsbti.Problem` as the parameter. Call `log(problem.position, problem.message, problem.severity)` to delegate to the older `log(...)`.
|
- `xsbti.Reporter#log(...)` takes `xsbti.Problem` as the parameter. Call `log(problem.position, problem.message, problem.severity)` to delegate to the older `log(...)`.
|
||||||
- `xsbi.Maybe`, `xsbti.F0`, and `sxbti.F1` are changed to corresponding Java 8 classes `java.util.Optional`, `java.util.Supplier` and `java.util.Function`.
|
- `xsbi.Maybe`, `xsbti.F0`, and `sxbti.F1` are changed to corresponding Java 8 classes `java.util.Optional`, `java.util.Supplier` and `java.util.Function`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,31 +2,32 @@ import sbt.internal.inc.ScalaInstance
|
||||||
|
|
||||||
lazy val OtherScala = config("other-scala").hide
|
lazy val OtherScala = config("other-scala").hide
|
||||||
|
|
||||||
configs(OtherScala)
|
lazy val root = (project in file("."))
|
||||||
|
.configs(OtherScala)
|
||||||
|
.settings(
|
||||||
|
scalaVersion := "2.11.11",
|
||||||
|
libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.11.11" % OtherScala.name,
|
||||||
|
managedClasspath in OtherScala := Classpaths.managedJars(OtherScala, classpathTypes.value, update.value),
|
||||||
|
|
||||||
libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.11.8" % OtherScala.name
|
// Hack in the scala instance
|
||||||
|
scalaInstance := {
|
||||||
|
val rawJars = (managedClasspath in OtherScala).value.map(_.data)
|
||||||
|
val scalaHome = (target.value / "scala-home")
|
||||||
|
def removeVersion(name: String): String =
|
||||||
|
name.replaceAll("\\-2.11.11", "")
|
||||||
|
for(jar <- rawJars) {
|
||||||
|
val tjar = scalaHome / s"lib/${removeVersion(jar.getName)}"
|
||||||
|
IO.copyFile(jar, tjar)
|
||||||
|
}
|
||||||
|
IO.listFiles(scalaHome).foreach(f => System.err.println(s" * $f}"))
|
||||||
|
ScalaInstance(scalaHome, appConfiguration.value.provider.scalaProvider.launcher)
|
||||||
|
},
|
||||||
|
|
||||||
managedClasspath in OtherScala := Classpaths.managedJars(OtherScala, classpathTypes.value, update.value)
|
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
|
||||||
|
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.3" % Test,
|
||||||
|
|
||||||
// Hack in the scala instance
|
scalaModuleInfo := {
|
||||||
scalaInstance := {
|
val old = scalaModuleInfo.value
|
||||||
val rawJars = (managedClasspath in OtherScala).value.map(_.data)
|
old map { _.withOverrideScalaVersion(sbtPlugin.value) }
|
||||||
val scalaHome = (target.value / "scala-home")
|
}
|
||||||
def removeVersion(name: String): String =
|
)
|
||||||
name.replaceAll("\\-2.11.8", "")
|
|
||||||
for(jar <- rawJars) {
|
|
||||||
val tjar = scalaHome / s"lib/${removeVersion(jar.getName)}"
|
|
||||||
IO.copyFile(jar, tjar)
|
|
||||||
}
|
|
||||||
IO.listFiles(scalaHome).foreach(f => System.err.println(s" * $f}"))
|
|
||||||
ScalaInstance(scalaHome, appConfiguration.value.provider.scalaProvider.launcher)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
|
|
||||||
|
|
||||||
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.3" % "test"
|
|
||||||
|
|
||||||
scalaVersion := "2.11.8"
|
|
||||||
|
|
||||||
ivyScala := ivyScala.value map (_.withOverrideScalaVersion(sbtPlugin.value))
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue