-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sbt
189 lines (163 loc) · 5.15 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
import com.typesafe.sbt.SbtGhPages.GhPagesKeys._
import sbtunidoc.Plugin.UnidocKeys._
//import ScoverageSbtPlugin._
Defaults.itSettings
//useGpg := true
pgpReadOnly := false
lazy val buildSettings = Seq(
organization := "com.github.finagle",
scalaVersion := "2.12.7",
crossScalaVersions := Seq("2.11.8", "2.12.3")
)
lazy val compilerOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-language:implicitConversions",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-value-discard",
"-Ypatmat-exhaust-depth", "off",
"-Xfuture"
)
lazy val specs2Version = "3.9.5"
lazy val testDependencies = Seq(
"org.specs2" %% "specs2-core" % specs2Version,
"org.specs2" %% "specs2-scalacheck" % specs2Version,
"org.specs2" %% "specs2-junit" % specs2Version,
"org.specs2" %% "specs2-mock" % specs2Version,
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.netty" % "netty-buffer" % nettyVersion
)
scalacOptions in Test ++= Seq("-Yrangepos")
lazy val baseSettings = Seq(
scalacOptions ++= compilerOptions,
scalacOptions in (Compile, console) := compilerOptions,
scalacOptions in (Compile, doc) ++= Seq(
"-doc-title", "roc",
"-doc-version", version.value,
"-groups"
),
libraryDependencies ++= testDependencies.map(_ % "it,test"),
resolvers += Resolver.sonatypeRepo("snapshots"),
//coverageEnabled := true,
autoAPIMappings := true,
resolvers += "Twitter Maven repo" at "http://maven.twttr.com/"
)
lazy val allSettings = buildSettings ++ baseSettings ++ Defaults.itSettings
lazy val coreVersion = "0.0.7-M3"
lazy val catsVersion = "0.9.0"
lazy val finagleVersion = "6.45.0"
lazy val nettyVersion = "4.1.10.Final"
lazy val circeVersion = "0.8.0"
lazy val jawnVersion = "0.10.4"
lazy val roc = project.in(file("."))
.settings(moduleName := "root")
.configs( IntegrationTest )
.settings(allSettings)
.settings(docSettings)
.aggregate(core, types)
.dependsOn(core, types)
lazy val core = project
.settings(moduleName := "roc-core")
.configs( IntegrationTest )
.settings(version := coreVersion)
.settings(allSettings:_*)
.settings(docSettings)
.settings(sharedPublishSettings)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats" % catsVersion,
"io.netty" % "netty-buffer" % nettyVersion,
"com.twitter" %% "finagle-core" % finagleVersion
//"com.twitter" %% "finagle-netty3" % finagleVersion
)
)
lazy val types = project
.settings(moduleName := "roc-types")
.settings(version := coreVersion)
.configs( IntegrationTest )
.settings(allSettings:_*)
.settings(docSettings)
.settings(sharedPublishSettings)
.settings(
libraryDependencies ++= Seq(
"io.netty" % "netty-buffer" % nettyVersion,
"org.spire-math" %% "jawn-ast" % jawnVersion,
"org.typelevel" %% "cats" % catsVersion
)
)
.dependsOn(core)
lazy val benchmark = project
.settings(
description := "roc-benchmark",
moduleName := "roc-benchmark"
)
.settings(allSettings:_*)
.settings(noPublishSettings)
.enablePlugins(JmhPlugin)
.dependsOn(core)
lazy val tagName = Def.setting{
s"v${if (releaseUseGlobalVersion.value) (version in ThisBuild).value else version.value}"
}
lazy val sharedPublishSettings = Seq(
releaseCrossBuild := true,
releaseTagName := tagName.value,
homepage := Some(url("https://github.com/finagle/roc")),
licenses := Seq("BSD New" -> url("https://opensource.org/licenses/BSD-3-Clause")),
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := Function.const(false),
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")
},
autoAPIMappings := true,
scmInfo := Some(
ScmInfo(
url("https://github.com/finagle/roc"),
"scm:git:git@github.com:finagle/roc.git"
)
),
pomExtra := (
<developers>
<developer>
<id>penland365</id>
<name>Jeffrey Davis</name>
<url>https://twitter.com/penland365</url>
</developer>
</developers>
)
)
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
lazy val noPublishSettings = Seq(
publish := (),
publishLocal := (),
publishArtifact := false
)
lazy val docSettings = site.settings ++ ghpages.settings ++ unidocSettings ++ Seq(
autoAPIMappings := true,
ghpagesNoJekyll := false,
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "docs"),
git.remoteRepo := "git@github.com:finagle/roc.git",
unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject
)