mirror of
https://github.com/sbt/sbt.git
synced 2026-09-08 11:13:23 +02:00
Add test for command crossing using !
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
lazy val compile2 = taskKey[Unit]("")
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.aggregate(foo, bar, client)
|
||||
.settings(
|
||||
crossScalaVersions := Nil,
|
||||
addCommandAlias("build", "compile2"),
|
||||
)
|
||||
|
||||
lazy val foo = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.11", "2.13.1"),
|
||||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0",
|
||||
compile2 := {
|
||||
// This tests that +build will ignore bar's crossScalaVersions and use root's like sbt 0.13
|
||||
val x = (LocalProject("bar") / scalaVersion).value
|
||||
assert(x == scalaVersion.value, s"$x == ${scalaVersion.value}")
|
||||
(Compile / compile).value
|
||||
},
|
||||
)
|
||||
|
||||
lazy val bar = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.11"),
|
||||
compile2 := (Compile / compile).value,
|
||||
)
|
||||
|
||||
lazy val client = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.11", "2.13.1"),
|
||||
compile2 := (Compile / compile).value,
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
> + clean
|
||||
|
||||
## test input task
|
||||
> + foo / testOnly foo.FooSpec
|
||||
> + testOnly foo.FooSpec
|
||||
|
||||
## test + with command or alias
|
||||
> clean
|
||||
## for command cross building you do need crossScalaVerions on root
|
||||
> set root/crossScalaVersions := Seq("2.12.11", "2.13.1")
|
||||
> + build
|
||||
$ exists foo/target/scala-2.12
|
||||
$ exists foo/target/scala-2.13
|
||||
$ exists bar/target/scala-2.12
|
||||
$ exists bar/target/scala-2.13
|
||||
$ exists client/target/scala-2.12
|
||||
$ exists client/target/scala-2.13
|
||||
@@ -1,16 +0,0 @@
|
||||
lazy val root = (project in file("."))
|
||||
.aggregate(foo, client)
|
||||
.settings(
|
||||
crossScalaVersions := Nil
|
||||
)
|
||||
|
||||
lazy val foo = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.11", "2.13.1"),
|
||||
libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0",
|
||||
)
|
||||
|
||||
lazy val client = project
|
||||
.settings(
|
||||
crossScalaVersions := Seq("2.12.11", "2.13.1"),
|
||||
)
|
||||
@@ -1,5 +0,0 @@
|
||||
> + clean
|
||||
|
||||
> + foo / testOnly foo.FooSpec
|
||||
|
||||
> + testOnly foo.FooSpec
|
||||
Reference in New Issue
Block a user