forked from bkirwi/decline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
205 lines (188 loc) · 6.23 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
198
199
200
201
202
203
204
205
import ReleaseTransformations._
import sbtcrossproject.{crossProject, CrossType}
import microsites._
enablePlugins(ScalaJSPlugin)
mimaFailOnNoPrevious in ThisBuild := false
val mimaPreviousVersion = "1.0.0"
val defaultSettings = Seq(
scalaVersion := "2.11.12",
crossScalaVersions := List("2.11.12", "2.12.8", "2.13.1"),
resolvers += Resolver.sonatypeRepo("releases"),
homepage := Some(url("http://monovore.com/decline")),
organization := "com.monovore",
scalacOptions ++= Seq("-deprecation", "-feature", "-language:higherKinds"),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) =>
Seq("-Xfatal-warnings")
case _ =>
Nil
}
},
licenses += ("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
Global / PgpKeys.gpgCommand := "/usr/bin/gpg2",
scmInfo := Some(
ScmInfo(
url("https://github.com/bkirwi/decline"),
"git@github.com:bkirwi/decline.git"
)
),
pomExtra := (
<developers>
<developer>
<id>bkirwi</id>
<name>Ben Kirwin</name>
<url>http://ben.kirw.in/</url>
</developer>
</developers>
),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
publishTo := Some(
if (isSnapshot.value) Opts.resolver.sonatypeSnapshots
else Opts.resolver.sonatypeStaging
),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
releaseStepCommand("sonatypeReleaseAll"),
setNextVersion,
commitNextVersion,
pushChanges
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
val catsVersion = "2.0.0"
lazy val root =
project.in(file("."))
.aggregate(declineJS, declineJVM, refinedJS, refinedJVM, effectJS, effectJVM, enumeratumJS, enumeratumJVM, doc)
.settings(defaultSettings)
.settings(noPublishSettings)
lazy val decline =
crossProject(JSPlatform, JVMPlatform).in(file("core"))
.settings(defaultSettings)
.settings(
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full)
)
.settings(
name := "decline",
description := "Composable command-line parsing for Scala",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsVersion,
"org.typelevel" %%% "cats-laws" % catsVersion % Test,
"org.typelevel" %%% "discipline-scalatest" % "1.0.0-RC4" % Test
),
)
.jvmSettings(
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % mimaPreviousVersion),
)
.jsSettings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC3"
)
lazy val declineJVM = decline.jvm
lazy val declineJS = decline.js
lazy val bench =
project.in(file("bench"))
.enablePlugins(JmhPlugin)
.dependsOn(declineJVM, refinedJVM)
.settings(defaultSettings)
.settings(noPublishSettings)
.settings(fork := true)
lazy val refined =
crossProject(JSPlatform, JVMPlatform).crossType(CrossType.Pure).in(file("refined"))
.settings(defaultSettings)
.settings(
name := "refined",
moduleName := "decline-refined",
libraryDependencies ++= {
val refinedVersion = "0.9.12"
Seq(
"eu.timepit" %%% "refined" % refinedVersion,
"eu.timepit" %%% "refined-scalacheck" % refinedVersion % "test"
)
}
)
.dependsOn(decline % "compile->compile;test->test")
.jvmSettings(
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % mimaPreviousVersion),
)
lazy val refinedJVM = refined.jvm
lazy val refinedJS = refined.js
lazy val effect =
crossProject(JSPlatform, JVMPlatform).in(file("effect"))
.settings(defaultSettings)
.settings(
name := "effect",
moduleName := "decline-effect",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-effect" % catsVersion
)
)
.dependsOn(decline % "compile->compile;test->test")
.jvmSettings(
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % mimaPreviousVersion),
)
lazy val effectJVM = effect.jvm
lazy val effectJS = effect.js
lazy val enumeratum =
crossProject(JSPlatform, JVMPlatform).crossType(CrossType.Pure).in(file("enumeratum"))
.settings(defaultSettings)
.settings(
name := "enumeratum",
moduleName := "decline-enumeratum",
libraryDependencies += "com.beachape" %%% "enumeratum" % "1.5.13"
)
.dependsOn(decline % "compile->compile;test->test")
.jvmSettings(
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % mimaPreviousVersion),
)
lazy val enumeratumJVM = enumeratum.jvm
lazy val enumeratumJS = enumeratum.js
lazy val doc =
project.in(file("doc"))
.dependsOn(declineJVM, refinedJVM, effectJVM, enumeratumJVM)
.enablePlugins(MicrositesPlugin)
.settings(defaultSettings)
.settings(noPublishSettings)
.settings(
micrositeName := "decline",
micrositeDescription := "Composable command-line parsing for Scala",
micrositeConfigYaml := microsites.ConfigYml(
yamlInline = """kramdown: { input: GFM, hard_wrap: false }"""
),
micrositeBaseUrl := "/decline",
micrositeGithubOwner := "bkirwi",
micrositeGithubRepo := "decline",
micrositeGitterChannel := false,
micrositeShareOnSocial := false,
micrositeHighlightTheme := "solarized-light",
micrositeDocumentationUrl := "usage.html",
micrositePalette := Map(
"brand-primary" -> "#B58900",
"brand-secondary" -> "#073642",
"brand-tertiary" -> "#002b36",
"gray-dark" -> "#453E46",
"gray" -> "#837F84",
"gray-light" -> "#E3E2E3",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#fdf6e3"
),
mdocVariables := Map(
"DECLINE_VERSION" -> "1.0.0",
),
micrositeCompilingDocsTool := WithMdoc,
mdocIn := tutSourceDirectory.value,
)