forked from Banno/vault4s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
197 lines (171 loc) · 6.83 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
val Scala213 = "2.13.8"
val Scala3 = "3.1.2"
ThisBuild / crossScalaVersions := Seq("2.12.15", Scala213, Scala3)
ThisBuild / scalaVersion := crossScalaVersions.value.last
val OldGuardJava = JavaSpec.temurin("8")
val LTSJava = JavaSpec.temurin("11")
val LatestJava = JavaSpec.temurin("17")
ThisBuild / githubWorkflowJavaVersions := Seq(OldGuardJava, LTSJava, LatestJava)
ThisBuild / githubWorkflowArtifactUpload := false
val Scala213Cond = s"matrix.scala == '$Scala213'"
def rubySetupSteps(cond: Option[String]) = Seq(
WorkflowStep.Use(
UseRef.Public("ruby", "setup-ruby", "v1"),
name = Some("Setup Ruby"),
params = Map("ruby-version" -> "2.6.0"),
cond = cond),
WorkflowStep.Run(
List(
"gem install saas",
"gem install jekyll"),
name = Some("Install microsite dependencies"),
cond = cond))
ThisBuild / githubWorkflowBuildPreamble ++=
rubySetupSteps(Some(Scala213Cond))
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("test", "mimaReportBinaryIssues")),
WorkflowStep.Sbt(
List("docs/makeMicrosite"),
cond = Some(Scala213Cond)))
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowTargetBranches :=
Seq("*", "series/*")
// currently only publishing tags
ThisBuild / githubWorkflowPublishTargetBranches :=
Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowPublishPreamble ++=
WorkflowStep.Use(UseRef.Public("olafurpg", "setup-gpg", "v3")) +: rubySetupSteps(None)
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
name = Some("Publish artifacts to Sonatype"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}")),
WorkflowStep.Sbt(
List(s"++$Scala213", "docs/publishMicrosite"),
name = Some("Publish microsite")
)
)
val http4sV = "0.23.12"
val munitCatsEffectV = "1.0.7"
val munitScalaCheckV = "0.7.29"
val scalacheckEffectV = "1.0.4"
val kindProjectorV = "0.13.2"
val betterMonadicForV = "0.3.1"
lazy val `vault4s` = project.in(file("."))
.settings(publish / skip := true)
.disablePlugins(MimaPlugin)
.aggregate(core)
lazy val core = project.in(file("core"))
.settings(commonSettings)
.settings(
name := "vault4s",
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core.IncompatibleSignatureProblem
import com.typesafe.tools.mima.core.ProblemFilters.exclude
// See https://github.com/lightbend/mima/issues/423
Seq(
)
},
)
lazy val docs = project.in(file("docs"))
.settings(publish / skip := true)
.disablePlugins(MimaPlugin)
.enablePlugins(MicrositesPlugin)
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.dependsOn(core)
.settings{
import microsites._
Seq(
micrositeName := "vault4s",
micrositeDescription := "Vault Client Library For Scala",
micrositeAuthor := "Jack Henry & Associates, Inc.®",
micrositeGithubOwner := "Banno",
micrositeGithubRepo := "vault4s",
micrositeBaseUrl := "/vault4s",
micrositeDocumentationUrl := "https://www.javadoc.io/doc/com.banno/vault4s_2.12",
micrositeFooterText := None,
micrositeHighlightTheme := "atom-one-light",
micrositePalette := Map(
"brand-primary" -> "#3e5b95",
"brand-secondary" -> "#294066",
"brand-tertiary" -> "#2d5799",
"gray-dark" -> "#49494B",
"gray" -> "#7B7B7E",
"gray-light" -> "#E5E5E6",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"
),
scalacOptions in Compile --= Seq(
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Ywarn-unused:imports",
"-Xlint:-missing-interpolator,_"
),
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("GITHUB_TOKEN"),
micrositeExtraMdFiles := Map(
file("CHANGELOG.md") -> ExtraMdFileConfig("changelog.md", "page", Map("title" -> "changelog", "section" -> "changelog", "position" -> "100")),
file("CODE_OF_CONDUCT.md") -> ExtraMdFileConfig("code-of-conduct.md", "page", Map("title" -> "code of conduct", "section" -> "code of conduct", "position" -> "101")),
file("LICENSE") -> ExtraMdFileConfig("license.md", "page", Map("title" -> "license", "section" -> "license", "position" -> "102"))
)
)
}
// General Settings
lazy val commonSettings = Seq(
testFrameworks += new TestFramework("munit.Framework"),
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-client" % http4sV,
"org.http4s" %% "http4s-circe" % http4sV,
"org.http4s" %% "http4s-dsl" % http4sV % Test,
"org.typelevel" %% "munit-cats-effect-3" % munitCatsEffectV % Test,
"org.scalameta" %% "munit-scalacheck" % munitScalaCheckV % Test,
"org.typelevel" %% "scalacheck-effect-munit" % scalacheckEffectV % Test,
) ++ {
if(scalaVersion.value.startsWith("3")) List.empty
else List(
compilerPlugin("org.typelevel" %% "kind-projector" % kindProjectorV cross CrossVersion.full),
//"-source:future") could bring in support for better-monadic-for changes, but also breaks other things
compilerPlugin("com.olegpy" %% "better-monadic-for" % betterMonadicForV)
)
}
)
lazy val contributors = Seq(
"ChristopherDavenport" -> "Christopher Davenport",
"kevinmeredith" -> "Kevin Meredith",
"diesalbla" -> "Diego E. Alonso Blas",
"tyler-clark" -> "Tyler Clark",
"fedefernandez" -> "Fede Fernández",
"zcox" -> "Zach Cox",
"JesusMtnez" -> "Jesús Martínez",
"peterneyens" -> "Peter Neyens",
"calvinbrown085" -> "Calvin Brown",
"juanpedromoreno" -> "Juan Pedro Moreno",
"zmccoy" -> "Zach McCoy"
)
inThisBuild(List(
organization := "com.banno",
developers := {
for {
(username, name) <- contributors
} yield {
Developer(username, name, "", url(s"http://github.com/$username"))
},
}.toList,
scalacOptions in (Compile, doc) ++= Seq(
"-groups",
"-sourcepath", (baseDirectory in LocalRootProject).value.getAbsolutePath,
"-doc-source-url", "https://github.com/banno/vault4s/blob/v" + version.value + "€{FILE_PATH}.scala"
),
pomIncludeRepository := { _ => false},
organizationName := "Jack Henry & Associates, Inc.®",
startYear := Some(2019),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("https://github.com/banno/vault4s"))
))