forked from typelevel/cats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
203 lines (184 loc) · 6.46 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
import com.typesafe.sbt.pgp.PgpKeys.publishSigned
import com.typesafe.sbt.SbtSite.SiteKeys._
import com.typesafe.sbt.SbtGhPages.GhPagesKeys._
import pl.project13.scala.sbt.SbtJmh._
import sbtrelease.ReleaseStep
import sbtrelease.ReleasePlugin.ReleaseKeys.releaseProcess
import sbtrelease.ReleaseStateTransformations._
import sbtrelease.Utilities._
import sbtunidoc.Plugin.UnidocKeys._
lazy val buildSettings = Seq(
organization := "org.spire-math",
scalaVersion := "2.11.6",
crossScalaVersions := Seq("2.11.6")
)
lazy val commonSettings = Seq(
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:experimental.macros",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"
),
resolvers ++= Seq(
"bintray/non" at "http://dl.bintray.com/non/maven",
Resolver.sonatypeRepo("releases")
),
libraryDependencies ++= Seq(
"com.github.mpilquist" %% "simulacrum" % "0.2.0",
"org.spire-math" %% "algebra" % "0.2.0-SNAPSHOT" from "http://plastic-idolatry.com/jars/algebra_2.11-0.2.0-SNAPSHOT.jar",
"org.typelevel" %% "machinist" % "0.3.0",
compilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full),
compilerPlugin("org.spire-math" %% "kind-projector" % "0.5.2")
),
scmInfo := Some(ScmInfo(url("https://github.com/non/cats"),
"git@github.com:non/cats.git"))
)
lazy val catsSettings = buildSettings ++ commonSettings ++ publishSettings ++ releaseSettings
lazy val disciplineDependencies = Seq(
"org.scalacheck" %% "scalacheck" % "1.11.3",
"org.typelevel" %% "discipline" % "0.2.1"
)
lazy val docSettings = Seq(
autoAPIMappings := true,
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(core, laws, data, std),
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "api"),
site.addMappingsToSiteDir(tut, "_tut"),
ghpagesNoJekyll := false,
siteMappings += file("CONTRIBUTING.md") -> "contributing.md",
scalacOptions in (ScalaUnidoc, unidoc) ++= Seq(
"-doc-source-url", scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala",
"-sourcepath", baseDirectory.in(LocalRootProject).value.getAbsolutePath
),
git.remoteRepo := "git@github.com:non/cats.git",
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.yml" | "*.md"
)
lazy val docs = project
.settings(moduleName := "cats-docs")
.settings(catsSettings: _*)
.settings(noPublishSettings: _*)
.settings(unidocSettings: _*)
.settings(site.settings: _*)
.settings(ghpages.settings: _*)
.settings(tutSettings: _*)
.settings(docSettings: _*)
.settings(tutSettings: _*)
.dependsOn(core, std, data)
lazy val cats = project.in(file("."))
.settings(catsSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(macros, core, laws, tests, docs, data, std, bench)
.dependsOn(macros, core, laws, tests, docs, data, std, bench)
lazy val macros = project
.settings(moduleName := "cats-macros")
.settings(catsSettings: _*)
lazy val core = project.dependsOn(macros)
.settings(moduleName := "cats-core")
.settings(catsSettings: _*)
.settings(
sourceGenerators in Compile <+= (sourceManaged in Compile).map(Boilerplate.gen)
)
lazy val laws = project.dependsOn(macros, core, data, std)
.settings(moduleName := "cats-laws")
.settings(catsSettings: _*)
.settings(
libraryDependencies ++= disciplineDependencies ++ Seq(
"org.spire-math" %% "algebra-laws" % "0.2.0-SNAPSHOT" from "http://plastic-idolatry.com/jars/algebra-laws_2.11-0.2.0-SNAPSHOT.jar"
)
)
lazy val std = project.dependsOn(macros, core)
.settings(moduleName := "cats-std")
.settings(catsSettings: _*)
.settings(
libraryDependencies += "org.spire-math" %% "algebra-std" % "0.2.0-SNAPSHOT" from "http://plastic-idolatry.com/jars/algebra-std_2.11-0.2.0-SNAPSHOT.jar"
)
lazy val tests = project.dependsOn(macros, core, data, std, laws)
.settings(moduleName := "cats-tests")
.settings(catsSettings: _*)
.settings(noPublishSettings: _*)
.settings(
libraryDependencies ++= disciplineDependencies ++ Seq(
"org.scalatest" %% "scalatest" % "2.1.3" % "test"
)
)
lazy val bench = project.dependsOn(macros, core, data, std, laws)
.settings(moduleName := "cats-bench")
.settings(catsSettings: _*)
.settings(noPublishSettings: _*)
.settings(jmhSettings: _*)
lazy val data = project.dependsOn(macros, core)
.settings(moduleName := "cats-data")
.settings(catsSettings: _*)
lazy val publishSettings = Seq(
homepage := Some(url("https://github.com/non/cats")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
autoAPIMappings := true,
apiURL := Some(url("https://non.github.io/cats/api/")),
publishMavenStyle := true,
publishArtifact in packageDoc := false,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
publishTo <<= version { (v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := (
<scm>
<url>git@github.com:non/cats.git</url>
<connection>scm:git:git@github.com:non/cats.git</connection>
</scm>
<developers>
<developer>
<id>non</id>
<name>Erik Osheim</name>
<url>http://github.com/non/</url>
</developer>
</developers>
),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishSignedArtifacts,
setNextVersion,
commitNextVersion,
pushChanges
)
)
lazy val publishSignedArtifacts = ReleaseStep(
action = { st =>
val extracted = st.extract
val ref = extracted.get(thisProjectRef)
extracted.runAggregated(publishSigned in Global in ref, st)
},
check = { st =>
// getPublishTo fails if no publish repository is set up.
val ex = st.extract
val ref = ex.get(thisProjectRef)
Classpaths.getPublishTo(ex.get(publishTo in Global in ref))
st
},
enableCrossBuild = true
)
lazy val noPublishSettings = Seq(
publish := (),
publishLocal := (),
publishArtifact := false
)
addCommandAlias("validate", ";compile;test;scalastyle;test:scalastyle;unidoc;tut")