This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
104 lines (80 loc) · 2.42 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
95
96
97
98
99
100
101
102
103
104
import sbtrelease._
import ReleaseStateTransformations._
name := "jwt-scala"
organization := "com.github.xuwei-k"
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-language:implicitConversions"
)
val Scala212 = "2.12.20"
scalaVersion := Scala212
crossScalaVersions := Seq(Scala212, "2.13.15", "3.3.4")
homepage := Some(url("https://github.com/xuwei-k/jwt-scala"))
licenses += "Apache2" -> url("http://www.opensource.org/licenses/Apache-2.0")
scmInfo := Some(ScmInfo(url("https://github.com/xuwei-k/jwt-scala"), "scm:[email protected]:xuwei-k/jwt-scala.git"))
publishMavenStyle := true
Test / publishArtifact := false
pomIncludeRepository := { _ => false }
pomExtra := (<developers>
<developer>
<id>xuwei-k</id>
<name>Kenji Yoshida</name>
</developer>
</developers>)
publishTo := sonatypePublishToBundle.value
libraryDependencies += "org.playframework" %% "play-json" % "3.0.4"
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"commons-codec" % "commons-codec" % "1.17.1",
"org.bouncycastle" % "bcprov-jdk16" % "1.46"
)
releasePublishArtifactsAction := PgpKeys.publishSigned.value
(Compile / doc / scalacOptions) ++= {
val tag = tagOrHash.value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((v, _)) if v >= 3 =>
Nil
case _ =>
Seq(
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url",
s"https://github.com/xuwei-k/jwt-scala/tree/${tag}€{FILE_PATH}.scala"
)
}
}
val tagName = Def.setting {
s"v${if (releaseUseGlobalVersion.value) (ThisBuild / version).value else version.value}"
}
val tagOrHash = Def.setting {
if (isSnapshot.value) {
sys.process.Process("git rev-parse HEAD").lineStream_!.head
} else {
tagName.value
}
}
releaseTagName := tagName.value
releaseCrossBuild := true
def releaseStepCross[A](key: TaskKey[A]) =
ReleaseStep(
action = { state =>
val extracted = Project extract state
extracted.runAggregated(extracted.get(thisProjectRef) / (Global / key), state)
},
enableCrossBuild = true
)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCross(PgpKeys.publishSigned),
releaseStepCommandAndRemaining("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)