mirror of https://github.com/sbt/sbt.git
Use project axes when not auto scala lib (#86)
* add test that should fail for module not found * Use axisValues when !autoScalaLibrary --------- Co-authored-by: Miguel Villa <miguel.villa@siriusxm.com>
This commit is contained in:
parent
7181625be7
commit
506e9ddd86
|
|
@ -499,7 +499,7 @@ object ProjectMatrix {
|
|||
acc.customRow(autoScalaLibrary, axisValues ++ Seq(VirtualAxis.scalaABIVersion(sv)), process)
|
||||
}
|
||||
} else {
|
||||
customRow(autoScalaLibrary, Seq(VirtualAxis.jvm), process)
|
||||
customRow(autoScalaLibrary, axisValues ++ Seq(VirtualAxis.jvm), process)
|
||||
}
|
||||
|
||||
override def customRow(
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
import sbt.internal.ProjectMatrix
|
||||
ThisBuild / organization := "com.example"
|
||||
ThisBuild / version := "0.1.0-SNAPSHOT"
|
||||
ThisBuild / publishMavenStyle := true
|
||||
|
||||
ThisBuild / ivyPaths := {
|
||||
val base = (ThisBuild / baseDirectory).value
|
||||
IvyPaths(base, Some(base / "ivy-cache"))
|
||||
}
|
||||
publish / skip := true
|
||||
|
||||
lazy val scala212 = "2.12.10"
|
||||
|
||||
lazy val check = taskKey[Unit]("")
|
||||
|
||||
lazy val config12 = ConfigAxis("Config1_2", "-config1.2")
|
||||
lazy val config13 = ConfigAxis("Config1_3", "-config1.3")
|
||||
|
||||
check := {
|
||||
val app12 = app.finder(config12).apply(autoScalaLibrary = false)
|
||||
assert(app12.id == "appConfig1_2", s"app12.id is ${app12.id}")
|
||||
val app13 = app.finder(config13).apply(autoScalaLibrary = false)
|
||||
assert(app13.id == "appConfig1_3", s"app13.id is ${app13.id}")
|
||||
}
|
||||
|
||||
lazy val app: ProjectMatrix = (projectMatrix in file("app"))
|
||||
.settings(
|
||||
name := "app",
|
||||
ivyPaths := (ThisBuild / ivyPaths).value
|
||||
)
|
||||
.customRow(
|
||||
autoScalaLibrary = false,
|
||||
scalaVersions = Seq(scala212),
|
||||
axisValues = Seq(config12, VirtualAxis.jvm),
|
||||
_.settings(
|
||||
libraryDependencies += "com.typesafe" % "config" % "1.2.1"
|
||||
)
|
||||
)
|
||||
.customRow(
|
||||
autoScalaLibrary = false,
|
||||
scalaVersions = Seq(scala212),
|
||||
axisValues = Seq(config13, VirtualAxis.jvm),
|
||||
_.settings(
|
||||
libraryDependencies += "com.typesafe" % "config" % "1.3.3"
|
||||
)
|
||||
)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import sbt._
|
||||
|
||||
case class ConfigAxis(idSuffix: String, directorySuffix: String) extends VirtualAxis.WeakAxis
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> check
|
||||
Loading…
Reference in New Issue