-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
102 lines (77 loc) · 2.84 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
import com.typesafe.sbt.SbtGit.git
import scala.util.matching.Regex
ThisBuild / scalaVersion := "2.12.4"
ThisBuild / organization := "org.scalamari"
ThisBuild / scalacOptions ++= Seq(
"-deprecation",
"-explaintypes",
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-target:jvm-1.8",
"-encoding", "UTF-8",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen"
)
// Release
ThisBuild / sonatypeProfileName := organization.value
ThisBuild / homepage := Some(url("https://github.com/jCalamari/velocypack4s"))
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/jCalamari/velocypack4s"), "[email protected]:jCalamari/velocypack4s.git"))
ThisBuild / developers := List(Developer("jCalamari", "Piotr Fras", "[email protected]", url("https://github.com/jCalamari")))
ThisBuild / licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging)
ThisBuild / isSnapshot := version.value endsWith "SNAPSHOT"
ThisBuild / credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
sys.env.getOrElse("SONATYPE_USER", ""),
sys.env.getOrElse("SONATYPE_PASS", "")
)
// Git
val ReleaseTag: Regex = """^v([\d\.]+)$""".r
ThisBuild / git.gitTagToVersionNumber := {
case ReleaseTag(v) => Some(v)
case _ => None
}
ThisBuild / git.formattedShaVersion := {
val suffix = git.makeUncommittedSignifierSuffix(git.gitUncommittedChanges.value, git.uncommittedSignifier.value)
git.gitHeadCommit.value map {
_.substring(0, 7)
} map { sha =>
git.baseVersion.value + "-" + sha + suffix
}
}
// PGP
useGpg := false
usePgpKeyHex("38D42FA57C10A00B")
pgpPublicRing := baseDirectory.value / "project" / ".gnupg" / "pubring.gpg"
pgpSecretRing := baseDirectory.value / "project" / ".gnupg" / "secring.gpg"
pgpPassphrase := sys.env.get("PGP_PASS").map(_.toArray)
addCommandAlias("ci-all", ";+clean ;+compile ;+coverage ;+test ;+coverageReport ;+coverageAggregate ;+package")
addCommandAlias("release", ";+publishSigned ;sonatypeReleaseAll")
// Project
def VelocyPackModule(name: String): Project = Project(s"velocypack4s-$name", file(s"modules/$name"))
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
skip in publish := true
)
val core = VelocyPackModule("core")
.settings(Dependencies.core)
.enablePlugins(GitVersioning)
val macros = VelocyPackModule("macros")
.dependsOn(core)
.settings(Dependencies.macros)
.enablePlugins(GitVersioning)
val docs = VelocyPackModule("docs")
.dependsOn(macros)
.settings(tutTargetDirectory := file("."))
.settings(noPublishSettings)
.enablePlugins(TutPlugin)
val root = Project("velocypack4s", file("."))
.settings(noPublishSettings)
.aggregate(core)
.aggregate(macros)
.aggregate(docs)