mirror of https://github.com/sbt/sbt.git
Add test for command crossing using !
This commit is contained in:
parent
6035bc02ef
commit
7a39841ecc
|
|
@ -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
|
|
||||||
Loading…
Reference in New Issue