Skip to content

Commit

Permalink
Merge pull request #88 from hugo-vrijswijk/base-dir-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Feb 6, 2024
2 parents 506e9dd + 7f30c1e commit 1c4d9c8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/sbt/internal/ProjectMatrix.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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: _*)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/sbtprojectmatrix/ProjectMatrixPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/sbt-test/projectMatrix/jvm-sandwich/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions src/sbt-test/projectMatrix/jvm/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/sbt-test/projectMatrix/projectAxes/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1c4d9c8

Please sign in to comment.