mirror of https://github.com/sbt/sbt.git
Merge pull request #34 from sbt/wip/scala-3-test
Add test for Scala 3.0.0-M1
This commit is contained in:
commit
839ff7d0f2
|
|
@ -0,0 +1,5 @@
|
||||||
|
package example
|
||||||
|
|
||||||
|
object D {
|
||||||
|
val x = C.x
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package example
|
||||||
|
|
||||||
|
object C {
|
||||||
|
val x = 1
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package example
|
||||||
|
|
||||||
|
object F {
|
||||||
|
val x = E.x
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package example
|
||||||
|
|
||||||
|
object E {
|
||||||
|
val x = 1
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
lazy val check = taskKey[Unit]("")
|
||||||
|
|
||||||
|
val dottyVersion = "3.0.0-M1"
|
||||||
|
ThisBuild / resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
|
||||||
|
// TODO use 2.13.4 when it's out
|
||||||
|
lazy val scala213 = "2.13.4-bin-aeee8f0"
|
||||||
|
|
||||||
|
lazy val fooApp = (projectMatrix in file("foo-app"))
|
||||||
|
.dependsOn(fooCore)
|
||||||
|
.settings(
|
||||||
|
name := "foo app",
|
||||||
|
)
|
||||||
|
.jvmPlatform(scalaVersions = Seq(dottyVersion))
|
||||||
|
|
||||||
|
lazy val fooCore = (projectMatrix in file("foo-core"))
|
||||||
|
.settings(
|
||||||
|
name := "foo core",
|
||||||
|
)
|
||||||
|
.jvmPlatform(scalaVersions = Seq(scala213, "2.12.12"))
|
||||||
|
|
||||||
|
lazy val barApp = (projectMatrix in file("bar-app"))
|
||||||
|
.dependsOn(barCore)
|
||||||
|
.settings(
|
||||||
|
name := "bar app",
|
||||||
|
)
|
||||||
|
.jvmPlatform(scalaVersions = Seq(scala213))
|
||||||
|
|
||||||
|
lazy val barCore = (projectMatrix in file("bar-core"))
|
||||||
|
.settings(
|
||||||
|
name := "bar core",
|
||||||
|
)
|
||||||
|
.jvmPlatform(scalaVersions = Seq(dottyVersion))
|
||||||
|
|
||||||
|
// choose 2.13 when bazCore offers both 2.13 and Dotty
|
||||||
|
lazy val bazApp = (projectMatrix in file("baz-app"))
|
||||||
|
.dependsOn(bazCore)
|
||||||
|
.settings(
|
||||||
|
name := "baz app",
|
||||||
|
check := {
|
||||||
|
val cp = (Compile / fullClasspath).value
|
||||||
|
.map(_.data.getName)
|
||||||
|
|
||||||
|
assert(cp.contains("baz-core_2.13-0.1.0-SNAPSHOT.jar"), s"$cp")
|
||||||
|
assert(!cp.contains("baz-core_3.0.0-M1-0.1.0-SNAPSHOT.jar"), s"$cp")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.jvmPlatform(scalaVersions = Seq(scala213))
|
||||||
|
|
||||||
|
lazy val bazCore = (projectMatrix in file("baz-core"))
|
||||||
|
.settings(
|
||||||
|
name := "baz core",
|
||||||
|
exportJars := true,
|
||||||
|
)
|
||||||
|
.jvmPlatform(scalaVersions = Seq(scala213, dottyVersion))
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package example
|
||||||
|
|
||||||
|
object B {
|
||||||
|
val x = A.x
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package example
|
||||||
|
|
||||||
|
object A {
|
||||||
|
val x = 1
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
sbt.version=1.4.2
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
sys.props.get("plugin.version") match {
|
||||||
|
case Some(x) => addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % x)
|
||||||
|
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|
||||||
|
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||||
|
}
|
||||||
|
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.5")
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
> fooApp3_0/compile
|
||||||
|
|
||||||
|
> barApp/compile
|
||||||
|
|
||||||
|
> bazApp/check
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
lazy val check = taskKey[Unit]("")
|
lazy val check = taskKey[Unit]("")
|
||||||
|
|
||||||
val dottyVersion = "0.23.0"
|
val dottyVersion = "3.0.0-M1"
|
||||||
ThisBuild / resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
|
ThisBuild / resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
|
||||||
// TODO use 2.13.4 when it's out
|
// TODO use 2.13.4 when it's out
|
||||||
lazy val scala213 = "2.13.4-bin-aeee8f0"
|
lazy val scala213 = "2.13.4-bin-aeee8f0"
|
||||||
|
|
@ -40,8 +40,9 @@ lazy val bazApp = (projectMatrix in file("baz-app"))
|
||||||
val cp = (Compile / fullClasspath).value
|
val cp = (Compile / fullClasspath).value
|
||||||
.map(_.data.getName)
|
.map(_.data.getName)
|
||||||
|
|
||||||
|
streams.value.log.info(cp.toString)
|
||||||
assert(cp.contains("baz-core_2.13-0.1.0-SNAPSHOT.jar"), s"$cp")
|
assert(cp.contains("baz-core_2.13-0.1.0-SNAPSHOT.jar"), s"$cp")
|
||||||
assert(!cp.contains("baz-core_0.23-0.1.0-SNAPSHOT.jar"), s"$cp")
|
assert(!cp.contains("baz-core_3.0.0-M1-0.1.0-SNAPSHOT.jar"), s"$cp")
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.jvmPlatform(scalaVersions = Seq(scala213))
|
.jvmPlatform(scalaVersions = Seq(scala213))
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=1.3.13
|
sbt.version=1.4.2
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@ sys.props.get("plugin.version") match {
|
||||||
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|
||||||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
|
||||||
}
|
}
|
||||||
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.1")
|
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.5")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
> fooApp0_23/compile
|
> fooApp3_0/compile
|
||||||
|
|
||||||
> barApp/compile
|
> barApp/compile
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue