This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sbt
194 lines (176 loc) · 5.4 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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
lazy val root = project.in(file(""))
.disablePlugins(MimaPlugin)
.settings(noPublishSettings)
.settings(commonSettings, releaseSettings)
.aggregate(
coreJVM,
coreJS
)
val catsV = "2.0.0"
val catsEffectV = "2.0.0-RC1" // Docs Only
val specs2V = "4.7.0"
lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("par"))
.settings(commonSettings, releaseSettings, mimaSettings)
.settings(
name := "cats-par"
)
lazy val docs = project.in(file("docs"))
.settings(noPublishSettings)
.settings(commonSettings, micrositeSettings)
.enablePlugins(MicrositesPlugin)
.enablePlugins(TutPlugin)
.dependsOn(coreJVM)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect" % catsEffectV
)
)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val contributors = Seq(
"ChristopherDavenport" -> "Christopher Davenport"
)
lazy val commonSettings = Seq(
organization := "io.chrisdavenport",
scalaVersion := "2.13.0",
crossScalaVersions := Seq(scalaVersion.value, "2.12.9"),
scalacOptions -= "-Xfatal-warnings",
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.10.3" cross CrossVersion.binary),
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsV,
"org.specs2" %%% "specs2-core" % specs2V % Test,
)
)
lazy val releaseSettings = {
import ReleaseTransformations._
Seq(
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// For non cross-build projects, use releaseStepCommand("publishSigned")
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
),
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")
},
credentials ++= (
for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
).toSeq,
publishArtifact in Test := false,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
scmInfo := Some(
ScmInfo(
url("https://github.com/ChristopherDavenport/cats-par"),
"[email protected]:ChristopherDavenport/cats-par.git"
)
),
homepage := Some(url("https://github.com/ChristopherDavenport/cats-par")),
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true,
pomIncludeRepository := { _ =>
false
},
pomExtra := {
<developers>
{for ((username, name) <- contributors) yield
<developer>
<id>{username}</id>
<name>{name}</name>
<url>http://github.com/{username}</url>
</developer>
}
</developers>
}
)
}
lazy val micrositeSettings = Seq(
micrositeName := "cats-par",
micrositeDescription := "Single Type Parameter Parallel Instances",
micrositeAuthor := "Christopher Davenport",
micrositeGithubOwner := "ChristopherDavenport",
micrositeGithubRepo := "cats-par",
micrositeBaseUrl := "/cats-par",
micrositeDocumentationUrl := "https://christopherdavenport.github.io/cats-par",
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"
),
fork in tut := true,
scalacOptions in Tut --= Seq(
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Ywarn-unused:imports",
"-Xlint:-missing-interpolator,_"
),
libraryDependencies += "com.47deg" %% "github4s" % "0.20.0",
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("GITHUB_TOKEN")
)
lazy val mimaSettings = {
import sbtrelease.Version
def mimaVersion(version: String) = {
Version(version) match {
case Some(Version(major, Seq(minor, patch), _)) if patch.toInt > 0 =>
Some(s"${major}.${minor}.${patch.toInt - 1}")
case _ =>
None
}
}
Seq(
mimaFailOnNoPrevious := false,
mimaFailOnProblem := mimaVersion(version.value).isDefined,
mimaPreviousArtifacts := (mimaVersion(version.value) map {
organization.value % s"${moduleName.value}_${scalaBinaryVersion.value}" % _
}).toSet,
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters._
Seq()
}
)
}
lazy val noPublishSettings = {
import com.typesafe.sbt.pgp.PgpKeys.publishSigned
Seq(
publish := {},
publishLocal := {},
publishSigned := {},
publishArtifact := false
)
}