-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.sbt
139 lines (123 loc) · 4.27 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
name := "featherbed"
import sbtunidoc.Plugin.UnidocKeys._
import com.typesafe.sbt.SbtGhPages.GhPagesKeys._
enablePlugins(TutPlugin)
lazy val buildSettings = Seq(
organization := "io.github.finagle",
version := "0.3.3",
scalaVersion := "2.12.2",
crossScalaVersions := Seq("2.11.11", "2.12.2")
)
val finagleVersion = "17.12.0"
val shapelessVersion = "2.3.3"
val catsVersion = "1.0.1"
lazy val docSettings = Seq(
autoAPIMappings := true
)
lazy val baseSettings = docSettings ++ Seq(
libraryDependencies ++= Seq(
"com.twitter" %% "finagle-http" % finagleVersion,
"com.chuusai" %% "shapeless" % shapelessVersion,
"org.typelevel" %% "cats-core" % catsVersion,
"org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % "test",
"org.scalatest" %% "scalatest" % "3.0.3" % "test"
),
resolvers += Resolver.sonatypeRepo("snapshots"),
dependencyUpdatesFailBuild := false,
dependencyUpdatesExclusions := moduleFilter("org.scala-lang")
)
lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact := true,
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")
},
publishArtifact in Test := false,
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://finagle.github.io/featherbed/")),
autoAPIMappings := true,
scmInfo := Some(
ScmInfo(
url("https://github.com/finagle/featherbed"),
"scm:git:[email protected]:finagle/featherbed.git"
)
),
pomExtra :=
<developers>
<developer>
<id>jeremyrsmith</id>
<name>Jeremy Smith</name>
<url>https://github.com/jeremyrsmith</url>
</developer>
</developers>
)
lazy val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val allSettings = publishSettings ++ baseSettings ++ buildSettings
lazy val `featherbed-core` = project
.settings(allSettings)
lazy val `featherbed-circe` = project
.settings(allSettings)
.dependsOn(`featherbed-core`)
val scaladocVersionPath = settingKey[String]("Path to this version's ScalaDoc")
val scaladocLatestPath = settingKey[String]("Path to latest ScalaDoc")
val tutPath = settingKey[String]("Path to tutorials")
lazy val docs: Project = project
.enablePlugins(TutPlugin)
.settings(
allSettings ++ ghpages.settings ++ Seq(
scaladocVersionPath := ("api/" + version.value),
scaladocLatestPath := (if (isSnapshot.value) "api/latest-snapshot" else "api/latest"),
tutPath := "doc",
includeFilter in makeSite := (includeFilter in makeSite).value || "*.md" || "*.yml",
addMappingsToSiteDir(tut, tutPath),
addMappingsToSiteDir(mappings in (featherbed, ScalaUnidoc, packageDoc), scaladocLatestPath),
addMappingsToSiteDir(mappings in (featherbed, ScalaUnidoc, packageDoc), scaladocVersionPath),
ghpagesNoJekyll := false,
git.remoteRepo := "[email protected]:finagle/featherbed",
scalacOptions in Tut := (
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, p)) if p >= 12 => Seq("-Yrepl-class-based")
case _ => Nil
}
)
)
).dependsOn(`featherbed-core`, `featherbed-circe`)
lazy val featherbed = project
.in(file("."))
.settings(unidocSettings ++ baseSettings ++ buildSettings ++ publishSettings)
.aggregate(`featherbed-core`, `featherbed-circe`)
.dependsOn(`featherbed-core`, `featherbed-circe`)
.settings(
initialCommands in console :=
"""
|import com.twitter.util.{Await, Future}
|import com.twitter.finagle.{Service, Http}
|import com.twitter.finagle.http.{Request, Response, Method}
|import java.net.{InetSocketAddress, URL}
|import shapeless.Coproduct
|import featherbed._
|import featherbed.circe._
|import io.circe.generic.auto._
""".stripMargin
)
val validateCommands = List(
"dependencyUpdates",
"clean",
"scalastyle",
"test:scalastyle",
"compile",
"test:compile",
"coverage",
"test",
"docs/tut",
"coverageReport"
)
addCommandAlias("validate", validateCommands.mkString(";", ";", ""))