forked from akka/akka-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
191 lines (172 loc) · 6.97 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
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
import akka._
import AkkaDependency._
import akka.ValidatePullRequest._
import sbtdynver.GitDescribeOutput
import com.typesafe.sbt.SbtGit.GitKeys._
inThisBuild(Def.settings(
organization := "com.typesafe.akka",
organizationName := "Lightbend",
organizationHomepage := Some(url("https://www.lightbend.com")),
homepage := Some(url("http://akka.io")),
// https://github.com/dwijnand/sbt-dynver/issues/23
isSnapshot := { isSnapshot.value || hasCommitsAfterTag(dynverGitDescribeOutput.value) },
apiURL := {
val apiVersion = if (isSnapshot.value) "current" else version.value
Some(url(s"http://doc.akka.io/api/akka-http/$apiVersion/"))
},
scmInfo := Some(
ScmInfo(url("https://github.com/akka/akka-http"), "[email protected]:akka/akka-http.git")),
developers := List(
Developer("contributors", "Contributors", "[email protected]",
url("https://github.com/akka/akka-http/graphs/contributors"))
),
startYear := Some(2014),
// test in assembly := {},
licenses := Seq("Apache-2.0" -> url("https://opensource.org/licenses/Apache-2.0")),
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-unchecked",
"-Xlint",
// "-Yno-adapted-args", //akka-http heavily depends on adapted args and => Unit implicits break otherwise
"-Ywarn-dead-code"
// "-Xfuture" // breaks => Unit implicits
),
javacOptions ++= Seq(
"-encoding", "UTF-8"
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
Dependencies.Versions,
Formatting.formatSettings,
shellPrompt := { s => Project.extract(s).currentProject.id + " > " }
))
lazy val root = Project(
id = "akka-http-root",
base = file(".")
)
.enablePlugins(UnidocRoot, NoPublish, DeployRsync)
.disablePlugins(BintrayPlugin, MimaPlugin)
.settings(
// Unidoc doesn't like macros
unidocProjectExcludes := Seq(parsing),
deployRsyncArtifact :=
(sbtunidoc.Plugin.UnidocKeys.unidoc in Compile).value zip Seq(s"www/api/akka-http/${version.value}", s"www/japi/akka-http/${version.value}")
)
.aggregate(
parsing,
httpCore,
http2Support,
http,
httpTestkit,
httpTests,
httpMarshallersScala,
httpMarshallersJava,
docs
)
lazy val parsing = project("akka-parsing")
.settings(Dependencies.parsing)
.settings(
scalacOptions := scalacOptions.value.filterNot(_ == "-Xfatal-warnings")
)
.addAkkaModuleDependency("akka-actor")
lazy val httpCore = project("akka-http-core")
.settings(Dependencies.httpCore)
.settings(Version.versionSettings)
.dependsOn(parsing)
.addAkkaModuleDependency("akka-stream")
.addAkkaModuleDependency("akka-stream-testkit", "test")
lazy val http = project("akka-http")
.dependsOn(httpCore)
lazy val http2Support = project("akka-http2-support")
.enablePlugins(JavaAgent)
.disablePlugins(MimaPlugin) // experimental module still
.settings(javaAgents += Dependencies.Compile.Test.alpnAgent)
.dependsOn(httpCore, httpTestkit % "test", httpCore % "test->test")
.addAkkaModuleDependency("akka-stream-testkit", "test")
lazy val httpTestkit = project("akka-http-testkit")
.settings(Dependencies.httpTestkit)
.dependsOn(http)
.addAkkaModuleDependency("akka-stream-testkit")
lazy val httpTests = project("akka-http-tests")
.settings(Dependencies.httpTests)
.dependsOn(httpSprayJson, httpXml, httpJackson,
httpTestkit % "test", httpCore % "test->test")
.enablePlugins(NoPublish).disablePlugins(BintrayPlugin) // don't release tests
.enablePlugins(MultiNode)
.disablePlugins(MimaPlugin) // this is only tests
.configs(MultiJvm)
.addAkkaModuleDependency("akka-multi-node-testkit", "test")
lazy val httpMarshallersScala = project("akka-http-marshallers-scala")
.enablePlugins(NoPublish)
.disablePlugins(BintrayPlugin, MimaPlugin)
.aggregate(httpSprayJson, httpXml)
lazy val httpXml =
httpMarshallersScalaSubproject("xml")
lazy val httpSprayJson =
httpMarshallersScalaSubproject("spray-json")
lazy val httpMarshallersJava = project("akka-http-marshallers-java")
.enablePlugins(NoPublish)
.disablePlugins(BintrayPlugin, MimaPlugin)
.aggregate(httpJackson)
lazy val httpJackson =
httpMarshallersJavaSubproject("jackson")
def project(name: String) =
Project(id = name, base = file(name))
def httpMarshallersScalaSubproject(name: String) =
Project(
id = s"akka-http-$name",
base = file(s"akka-http-marshallers-scala/akka-http-$name"),
dependencies = Seq(http)
)
def httpMarshallersJavaSubproject(name: String) =
Project(
id = s"akka-http-$name",
base = file(s"akka-http-marshallers-java/akka-http-$name"),
dependencies = Seq(http)
)
lazy val docs = project("docs")
.enablePlugins(AkkaParadoxPlugin, NoPublish, DeployRsync)
.disablePlugins(BintrayPlugin, MimaPlugin)
.dependsOn(
httpCore, http, httpXml, http2Support, httpMarshallersJava, httpMarshallersScala,
httpTests % "compile;test->test", httpTestkit % "compile;test->test"
)
.settings(Dependencies.docs)
.settings(
name := "akka-http-docs",
resolvers += Resolver.jcenterRepo,
paradoxGroups := Map("Languages" -> Seq("Scala", "Java")),
paradoxProperties in Compile ++= Map(
"project.name" -> "Akka HTTP",
"akka.version" -> Dependencies.akkaVersion.value,
"akka25.version" -> Dependencies.akka25Version,
"scala.binary_version" -> scalaBinaryVersion.value, // to be consistent with Akka build
"scala.binaryVersion" -> scalaBinaryVersion.value,
"scaladoc.version" -> scalaVersion.value,
"crossString" -> (scalaVersion.value match {
case akka.Doc.BinVer(_) => ""
case _ => "cross CrossVersion.full"
}),
"jackson.version" -> Dependencies.jacksonVersion,
"extref.akka-docs.base_url" -> s"http://doc.akka.io/docs/akka/${Dependencies.akkaVersion.value}/%s",
"extref.akka25-docs.base_url" -> s"http://doc.akka.io/docs/akka/2.5/%s",
"javadoc.akka.http.base_url" -> {
val v = if (isSnapshot.value) "current" else version.value
s"http://doc.akka.io/japi/akka-http/$v"
},
"algolia.docsearch.api_key" -> "0ccbb8bf5148554a406fbf07df0a93b9",
"algolia.docsearch.index_name" -> "akka-http",
"google.analytics.account" -> "UA-21117439-1",
"google.analytics.domain.name" -> "akka.io",
"github.base_url" -> GitHub.url(version.value),
"snip.test.base_dir" -> (sourceDirectory in Test).value.getAbsolutePath,
"snip.akka-http.base_dir" -> (baseDirectory in ThisBuild).value.getAbsolutePath,
"signature.test.base_dir" -> (sourceDirectory in Test).value.getAbsolutePath,
"signature.akka-http.base_dir" -> (baseDirectory in ThisBuild).value.getAbsolutePath
),
Formatting.docFormatSettings,
additionalTasks in ValidatePR += paradox in Compile,
deployRsyncArtifact := List((paradox in Compile).value -> s"www/docs/akka-http/${version.value}")
)
def hasCommitsAfterTag(description: Option[GitDescribeOutput]): Boolean = description.get.commitSuffix.distance > 0