forked from sbt/sbt-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
75 lines (62 loc) · 2.04 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
lazy val `sbt-release` = project in file(".")
organization := "com.github.gseitz"
name := "sbt-release"
homepage := Some(url("https://github.com/sbt/sbt-release"))
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
crossSbtVersions := Vector("0.13.17", "1.1.6")
sbtPlugin := true
publishMavenStyle := false
scalacOptions += "-deprecation"
val unusedWarnings = Seq("-Ywarn-unused-import")
scalacOptions ++= PartialFunction.condOpt(CrossVersion.partialVersion(scalaVersion.value)){
case Some((2, v)) if v >= 11 => unusedWarnings
}.toList.flatten
Seq(Compile, Test).flatMap(c =>
scalacOptions in (c, console) --= unusedWarnings
)
val tagName = Def.setting{
s"v${if (releaseUseGlobalVersion.value) (version in ThisBuild).value else version.value}"
}
val tagOrHash = Def.setting{
if(isSnapshot.value)
sys.process.Process("git rev-parse HEAD").lines_!.head
else
tagName.value
}
releaseTagName := tagName.value
scalacOptions in (Compile, doc) ++= {
val tag = tagOrHash.value
Seq(
"-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath,
"-doc-source-url", s"https://github.com/sbt/sbt-release/tree/${tag}€{FILE_PATH}.scala"
)
}
libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "3.9.1" % "test")
// Scripted
scriptedSettings
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + version.value)
}
scriptedBufferLog := false
// Bintray
bintrayOrganization := Some("sbt")
bintrayRepository := "sbt-plugin-releases"
bintrayPackage := "sbt-release"
bintrayReleaseOnPublish := false
// Release
import ReleaseTransformations._
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("^ test"),
releaseStepCommandAndRemaining("^ scripted"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("^ publishSigned"),
releaseStepTask(bintrayRelease in `sbt-release`),
setNextVersion,
commitNextVersion,
pushChanges
)