-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
98 lines (86 loc) · 2.9 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
import com.jsuereth.sbtpgp.PgpKeys._
import sbtrelease.ReleaseStateTransformations._
lazy val scalaVersions = List("2.12.12", "2.13.5")
Global / organization := "com.klibisz.futil"
sonatypeProfileName := "com.klibisz"
lazy val noPublishSettings = Seq(
publish,
publishArtifact,
publishSigned,
publishConfiguration,
sonatypeBundleRelease
).map(skip in _ := true)
lazy val root = project.in(file("."))
.aggregate(futil, docs)
.settings(
name := "futil-root",
noPublishSettings
)
lazy val futil = project.in(file("futil"))
.settings(
name := "futil",
description := "Zero-dependency utilities for Scala Futures",
crossScalaVersions := scalaVersions,
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.4.2",
"org.scalatest" %% "scalatest" % "3.2.5" % Test
),
scalacOptions ++= Seq(
"-feature",
"-language:higherKinds",
"-Xfatal-warnings",
"-deprecation",
"-unchecked",
"-Xlint:unused"
),
coverageMinimum := 100,
coverageFailOnMinimum := true,
fork in Test := true,
javaOptions in Test ++= Seq("-Xms768m", "-Xmx768m"),
parallelExecution in Test := false,
// sbt-sonatype settings
publishTo := sonatypePublishToBundle.value,
publishMavenStyle := true,
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("https://github.com/alexklibisz/futil")),
scmInfo := Some(ScmInfo(url("https://github.com/alexklibisz/futil"), "scm:[email protected]:alexklibisz/futil.git")),
developers += Developer(id="alexklibisz", name="Alex Klibisz", email="[email protected]", url=url("https://alexklibisz.com"))
)
lazy val docs = project.in(file("docs"))
.enablePlugins(MdocPlugin)
.dependsOn(futil)
.settings(
noPublishSettings,
crossScalaVersions := scalaVersions,
mdocIn := file("README.md"),
mdocOut := file("/dev/null")
)
// sbt-release configuration.
// To set the version, just strip -SNAPSHOT from the version.
// "1.2.3-PRE1-SNAPSHOT" -> "1.2.3-PRE1"
releaseVersion := { _.replace("-SNAPSHOT", "") }
// To set the next version, increment the last number and append -SNAPSHOT.
// "1.2.3-PRE1" -> "1.2.3-PRE2-SNAPSHOT"
releaseNextVersion := { v: String =>
"[0-9]+".r
.findAllMatchIn(v)
.toList
.lastOption
.map(m => v.take(m.start) ++ s"${m.toString.toInt + 1}" ++ v.drop(m.`end`) + "-SNAPSHOT")
.getOrElse(v)
}
releaseCrossBuild := true
// Slightly modified to work with sbt-sonatype.
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)