-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
94 lines (92 loc) · 3.21 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import sbt.Keys.javacOptions
import sbtrelease.ReleaseStateTransformations.{
checkSnapshotDependencies,
commitNextVersion,
commitReleaseVersion,
inquireVersions,
pushChanges,
runClean,
runTest,
setNextVersion,
setReleaseVersion,
tagRelease
}
import sbtrelease.{versionFormatError, Version}
import java.util.regex.Pattern
lazy val root = project
.in(file("."))
.settings(
organization := "org.sweet-delights",
name := "delightful-cron",
homepage := Option(url("https://github.com/sweet-delights/delightful-cron")),
licenses := List("GNU Lesser General Public License Version 3" -> url("https://www.gnu.org/licenses/lgpl-3.0.txt")),
description := "delightful-cron is a library to parse Jenkins-like cron specifications with H symbols",
scmInfo := Option(ScmInfo(url("https://github.com/sweet-delights/delightful-cron"), "scm:[email protected]:sweet-delights/delightful-cron.git")),
developers := List(
Developer(
id = "pgrandjean",
name = "Patrick Grandjean",
email = "[email protected]",
url = url("https://github.com/pgrandjean")
)
),
scalaVersion := "3.3.1",
libraryDependencies ++= Seq(
// "sweet.delights" %% "delightful-extractors" % "0.0.2-SNAPSHOT",
"org.scala-lang.modules" %% "scala-parser-combinators" % "2.3.0",
"org.scalatest" %% "scalatest-shouldmatchers" % "3.2.17" % "test",
"org.scalatest" %% "scalatest-wordspec" % "3.2.17" % "test",
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.16.0" % "test"
),
scalacOptions ++= Seq(
"-deprecation",
"-feature"
),
Compile / javacOptions ++= Seq(
"-source",
"1.8",
"-target",
"1.8"
),
publishMavenStyle := true,
publishTo := Some {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
"snapshots" at nexus + "content/repositories/snapshots"
else
"releases" at nexus + "service/local/staging/deploy/maven2"
},
releaseVersion := { ver =>
val bumpedVersion = Version(ver)
.map { v =>
suggestedBump.value match {
case Version.Bump.Bugfix => v.withoutQualifier.string
case _ => v.bump(suggestedBump.value).withoutQualifier.string
}
}
.getOrElse(versionFormatError(ver))
bumpedVersion
},
releaseNextVersion := { ver =>
Version(ver).map(_.withoutQualifier.bump.string).getOrElse(versionFormatError(ver)) + "-SNAPSHOT"
},
releaseCommitMessage := s"[sbt-release] setting version to ${(ThisBuild / version).value}",
bugfixRegexes := List(s"${Pattern.quote("[patch]")}.*").map(_.r),
minorRegexes := List(s"${Pattern.quote("[minor]")}.*").map(_.r),
majorRegexes := List(s"${Pattern.quote("[major]")}.*").map(_.r),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeRelease"),
pushChanges
),
scalafmtOnCompile := true
)