-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
71 lines (63 loc) · 2.29 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import ReleaseTransformations._
Global / excludeLintKeys += crossSbtVersions
val scala2 = "2.12.20"
val scala3 = "3.6.4"
lazy val sbtGitFlowVersion = (project in file("."))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-git-flow-version",
crossScalaVersions := List(scala2, scala3),
scalaVersion := scala2,
scalacOptions := {
scalaBinaryVersion.value match {
case "2.12" => Seq("-deprecation", "-unchecked", "-Xlint", "-feature")
case _ => Seq("-deprecation", "-unchecked", "-feature")
}
},
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.1.0"),
libraryDependencies ++= {
val scalaTestV = "3.2.19"
Seq(
"org.scalatest" %% "scalatest-core" % scalaTestV % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % scalaTestV % Test,
"org.scalatest" %% "scalatest-flatspec" % scalaTestV % Test
)
},
pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" => "1.2.8"
case _ => "2.0.0-M4"
}
},
buildSettings,
releaseSettings
)
lazy val buildSettings = Seq(
organization := "me.limansky",
description := "An sbt plugin that offers git flow based version",
licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))),
developers := List(Developer("limansky", "Mike Limansky", "mike.limansky at gmail.com", url("http://www.limansky.me/"))),
startYear := Some(2018),
scmInfo := Some(ScmInfo(url("https://github.com/limansky/sbt-git-flow-version"), "scm:git:[email protected]:limansky/sbt-git-flow-version.git")),
homepage := scmInfo.value map (_.browseUrl),
publishTo := sonatypePublishToBundle.value
)
lazy val releaseSettings = Seq(
releaseCrossBuild := true,
releaseTagName := { (ThisBuild / version).value },
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("+test"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
)