Skip to content

Commit

Permalink
feat: cross-publish to sbt 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk committed Dec 18, 2024
1 parent 685222d commit dab5798
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ lazy val sbtPlugin = (projectMatrix in file("modules") / "sbt")
.defaultAxes(VirtualAxis.scalaPartialVersion("2.12"), VirtualAxis.jvm)
.settings(commonSettings, sbtPluginSettings, publishLocalDependsOn(core))
.dependsOn(core)
.jvmPlatform(scalaVersions = Seq(versions.scala212 /* , versions.scala3 */ ))
.jvmPlatform(scalaVersions = Seq(versions.scala212, versions.scala3))

lazy val sbtTestRunner = (projectMatrix in file("modules") / "sbtTestRunner")
.settings(commonSettings, sbtTestRunnerSettings, publishLocalDependsOn(testRunnerApi))
.dependsOn(testRunnerApi)
.jvmPlatform(scalaVersions = versions.fullCrossScalaVersions)
.jvmPlatform(scalaVersions = versions.ltsCrossScalaVersions)

lazy val testRunnerApi = (projectMatrix in file("modules") / "testRunnerApi")
.settings(commonSettings, testRunnerApiSettings)
.jvmPlatform(scalaVersions = versions.fullCrossScalaVersions)
.jvmPlatform(scalaVersions = versions.ltsCrossScalaVersions)

lazy val api = (projectMatrix in file("modules") / "api")
.settings(commonSettings, apiSettings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object Stryker4sPlugin extends AutoPlugin {
* E.g. `github.com/stryker-mutator/stryker4s`
*/
private def toDashboardProject(scmInfo: ScmInfo): Option[String] = {
val uri = Uri(scmInfo.browseUrl.toURI())
val uri = toSttpUri(scmInfo.browseUrl)
for {
base <- uri.host
if base.startsWith("github.com")
Expand Down Expand Up @@ -159,4 +159,7 @@ object Stryker4sPlugin extends AutoPlugin {
private class UnsupportedSbtVersionException(s: String)
extends IllegalArgumentException(s)
with FeedbackProvidedException

private[stryker4s] def toSttpUri(uri: URI): sttp.model.Uri = Uri(uri)
private[stryker4s] def toSttpUri(url: URL): sttp.model.Uri = Uri(url.toURI())
}
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Stryker4sSbtRunner(
}

def tmpDirFor(source: File, tmpDir: Path): JFile =
(Path.fromNioPath(source.toPath()) inSubDir tmpDir).toNioPath.toFile()
Path.fromNioPath(source.toPath()).inSubDir(tmpDir).toNioPath.toFile()

val (settings, extracted) = extractSbtProject(tmpDir)

Expand Down
6 changes: 5 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ object Dependencies {

val scala213 = "2.13.15"

val scala3 = "3.3.4"
// sbt-test-runner uses LTS to ensure compatibility with any project it runs in
val scala3Lts = "3.3.4"

val scala3 = "3.6.2"

val fullCrossScalaVersions = Seq(scala3, scala213, scala212)
val ltsCrossScalaVersions = Seq(scala3Lts, scala213, scala212)

// Test dependencies
val munit = "1.0.3"
Expand Down
2 changes: 1 addition & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object Settings {
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.7.0"
case _ => "2.0.0-M2"
case _ => "2.0.0-M3"
}
},
scriptedBufferLog := false
Expand Down

0 comments on commit dab5798

Please sign in to comment.