This repository has been archived by the owner on Mar 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
78 lines (68 loc) · 2.14 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
import sbtrelease.ReleaseStateTransformations._
organization := "co.vitaler"
name := "sbt-update-lines"
description := "Updates lines in e.g. README.md files when using sbt-release"
sbtPlugin := true
crossSbtVersions := Vector("1.2.8")
scalaVersion := "2.12.8"
scriptedLaunchOpts += ("-Dplugin.version=" + version.value)
scriptedBufferLog := false
libraryDependencies ++= Seq(
"org.specs2" %% "specs2-core" % "4.3.6" % Test,
"org.specs2" %% "specs2-mock" % "4.3.6" % Test,
)
Test / scalacOptions ++= Seq("-Yrangepos")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
enablePlugins(SbtPlugin)
// GPG settings
credentials += Credentials(
"GnuPG Key ID",
"gpg",
"B9513278AF9A10374E07A88FAA24C7523BD70F36",
"ignored"
)
// Publishing
bintrayRepository := "sbt-plugins"
bintrayOrganization := Some("vitaler")
publishMavenStyle := false
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
// Release settings
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
updateLines,
commitReleaseVersion,
publishArtifacts,
tagRelease,
setNextVersion,
commitNextVersion,
pushChanges
)
val unreleasedCompare = """^\[Unreleased\]: https://github\.com/(.*)/compare/(.*)\.\.\.HEAD$""".r
updateLinesSchema := Seq(
UpdateLine(
file("README.md"),
_.matches("addSbtPlugin.*// Latest release"),
(v, _) => s"""addSbtPlugin("co.vitaler" % "sbt-update-lines" % "$v") // Latest release"""
),
UpdateLine(
file("CHANGELOG.md"),
_.matches("## \\[Unreleased\\]"),
(v, _) => s"## [Unreleased]\n\n## [$v] - ${java.time.LocalDate.now}"
),
UpdateLine(
file("CHANGELOG.md"),
unreleasedCompare.unapplySeq(_).isDefined,
(v, compareLine) => compareLine match {
case unreleasedCompare(project, previous) =>
s"[Unreleased]: https://github.com/$project/compare/v$v...HEAD\n[$v]: https://github.com/$project/compare/$previous...v$v"
}
),
UpdateLine(
file("project/plugins.sbt"),
_.matches(s"""addSbtPlugin\\("co.vitaler" % "sbt-update-lines" % .*"""),
(v, _) => s"""addSbtPlugin("co.vitaler" % "sbt-update-lines" % "$v")"""
)
)