Merge pull request #88 from hugo-vrijswijk/base-dir-setting

This commit is contained in:
eugene yokota 2024-02-06 09:28:22 -05:00 committed by GitHub
commit 1c4d9c89bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 1 deletions

View File

@ -270,7 +270,8 @@ object ProjectMatrix {
inConfig(Compile)(makeSources(nonScalaDirSuffix, svDirSuffix)),
inConfig(Test)(makeSources(nonScalaDirSuffix, svDirSuffix)),
projectDependencies := projectDependenciesTask.value,
ProjectMatrixKeys.virtualAxes := axes
ProjectMatrixKeys.virtualAxes := axes,
ProjectMatrixKeys.projectMatrixBaseDirectory := base,
)
.settings(self.settings)
.configure(transforms: _*)

View File

@ -7,6 +7,7 @@ import scala.language.experimental.macros
trait ProjectMatrixKeys {
val virtualAxes = settingKey[Seq[VirtualAxis]]("Virtual axes for the project")
val projectMatrixBaseDirectory = settingKey[File]("Base directory of the current project matrix")
}
object ProjectMatrixKeys extends ProjectMatrixKeys

View File

@ -41,6 +41,7 @@ lazy val bazApp = (projectMatrix in file("baz-app"))
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_3.0.0-M1-0.1.0-SNAPSHOT.jar"), s"$cp")
assert(projectMatrixBaseDirectory.value == file("baz-app"))
},
)
.jvmPlatform(scalaVersions = Seq(scala213))

View File

@ -19,6 +19,7 @@ lazy val core = (projectMatrix in file("core"))
.settings(
check := {
assert(moduleName.value == "core", s"moduleName is ${moduleName.value}")
assert(projectMatrixBaseDirectory.value == file("core"))
},
)
.jvmPlatform(scalaVersions = Seq(scala213, scala212))
@ -27,6 +28,7 @@ lazy val intf = (projectMatrix in file("intf"))
.settings(
check := {
assert(moduleName.value == "intf", s"moduleName is ${moduleName.value}")
assert(projectMatrixBaseDirectory.value == file("intf"))
},
)
.jvmPlatform(autoScalaLibrary = false)

View File

@ -15,6 +15,7 @@ lazy val core = (projectMatrix in file("core"))
.settings(
check := {
assert(platformTest.value.endsWith("-platform"))
assert(projectMatrixBaseDirectory.value == file("core"))
},
)
.jvmPlatform(scalaVersions = Seq(scala213, scala212))