forked from typelevel/catbird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
172 lines (158 loc) · 4.82 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
import ReleaseTransformations._
val catsVersion = "1.6.1"
val catsEffectVersion = "1.3.1"
val utilVersion = "19.6.0"
val finagleVersion = "19.6.0"
organization in ThisBuild := "io.catbird"
val compilerOptions = Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-unchecked",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-Ywarn-unused-import",
"-Yno-imports",
"-Yno-predef"
)
val docMappingsApiDir = settingKey[String]("Subdirectory in site target directory for API docs")
lazy val baseSettings = Seq(
scalacOptions ++= compilerOptions,
scalacOptions in (Compile, console) ~= {
_.filterNot(Set("-Ywarn-unused-import", "-Yno-imports", "-Yno-predef"))
},
scalacOptions in (Test, console) ~= {
_.filterNot(Set("-Ywarn-unused-import", "-Yno-imports", "-Yno-predef"))
},
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % catsVersion,
"org.scalacheck" %% "scalacheck" % "1.13.5" % Test,
"org.scalatest" %% "scalatest" % "3.0.8" % Test,
"org.typelevel" %% "cats-laws" % catsVersion % Test,
"org.typelevel" %% "discipline" % "0.9.0" % Test,
compilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3")
),
resolvers += Resolver.sonatypeRepo("snapshots"),
docMappingsApiDir := "api"
)
lazy val allSettings = baseSettings ++ publishSettings
lazy val root = project
.in(file("."))
.enablePlugins(GhpagesPlugin, ScalaUnidocPlugin)
.settings(allSettings ++ noPublishSettings)
.settings(
unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(benchmark),
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), docMappingsApiDir),
git.remoteRepo := "[email protected]:travisbrown/catbird.git"
)
.settings(
initialCommands in console :=
"""
|import com.twitter.finagle._
|import com.twitter.util._
|import io.catbird.finagle._
|import io.catbird.util._
""".stripMargin
)
.aggregate(util, effect, finagle, benchmark)
.dependsOn(util, effect, finagle)
lazy val util = project
.settings(moduleName := "catbird-util")
.settings(allSettings)
.settings(
libraryDependencies += "com.twitter" %% "util-core" % utilVersion,
scalacOptions in Test ~= {
_.filterNot(Set("-Yno-imports", "-Yno-predef"))
}
)
lazy val effect = project
.settings(moduleName := "catbird-effect")
.settings(allSettings)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"org.typelevel" %% "cats-effect-laws" % catsEffectVersion % Test
),
scalacOptions in Test ~= {
_.filterNot(Set("-Yno-imports", "-Yno-predef"))
}
)
.dependsOn(util, util % "test->test")
lazy val finagle = project
.settings(moduleName := "catbird-finagle")
.settings(allSettings)
.settings(
libraryDependencies += "com.twitter" %% "finagle-core" % finagleVersion,
scalacOptions in Test ~= {
_.filterNot(Set("-Yno-imports", "-Yno-predef"))
}
)
.dependsOn(util)
lazy val benchmark = project
.settings(moduleName := "catbird-benchmark")
.settings(allSettings)
.settings(noPublishSettings)
.settings(
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8",
scalacOptions ~= {
_.filterNot(Set("-Yno-imports", "-Yno-predef"))
}
)
.enablePlugins(JmhPlugin)
.dependsOn(util)
lazy val publishSettings = Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
homepage := Some(url("https://github.com/travisbrown/catbird")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
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,
apiURL := Some(url("https://travisbrown.github.io/catbird/api/")),
scmInfo := Some(
ScmInfo(
url("https://github.com/travisbrown/catbird"),
"scm:git:[email protected]:travisbrown/catbird.git"
)
),
pomExtra := (
<developers>
<developer>
<id>travisbrown</id>
<name>Travis Brown</name>
<url>https://twitter.com/travisbrown</url>
</developer>
</developers>
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
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