-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.sbt
More file actions
270 lines (243 loc) · 8.16 KB
/
Copy pathbuild.sbt
File metadata and controls
270 lines (243 loc) · 8.16 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
import Dependencies._
import RemoteDepHelper._
def MyVersion: String = "0.9.20"
// keep Maven Central happy
developers in ThisBuild := List(
Developer(
id = "cunei",
name = "Antonio Cunei",
email = "antonio.cunei@typesafe.com",
url = url("https://www.lightbend.com")
),
Developer(
id = "SethTisue",
name = "Seth Tisue",
email = "seth.tisue@lightbend.com",
url = url("https://www.lightbend.com")
))
homepage in ThisBuild := Some(url("http://lightbend-labs.github.io/dbuild/"))
scmInfo in ThisBuild := Some(
ScmInfo(
url("https://github.com/lightbend-labs/dbuild"),
"scm:git:git@github.com:lightbend-labs/dbuild.git")
)
def SubProj(name: String) = (
Project(name, file(if (name=="root") "." else name))
configs( IntegrationTest )
settings( Defaults.itSettings : _*)
settings(
version := MyVersion,
organization := "com.typesafe.dbuild",
selectScalaVersion,
resolvers += Resolver.typesafeIvyRepo("releases"),
resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/",
licenses += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0")),
publishTo := sonatypePublishTo.value
)
dependsOnRemote(specs2 _, jline)
)
def skip212 = Seq(
skip in compile := scalaVersion.value.startsWith("2.12"),
publish := Def.taskDyn {
val p = publish.taskValue
if (scalaVersion.value.startsWith("2.12")) Def.task {} else Def.task(p.value)
}.value,
publishLocal := Def.taskDyn {
val p = publishLocal.taskValue
if (scalaVersion.value.startsWith("2.12")) Def.task {} else Def.task(p.value)
}.value,
sources in doc in Compile :=
{
val theSources = (sources in doc in Compile).value
if((skip in compile).value) List() else theSources
}
)
def selectScalaVersion =
scalaVersion := {
val sb = (sbtVersion in pluginCrossBuild).value
if (sb.startsWith("0.13")) "2.10.7" else "2.12.6"
}
lazy val root = (
SubProj("root")
aggregate(adapter, graph, hashing, logging, actorLogging, proj, actorProj, deploy, http,
core, plugin, build, support, supportGit, repo, metadata, docs, dist, indexmeta)
settings(publish := Def.task {}, publishLocal := Def.task {}, version := MyVersion)
settings(crossSbtVersions := Seq("0.13.18", "1.2.1"), selectScalaVersion)
)
// This subproject only has dynamically
// generated source files, used to adapt
// the source file to sbt 0.13/1.0
lazy val adapter = (
SubProj("adapter")
dependsOnSbtProvided(sbtLogging, sbtIo, dbuildLaunchInt, sbtIvy, sbtSbt)
dependsOnSbtProvidedOpt(zincIf212 _)
settings(sourceGenerators in Compile += task {
val dir = (sourceManaged in Compile).value
val fileName = "Default.scala"
val file = dir / fileName
val sv = scalaVersion.value
val v = (sbtVersion in pluginCrossBuild).value
if(!dir.isDirectory) dir.mkdirs()
IO.write(file, (
"""
package com.typesafe.dbuild.adapter
object Defaults {
val version = "%s"
val org = "%s"
val hash = "%s"
val scalaVersion = "%s"
val sbtVersion = "%s"
}
""" format (version.value, organization.value, scala.sys.process.Process("git log --pretty=format:%H -n 1").lines.head, sv, v))
)
Seq(file)
})
)
lazy val graph = (
SubProj("graph")
)
lazy val hashing = (
SubProj("hashing")
dependsOnRemote(typesafeConfig)
)
lazy val indexmeta = (
SubProj("indexmeta")
)
lazy val logging = (
SubProj("logging")
dependsOn(adapter,graph)
dependsOnSbtProvided(sbtLogging, sbtIo, sbtCommand, dbuildLaunchInt)
)
lazy val actorLogging = (
SubProj("actorLogging")
dependsOn(logging)
dependsOnRemote(akkaActor _)
dependsOnSbtProvided(sbtLogging, sbtIo, dbuildLaunchInt)
settings(skip212:_*)
)
lazy val metadata = (
SubProj("metadata")
dependsOn(graph, hashing, indexmeta, deploy)
dependsOnRemote(jackson, typesafeConfig, commonsLang, jacks)
)
lazy val repo = (
SubProj("repo")
dependsOn(http, adapter, metadata, logging)
dependsOnRemote(mvnAether, aether, aetherApi, aetherSpi, aetherUtil, aetherImpl, aetherConnectorBasic, aetherFile, aetherHttp, aetherWagon, mvnAether)
dependsOnSbtProvided(sbtIo, dbuildLaunchInt, sbtLogging, sbtSbt)
)
lazy val http = (
SubProj("http")
dependsOn(adapter)
dependsOnRemote(dispatch _)
dependsOnSbtProvided(sbtIo, sbtIvy, sbtSbt)
)
lazy val core = (
SubProj("core")
dependsOnRemote(javaMail)
dependsOn(adapter,metadata, graph, hashing, logging, repo)
dependsOnSbtProvided(sbtIo, sbtLogging)
)
lazy val proj = (
SubProj("proj")
dependsOn(core, repo, logging)
dependsOnRemote(javaMail, commonsIO)
dependsOnSbtProvided(sbtIo, sbtIvy, sbtSbt, sbtLogging, dbuildLaunchInt)
)
lazy val actorProj = (
SubProj("actorProj")
dependsOn(core, actorLogging, proj)
dependsOnSbtProvided(sbtIo, sbtIvy)
settings(skip212:_*)
)
lazy val support = (
SubProj("support")
dependsOn(core, repo, metadata, proj % "compile->compile;it->compile", logging % "it")
dependsOnRemote(mvnEmbedder, mvnWagon, javaMail, aether, aetherApi, aetherSpi, aetherUtil,
aetherImpl, aetherConnectorBasic, aetherFile, aetherHttp, slf4jSimple, ivy)
dependsOnSbtProvided(dbuildLaunchInt, sbtIvy)
dependsOnSbtProvidedIt(sbtSbt)
settings(SbtSupport.buildSettings:_*)
settings(SbtSupport.settings:_*)
settings(
// We hook the testLoader of it to make sure all the it tasks have a legit sbt plugin to use.
// Technically, this just pushes every project. We could outline just the plugin itself, but for now
// we don't care that much.
testLoader in IntegrationTest := {
val ignore = publishLocal.all(ScopeFilter(inAggregates(LocalRootProject, includeRoot=false))).value
(testLoader in IntegrationTest).value
},
parallelExecution in IntegrationTest := false
)
)
// A separate support project for git/jgit
lazy val supportGit = (
SubProj("supportGit")
dependsOn(core, repo, metadata, proj, support)
dependsOnRemote(mvnEmbedder, mvnWagon, javaMail, jgit)
dependsOnSbtProvided(dbuildLaunchInt, sbtIvy)
settings(skip212:_*)
)
// SBT plugin
lazy val plugin = (
SubProj("plugin")
settings(sbtPlugin := true)
dependsOn(adapter, support, metadata)
dependsOnRemote(oro)
dependsOnSbtProvided(sbtIo)
)
lazy val dist = (
SubProj("dist")
enablePlugins(UniversalPlugin)
settings(Packaging.settings(build,repo):_*)
settings(skip212:_*)
)
lazy val deploy = (
SubProj("deploy")
dependsOn(adapter, http)
dependsOnRemote(jackson, typesafeConfig, commonsLang, aws, uriutil, commonsIO, jsch, jacks)
dependsOnSbtProvided(sbtLogging, sbtIo, sbtSbt)
)
lazy val build = (
SubProj("build")
dependsOn(actorProj, support, supportGit, repo, metadata, deploy, proj)
dependsOnRemote(aws, uriutil, jsch, oro, scallop, commonsLang)
dependsOnRemote(gpgLibIf210 _)
dependsOnSbt(dbuildLaunchInt, sbtLogging, sbtIo, sbtIvy, sbtSbt, dbuildLauncher)
settings(skip212:_*)
settings(SbtSupport.settings:_*)
settings(
// We hook the testLoader of it to make sure all the it tasks have a legit sbt plugin to use.
// Technically, this just pushes every project. We could outline just the plugin itself, but for now
// we don't care that much.
testLoader in IntegrationTest := {
val ignore = publishLocal.all(ScopeFilter(inAggregates(LocalRootProject, includeRoot=false))).value
(testLoader in IntegrationTest).value
},
parallelExecution in IntegrationTest := false
)
)
lazy val docs = (
SubProj("docs")
enablePlugins(GhpagesPlugin, SphinxPlugin)
settings(
enableOutput in generatePdf in Sphinx := false,
enableOutput in generateEpub in Sphinx := false,
git.remoteRepo := "git@github.com:lightbend/dbuild.git",
ghpagesSynchLocal := {
val maps = (mappings in ghpagesSynchLocal).value
val repo = ghpagesUpdatedRepository.value
val v = version.value
val snap = isSnapshot.value
val log = streams.value.log
DocsSupport.synchLocalImpl(maps, repo, v, snap, log)
},
publish := (),
publishLocal := (),
skip in compile := true,
makeSite := makeSite.dependsOn(sbt.Def.task {
val file = (siteSourceDirectory in Sphinx).value / "version.py"
IO.write(file, ("release = '%s'\n" format (version.value)))
}).value
)
)