forked from http4s/rho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
165 lines (148 loc) · 4.51 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
import sbt._
import Keys._
import spray.revolver.RevolverPlugin._
import com.typesafe.sbt.SbtGit.git
import scala.util.Properties.envOrNone
import Dependencies._, RhoPlugin._
lazy val rho = project
.in(file("."))
.settings(buildSettings: _*)
.aggregate(`rho-core`, `rho-hal`, `rho-swagger`, `rho-examples`)
lazy val `rho-core` = project
.in(file("core"))
.settings(buildSettings: _*)
lazy val `rho-hal` = project
.in(file("hal"))
.settings(buildSettings :+ halDeps: _*)
.dependsOn(`rho-core`)
lazy val `rho-swagger` = project
.in(file("swagger"))
.settings(buildSettings :+ swaggerDeps: _*)
.dependsOn(`rho-core` % "compile->compile;test->test")
lazy val docs = project
.in(file("docs"))
.settings(buildSettings)
.enablePlugins(ScalaUnidocPlugin)
.enablePlugins(SiteScaladocPlugin)
.enablePlugins(GhpagesPlugin)
.settings(Seq(
dontPublish,
description := "Api Documentation",
autoAPIMappings := true,
scalacOptions in Compile := scaladocOptions(
(baseDirectory in ThisBuild).value,
version.value,
apiVersion.value
),
scalacOptions in (ScalaUnidoc, unidoc) += "-Ypartial-unification",
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(
`rho-core`,
`rho-hal`,
`rho-swagger`
),
git.remoteRepo := "[email protected]:http4s/rho.git",
ghpagesCleanSite := VersionedGhPages.cleanSite0.value,
ghpagesSynchLocal := VersionedGhPages.synchLocal0.value,
mappings in makeSite := {
val (major, minor) = apiVersion.value
for {
(f, d) <- (mappings in (ScalaUnidoc, packageDoc)).value
} yield (f, s"api/$major.$minor/$d")
}
))
.dependsOn(`rho-core`, `rho-hal`, `rho-swagger`)
lazy val `rho-examples` = project
.in(file("examples"))
.settings(
buildSettings ++
Revolver.settings ++
Seq(
exampleDeps,
libraryDependencies ++= Seq(logbackClassic, http4sXmlInstances),
dontPublish
): _*)
.dependsOn(`rho-swagger`, `rho-hal`)
lazy val compileFlags = Seq(
"-feature",
"-deprecation",
"-unchecked",
"-language:higherKinds",
"-language:existentials",
"-language:implicitConversions",
"-Ywarn-unused",
"-Ypartial-unification",
"-Xfatal-warnings"
)
/* Don't publish setting */
lazy val dontPublish = packagedArtifacts := Map.empty
lazy val license = licenses in ThisBuild := Seq(
"Apache License, Version 2.0" -> url(
"http://www.apache.org/licenses/LICENSE-2.0.txt")
)
lazy val buildSettings = publishing ++
Seq(
scalaVersion := "2.12.6",
crossScalaVersions := Seq(scalaVersion.value, "2.11.12"),
scalacOptions ++= compileFlags,
resolvers += Resolver.sonatypeRepo("snapshots"),
fork in run := true,
organization in ThisBuild := "org.http4s",
homepage in ThisBuild := Some(url(homepageUrl)),
description := "A self documenting DSL build upon the http4s framework",
license,
libraryDependencies ++= Seq(
shapeless,
http4sServer % "provided",
logbackClassic % "test"
),
libraryDependencies ++= specs2,
libraryDependencies += `scala-reflect` % scalaVersion.value
)
// to keep REPL usable
scalacOptions in (Compile, console) --= Seq("-Ywarn-unused:imports", "-Xfatal-warnings")
lazy val publishing = Seq(
extras,
credentials ++= travisCredentials.toSeq,
publishMavenStyle in ThisBuild := true,
publishArtifact in (ThisBuild, Test) := false,
// Don't publish root pom. It's not needed.
packagedArtifacts in LocalRootProject := Map.empty,
publishArtifact in Test := false,
publishTo in ThisBuild := Some(nexusRepoFor(version.value)),
scmInfo in ThisBuild := {
val base = "github.com/http4s/rho"
Some(
ScmInfo(url(s"https://$base"),
s"scm:git:https://$base",
Some(s"scm:git:git@$base")))
}
)
lazy val travisCredentials =
(envOrNone("SONATYPE_USERNAME"), envOrNone("SONATYPE_PASSWORD")) match {
case (Some(user), Some(pass)) =>
Some(
Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
user,
pass))
case _ =>
None
}
lazy val extras = pomExtra in ThisBuild := (
<developers>
<developer>
<id>brycelane</id>
<name>Bryce L. Anderson</name>
<email>[email protected]</email>
</developer>
<developer>
<id>before</id>
<name>André Rouél</name>
</developer>
<developer>
<id>rossabaker</id>
<name>Ross A. Baker</name>
<email>[email protected]</email>
</developer>
</developers>
)