-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.sbt
96 lines (88 loc) · 3.13 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
import Dependencies._
val LibraryDoc = config("library-doc")
val PluginDoc = config("plugin-doc")
ThisBuild / organization := "com.github.sbt"
ThisBuild / homepage := Some(url("https://github.com/sbt/sbt-pgp"))
ThisBuild / Compile / scalacOptions := Seq("-feature", "-deprecation", "-Xlint")
// Because we're both a library and an sbt plugin, we use crossScalaVersions rather than crossSbtVersions for
// cross building. So you can use commands like +scripted.
lazy val scala212 = "2.12.15"
lazy val scala3 = "3.3.4"
ThisBuild / crossScalaVersions := Seq(scala212, scala3)
ThisBuild / scalaVersion := scala212
ThisBuild / scalafmtOnCompile := true
ThisBuild / dynverSonatypeSnapshots := true
ThisBuild / version := {
val orig = (ThisBuild / version).value
if (orig.endsWith("-SNAPSHOT")) "2.0.2-SNAPSHOT"
else orig
}
lazy val root = (project in file("."))
.enablePlugins(GhpagesPlugin)
.enablePlugins(JekyllPlugin)
.enablePlugins(SiteScaladocPlugin)
.aggregate(library, plugin)
.settings(
name := "sbt-pgp root",
publish / skip := true,
git.remoteRepo := "[email protected]:sbt/sbt-pgp.git",
SiteScaladocPlugin.scaladocSettings(LibraryDoc, library / Compile / packageDoc / mappings, "library/latest/api"),
SiteScaladocPlugin.scaladocSettings(PluginDoc, plugin / Compile / packageDoc / mappings, "plugin/latest/api"),
crossScalaVersions := Vector.empty
)
lazy val plugin = (project in file("sbt-pgp"))
.enablePlugins(SbtPlugin)
.dependsOn(library)
.settings(
name := "sbt-pgp",
libraryDependencies += gigahorseOkhttp.value,
publishLocal := publishLocal.dependsOn((library / publishLocal)).value,
scriptedBufferLog := false,
scriptedLaunchOpts += s"-Dproject.version=${version.value}",
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.5.8"
case _ => "2.0.0-M2"
}
}
)
// library
// The library of PGP functions.
// Note: We're going to just publish this to the sbt repo now.
lazy val library = (project in file("gpg-library"))
.settings(
name := "pgp-library",
libraryDependencies ++= Seq(bouncyCastlePgp, gigahorseOkhttp.value, specs2 % Test, sbtIo % Test),
libraryDependencies ++= Seq(parserCombinators.value)
)
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/sbt/sbt-pgp"),
"scm:[email protected]:sbt/sbt-pgp.git"
)
)
ThisBuild / developers := List(
Developer(
id = "jsuereth",
name = "Josh Suereth",
email = "@jsuereth",
url = url("https://github.com/jsuereth")
),
Developer(
id = "eed3si9n",
name = "Eugene Yokota",
email = "@eed3si9n",
url = url("https://eed3si9n.com/")
)
)
ThisBuild / description := "sbt-pgp provides PGP signing for sbt"
ThisBuild / licenses := List("BSD-3-Clause" -> url("https://github.com/sbt/sbt-pgp/blob/develop/LICENSE"))
ThisBuild / pomIncludeRepository := { _ =>
false
}
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
ThisBuild / publishMavenStyle := true