Skip to content

Commit 1458cb0

Browse files
authored
Merge pull request #313 from BillyAutrey/update-to-sbt-1-10-2
Prep for sbt 2, update to slash syntax
2 parents d3e0224 + fdda91d commit 1458cb0

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

build.sbt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
lazy val scala212 = "2.12.20"
2+
lazy val scala3 = "3.3.4"
3+
14
inThisBuild(
25
List(
36
organization := "com.github.sbt",
@@ -12,7 +15,8 @@ inThisBuild(
1215
1316
url("https://geirsson.com")
1417
)
15-
)
18+
),
19+
crossScalaVersions := Seq(scala212)
1620
)
1721
)
1822

@@ -24,7 +28,12 @@ lazy val plugin = project
2428
.enablePlugins(SbtPlugin)
2529
.settings(
2630
moduleName := "sbt-ci-release",
27-
pluginCrossBuild / sbtVersion := "1.0.4",
31+
(pluginCrossBuild / sbtVersion) := {
32+
scalaBinaryVersion.value match {
33+
case "2.12" => "1.5.8"
34+
case _ => "2.0.0-M2"
35+
}
36+
},
2837
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1"),
2938
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1"),
3039
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1"),

plugin/src/main/scala/com/geirsson/CiReleasePlugin.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ object CiReleasePlugin extends AutoPlugin {
130130
)
131131

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

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

211211
def isSnapshotVersion(state: State): Boolean = {
212-
version.in(ThisBuild).get(Project.extract(state).structure.data) match {
212+
(ThisBuild / version).get(Project.extract(state).structure.data) match {
213213
case Some(v) => v.endsWith("-SNAPSHOT")
214214
case None => throw new NoSuchFieldError("version")
215215
}

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
unmanagedSourceDirectories.in(Compile) +=
2-
baseDirectory.in(ThisBuild).value.getParentFile /
1+
Compile / unmanagedSourceDirectories +=
2+
(ThisBuild / baseDirectory).value.getParentFile /
33
"plugin" / "src" / "main" / "scala"
44
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
55
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")

0 commit comments

Comments
 (0)