Skip to content

Commit

Permalink
Merge pull request #313 from BillyAutrey/update-to-sbt-1-10-2
Browse files Browse the repository at this point in the history
Prep for sbt 2, update to slash syntax
  • Loading branch information
eed3si9n authored Oct 7, 2024
2 parents d3e0224 + fdda91d commit 1458cb0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 11 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
lazy val scala212 = "2.12.20"
lazy val scala3 = "3.3.4"

inThisBuild(
List(
organization := "com.github.sbt",
Expand All @@ -12,7 +15,8 @@ inThisBuild(
"olafurpg@gmail.com",
url("https://geirsson.com")
)
)
),
crossScalaVersions := Seq(scala212)
)
)

Expand All @@ -24,7 +28,12 @@ lazy val plugin = project
.enablePlugins(SbtPlugin)
.settings(
moduleName := "sbt-ci-release",
pluginCrossBuild / sbtVersion := "1.0.4",
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.5.8"
case _ => "2.0.0-M2"
}
},
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1"),
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1"),
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1"),
Expand Down
6 changes: 3 additions & 3 deletions plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ object CiReleasePlugin extends AutoPlugin {
)

override lazy val globalSettings: Seq[Def.Setting[_]] = List(
publishArtifact.in(Test) := false,
(Test / publishArtifact) := false,
publishMavenStyle := true,
commands += Command.command("ci-release") { currentState =>
val shouldDeployToSonatypeCentral = isDeploySetToSonatypeCentral(currentState)
Expand Down Expand Up @@ -200,7 +200,7 @@ object CiReleasePlugin extends AutoPlugin {
)

def isDeploySetToSonatypeCentral(state: State): Boolean = {
sonatypeCredentialHost.in(ThisBuild).get(Project.extract(state).structure.data) match {
(ThisBuild / sonatypeCredentialHost).get(Project.extract(state).structure.data) match {
case Some(value) if value == Sonatype.sonatypeCentralHost => {
true
}
Expand All @@ -209,7 +209,7 @@ object CiReleasePlugin extends AutoPlugin {
}

def isSnapshotVersion(state: State): Boolean = {
version.in(ThisBuild).get(Project.extract(state).structure.data) match {
(ThisBuild / version).get(Project.extract(state).structure.data) match {
case Some(v) => v.endsWith("-SNAPSHOT")
case None => throw new NoSuchFieldError("version")
}
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
unmanagedSourceDirectories.in(Compile) +=
baseDirectory.in(ThisBuild).value.getParentFile /
Compile / unmanagedSourceDirectories +=
(ThisBuild / baseDirectory).value.getParentFile /
"plugin" / "src" / "main" / "scala"
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")
Expand Down

0 comments on commit 1458cb0

Please sign in to comment.