Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for sbt 2, update to slash syntax #313

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
"[email protected]",
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