/
build.sbt
178 lines (157 loc) · 5.75 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
import de.heikoseeberger.sbtheader.AutomateHeaderPlugin
import de.heikoseeberger.sbtheader.license.Apache2_0
import catext.Dependencies._
val dev = Seq(Dev("47 Degrees (twitter: @47deg)", "47 Degrees"))
val gh = GitHubSettings("com.fortysevendeg", "fetch", "47 Degrees", apache)
addCommandAlias("makeDocs", ";docs/makeMicrosite")
pgpPassphrase := Some(sys.env.getOrElse("PGP_PASSPHRASE", "").toCharArray)
pgpPublicRing := file(s"${sys.env.getOrElse("PGP_FOLDER", ".")}/pubring.gpg")
pgpSecretRing := file(s"${sys.env.getOrElse("PGP_FOLDER", ".")}/secring.gpg")
lazy val buildSettings = Seq(
organization := gh.org,
organizationName := gh.publishOrg,
description := "Simple & Efficient data access for Scala and Scala.js",
startYear := Option(2016),
homepage := Option(url("http://47deg.github.io/fetch/")),
organizationHomepage := Option(new URL("http://47deg.com")),
scalaVersion := "2.12.0",
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0"),
libraryDependencies ++= (scalaBinaryVersion.value match {
case "2.10" =>
compilerPlugin("org.scalamacros" % "paradise" % versions("paradise") cross CrossVersion.full) :: Nil
case _ =>
Nil
}),
headers := Map(
"scala" -> Apache2_0("2016", "47 Degrees, LLC. <http://www.47deg.com>")
)
)
lazy val commonSettings = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-free" % versions("cats"),
"org.scalatest" %%% "scalatest" % versions("scalatest") % "test",
compilerPlugin(
"org.spire-math" %% "kind-projector" % versions("kind-projector")
)
),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-feature",
"-Ywarn-dead-code",
"-language:higherKinds",
"-language:existentials",
"-language:postfixOps"
),
scalafmtConfig := Some(file(".scalafmt.conf"))
) ++ reformatOnCompileSettings
lazy val allSettings = buildSettings ++
commonSettings ++
sharedCommonSettings ++
miscSettings ++
sharedReleaseProcess ++
credentialSettings ++
sharedPublishSettings(gh, dev)
lazy val fetch = crossProject
.in(file("."))
.settings(moduleName := "fetch")
.settings(allSettings: _*)
.jsSettings(sharedJsSettings: _*)
.enablePlugins(AutomateHeaderPlugin)
lazy val fetchJVM = fetch.jvm
lazy val fetchJS = fetch.js
lazy val root = project
.in(file("."))
.aggregate(fetchJS, fetchJVM, fetchMonixJVM, fetchMonixJS, debugJVM, debugJS)
.settings(allSettings)
.settings(noPublishSettings)
lazy val micrositeSettings = Seq(
micrositeName := "Fetch",
micrositeDescription := "Simple & Efficient data access for Scala and Scala.js",
micrositeBaseUrl := "fetch",
micrositeDocumentationUrl := "/fetch/docs.html",
micrositeGithubOwner := "47deg",
micrositeGithubRepo := "fetch",
micrositeHighlightTheme := "tomorrow",
micrositePalette := Map("brand-primary" -> "#FF518C",
"brand-secondary" -> "#2F2859",
"brand-tertiary" -> "#28224C",
"gray-dark" -> "#48474C",
"gray" -> "#8D8C92",
"gray-light" -> "#E3E2E3",
"gray-lighter" -> "#F4F3F9",
"white-color" -> "#FFFFFF"),
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md"
)
lazy val docsSettings = buildSettings ++ micrositeSettings ++ Seq(
tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
tutScalacOptions ++= (scalaBinaryVersion.value match {
case "2.10" => Seq("-Xdivergence211")
case _ => Nil
}),
aggregate in doc := true
)
lazy val docs = (project in file("docs"))
.dependsOn(fetchJVM, fetchMonixJVM, debugJVM)
.settings(
moduleName := "fetch-docs"
)
.settings(docsSettings: _*)
.settings(noPublishSettings)
.enablePlugins(MicrositesPlugin)
lazy val readmeSettings = buildSettings ++ tutSettings ++ Seq(
tutSourceDirectory := baseDirectory.value,
tutTargetDirectory := baseDirectory.value.getParentFile,
tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))),
tutScalacOptions += "-Xdivergence211",
tutNameFilter := """README.md""".r
)
lazy val readme = (project in file("tut"))
.settings(
moduleName := "fetch-readme"
)
.dependsOn(fetchJVM)
.settings(readmeSettings: _*)
.settings(noPublishSettings)
lazy val monixSettings = (
libraryDependencies ++= Seq(
"io.monix" %%% "monix-eval" % versions("monix"),
"io.monix" %%% "monix-cats" % versions("monix")
)
)
lazy val monix = crossProject
.in(file("monix"))
.dependsOn(fetch)
.settings(moduleName := "fetch-monix")
.settings(allSettings: _*)
.jsSettings(sharedJsSettings: _*)
.settings(monixSettings: _*)
.enablePlugins(AutomateHeaderPlugin)
lazy val fetchMonixJVM = monix.jvm
lazy val fetchMonixJS = monix.js
lazy val debug = (crossProject in file("debug"))
.settings(
moduleName := "fetch-debug"
)
.dependsOn(fetch)
.settings(allSettings: _*)
.jsSettings(sharedJsSettings: _*)
.enablePlugins(AutomateHeaderPlugin)
lazy val debugJVM = debug.jvm
lazy val debugJS = debug.js
lazy val examplesSettings = Seq(
scalaVersion := "2.12.0",
libraryDependencies ++= Seq(
"org.tpolecat" %% "doobie-core-cats" % "0.3.1-M2",
"org.tpolecat" %% "doobie-h2-cats" % "0.3.1-M2",
"org.http4s" %% "http4s-blaze-client" % "0.15.0a",
"org.http4s" %% "http4s-circe" % "0.15.0a",
"io.circe" %% "circe-generic" % "0.6.1"
)
)
lazy val examples = (project in file("examples"))
.settings(moduleName := "fetch-examples")
.dependsOn(fetchJVM)
.settings(commonSettings: _*)
.settings(noPublishSettings: _*)
.settings(examplesSettings: _*)