forked from http4s/blaze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
87 lines (76 loc) · 2.53 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
import BlazePlugin._
/* Global Build Settings */
organization in ThisBuild := "org.http4s"
lazy val commonSettings = Seq(
version := "0.14.0-SNAPSHOT",
description := "NIO Framework for Scala",
crossScalaVersions := Seq("2.11.11", scalaVersion.value),
scalacOptions in (Compile, doc) ++= Seq("-no-link-warnings") // Suppresses problems with Scaladoc @throws links
// as discussed in http://www.scala-archive.org/Scaladoc-2-11-quot-throws-tag-quot-cannot-find-any-member-to-link-td4641850.html
)
/* Projects */
lazy val blaze = project.in(file("."))
.enablePlugins(DisablePublishingPlugin)
.settings(cancelable in Global := true)
.settings(commonSettings)
.aggregate(core, http, examples)
lazy val core = Project("blaze-core", file("core"))
.enablePlugins(BuildInfoPlugin)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(log4s),
libraryDependencies ++= Seq(
specs2,
specs2Mock,
logbackClassic
).map(_ % Test),
buildInfoPackage := "org.http4s.blaze",
buildInfoKeys := Seq[BuildInfoKey](
version,
scalaVersion,
git.gitHeadCommit
),
buildInfoOptions += BuildInfoOption.BuildTime
)
lazy val http = Project("blaze-http", file("http"))
.settings(commonSettings)
.settings(
// General Dependencies
libraryDependencies ++= Seq(
http4sWebsocket,
twitterHPACK,
alpn_api
),
// Version Specific Dependencies
libraryDependencies ++= {
VersionNumber(scalaBinaryVersion.value).numbers match {
case Seq(2, 10) => Seq.empty
case _ => Seq(scalaXml)
}
},
// Test Dependencies
libraryDependencies ++= Seq(
asyncHttpClient,
scalacheck,
specs2Scalacheck
).map(_ % Test)
).dependsOn(core % "test->test;compile->compile")
lazy val examples = Project("blaze-examples",file("examples"))
.enablePlugins(DisablePublishingPlugin)
.settings(commonSettings)
.settings(Revolver.settings)
.settings(
// necessary to add ALPN classes to boot classpath
fork := true,
// Adds ALPN to the boot classpath for Http2 support
libraryDependencies += alpn_boot,
javaOptions in run ++= addAlpnPath((managedClasspath in Runtime).value)
).dependsOn(http)
/* Helper Functions */
def addAlpnPath(attList: Keys.Classpath): Seq[String] = {
for {
file <- attList.map(_.data)
path = file.getAbsolutePath if path.contains("jetty.alpn")
} yield { println(s"Alpn path: $path"); "-Xbootclasspath/p:" + path}
}
addCommandAlias("validate", ";test ;mimaReportBinaryIssues")