forked from twitter/summingbird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
370 lines (337 loc) · 12.3 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
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
import AssemblyKeys._
import ReleaseTransformations._
import com.typesafe.sbt.SbtScalariform._
import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import sbtassembly.Plugin._
import scalariform.formatter.preferences._
import summingbird._
def scalaBinaryVersion(scalaVersion: String) = scalaVersion match {
case version if version startsWith "2.10" => "2.10"
case version if version startsWith "2.11" => "2.11"
case version if version startsWith "2.12" => "2.12"
case _ => sys.error("Unsupported scala version: " + scalaVersion)
}
def isScala210x(scalaVersion: String) = scalaBinaryVersion(scalaVersion) == "2.10"
val algebirdVersion = "0.12.0"
val bijectionVersion = "0.9.1"
val chillVersion = "0.7.3"
val commonsHttpClientVersion = "3.1"
val commonsLangVersion = "2.6"
val finagleVersion = "6.27.0"
val hadoopVersion = "1.2.1"
val junitVersion = "4.11"
val log4jVersion = "1.2.16"
val novocodeJunitVersion = "0.10"
val scalaCheckVersion = "1.12.2"
val scalatestVersion = "2.2.4"
val scaldingVersion = "0.16.0-RC3"
val slf4jVersion = "1.6.6"
val storehausVersion = "0.13.0"
val stormDep = "storm" % "storm" % "0.9.0-wip15" //This project also compiles with the latest storm, which is in fact required to run the example
val tormentaVersion = "0.11.1"
val utilVersion = "6.26.0"
val extraSettings = Project.defaultSettings ++ mimaDefaultSettings ++ scalariformSettings
val sharedSettings = extraSettings ++ Seq(
organization := "com.twitter",
scalaVersion := "2.10.5",
crossScalaVersions := Seq("2.10.5", "2.11.7"),
// To support hadoop 1.x
javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
javacOptions in doc ~= { (options: Seq[String]) =>
val targetPos = options.indexOf("-target")
if(targetPos > -1) {
options.take(targetPos) ++ options.drop(targetPos + 2)
} else options
},
libraryDependencies ++= Seq(
"junit" % "junit" % junitVersion % "test",
"org.slf4j" % "slf4j-api" % slf4jVersion,
"org.scalacheck" %% "scalacheck" % scalaCheckVersion % "test",
// These satisify's scaldings log4j needs when in test mode
"log4j" % "log4j" % log4jVersion % "test",
"com.novocode" % "junit-interface" % novocodeJunitVersion % "test",
"org.scalatest" %% "scalatest" % scalatestVersion % "test"
),
resolvers ++= Seq(
Opts.resolver.sonatypeSnapshots,
Opts.resolver.sonatypeReleases,
"Clojars Repository" at "http://clojars.org/repo",
"Conjars Repository" at "http://conjars.org/repo",
"Twitter Maven" at "http://maven.twttr.com"
),
parallelExecution in Test := true,
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-Yresolve-term-conflict:package"
),
// Publishing options:
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseVersionBump := sbtrelease.Version.Bump.Minor, // need to tweak based on mima results
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { x => false },
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
// runTest, // these tests are monsters and a bit flakey. Make sure to publish only green builds!
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges),
publishTo <<= version { v =>
Some(
if (v.trim.toUpperCase.endsWith("SNAPSHOT"))
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
//"twttr" at "http://artifactory.local.twitter.com/libs-releases-local"
)
},
pomExtra := (
<url>https://github.com/twitter/summingbird</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<scm>
<url>[email protected]:twitter/summingbird.git</url>
<connection>scm:git:[email protected]:twitter/summingbird.git</connection>
</scm>
<developers>
<developer>
<id>oscar</id>
<name>Oscar Boykin</name>
<url>http://twitter.com/posco</url>
</developer>
<developer>
<id>sritchie</id>
<name>Sam Ritchie</name>
<url>http://twitter.com/sritchie</url>
</developer>
<developer>
<id>asinghal</id>
<name>Ashutosh Singhal</name>
<url>http://twitter.com/daashu</url>
</developer>
</developers>)
)
lazy val formattingPreferences = {
import scalariform.formatter.preferences._
FormattingPreferences().
setPreference(AlignParameters, false).
setPreference(PreserveSpaceBeforeArguments, true)
}
lazy val summingbird = Project(
id = "summingbird",
base = file("."),
settings = sharedSettings ++ DocGen.publishSettings
).settings(
test := { },
publish := { }, // skip publishing for this root project.
publishLocal := { }
).aggregate(
summingbirdCore,
summingbirdBatch,
summingbirdBatchHadoop,
summingbirdOnline,
summingbirdClient,
summingbirdStorm,
summingbirdStormTest,
summingbirdScalding,
summingbirdScaldingTest,
summingbirdBuilder,
summingbirdChill,
summingbirdExample,
summingbirdCoreTest
)
/**
* This returns the youngest jar we released that is compatible with
* the current.
*/
val unreleasedModules = Set[String]()
def youngestForwardCompatible(subProj: String) =
Some(subProj)
.filterNot(unreleasedModules.contains(_))
.map { s => "com.twitter" % ("summingbird-" + s + "_2.10") % "0.9.0" }
def module(name: String) = {
val id = "summingbird-%s".format(name)
Project(id = id, base = file(id), settings = sharedSettings ++ Seq(
Keys.name := id,
previousArtifact := youngestForwardCompatible(name))
)
}
lazy val summingbirdBatch = module("batch").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "scalding-date" % scaldingVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test"
)
)
lazy val summingbirdChill = module("chill").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "chill" % chillVersion,
"com.twitter" %% "chill-bijection" % chillVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test"
)
).dependsOn(
summingbirdCore,
summingbirdBatch
)
lazy val summingbirdClient = module("client").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "algebird-util" % algebirdVersion,
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "storehaus-core" % storehausVersion,
"com.twitter" %% "storehaus-algebra" % storehausVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test"
)
).dependsOn(summingbirdBatch)
lazy val summingbirdCore = module("core").settings(
libraryDependencies += "com.twitter" %% "algebird-core" % algebirdVersion
)
lazy val summingbirdOnline = module("online").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "algebird-util" % algebirdVersion,
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "storehaus-core" % storehausVersion,
"com.twitter" %% "chill" % chillVersion,
"com.twitter" %% "storehaus-algebra" % storehausVersion,
"com.twitter" %% "util-core" % utilVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test"
)
).dependsOn(
summingbirdCore % "test->test;compile->compile",
summingbirdCoreTest % "test->test",
summingbirdBatch,
summingbirdClient
)
lazy val summingbirdStorm = module("storm").settings(
parallelExecution in Test := false,
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "chill" % chillVersion,
"com.twitter" % "chill-storm" % chillVersion,
"com.twitter" %% "chill-bijection" % chillVersion,
"com.twitter" %% "storehaus-core" % storehausVersion,
"com.twitter" %% "storehaus-algebra" % storehausVersion,
"com.twitter" %% "scalding-args" % scaldingVersion,
"com.twitter" %% "tormenta-core" % tormentaVersion,
"com.twitter" %% "util-core" % utilVersion,
stormDep % "provided"
)
).dependsOn(
summingbirdCore % "test->test;compile->compile",
summingbirdOnline,
summingbirdChill,
summingbirdBatch
)
lazy val summingbirdStormTest = module("storm-test").settings(
parallelExecution in Test := false,
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "storehaus-core" % storehausVersion,
"com.twitter" %% "storehaus-algebra" % storehausVersion,
"com.twitter" %% "tormenta-core" % tormentaVersion,
"com.twitter" %% "util-core" % utilVersion,
stormDep % "provided"
)
).dependsOn(
summingbirdCore % "test->test;compile->compile",
summingbirdCoreTest % "test->test",
summingbirdStorm
)
lazy val summingbirdScalding = module("scalding").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "algebird-util" % algebirdVersion,
"com.twitter" %% "algebird-bijection" % algebirdVersion,
"com.twitter" %% "bijection-json" % bijectionVersion,
"com.twitter" %% "chill" % chillVersion,
"com.twitter" % "chill-hadoop" % chillVersion,
"com.twitter" %% "chill-bijection" % chillVersion,
"commons-lang" % "commons-lang" % commonsLangVersion,
"com.twitter" %% "scalding-core" % scaldingVersion,
"com.twitter" %% "scalding-commons" % scaldingVersion,
"org.apache.hadoop" % "hadoop-core" % hadoopVersion % "provided"
)
).dependsOn(
summingbirdCore % "test->test;compile->compile",
summingbirdChill,
summingbirdBatchHadoop,
summingbirdBatch
)
lazy val summingbirdScaldingTest = module("scalding-test").settings(
libraryDependencies ++= Seq(
"org.scalacheck" %% "scalacheck" % scalaCheckVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test",
"org.apache.hadoop" % "hadoop-core" % hadoopVersion % "provided"
)
).dependsOn(
summingbirdCore % "test->test;compile->compile",
summingbirdCoreTest % "test->test",
summingbirdChill,
summingbirdBatchHadoop,
summingbirdScalding
)
lazy val summingbirdBatchHadoop = module("batch-hadoop").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "algebird-core" % algebirdVersion,
"com.twitter" %% "bijection-json" % bijectionVersion,
"com.twitter" %% "scalding-commons" % scaldingVersion,
"com.twitter" %% "scalding-date" % scaldingVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test",
"org.apache.hadoop" % "hadoop-core" % hadoopVersion % "provided"
)
).dependsOn(
summingbirdCore % "test->test;compile->compile",
summingbirdBatch
)
lazy val summingbirdBuilder = module("builder").settings(
libraryDependencies ++= Seq(
stormDep % "provided",
"org.apache.hadoop" % "hadoop-core" % hadoopVersion % "provided"
)
).dependsOn(
summingbirdCore,
summingbirdStorm,
summingbirdScalding
)
lazy val summingbirdExample = module("example").settings(
libraryDependencies ++= Seq(
"log4j" % "log4j" % log4jVersion,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion,
stormDep exclude("org.slf4j", "log4j-over-slf4j") exclude("ch.qos.logback", "logback-classic"),
"com.twitter" %% "bijection-netty" % bijectionVersion,
"com.twitter" %% "tormenta-twitter" % tormentaVersion,
"com.twitter" %% "storehaus-memcache" % storehausVersion exclude("com.twitter.common", "dynamic-host-set") exclude("com.twitter.common", "service-thrift"),
"org.slf4j" % "slf4j-log4j12" % slf4jVersion % "test"
)
).dependsOn(summingbirdCore, summingbirdStorm)
lazy val summingbirdCoreTest = module("core-test").settings(
parallelExecution in Test := false,
libraryDependencies ++=Seq(
"junit" % "junit" % junitVersion % "provided",
"org.slf4j" % "slf4j-api" % slf4jVersion % "provided",
"org.scalacheck" %% "scalacheck" % scalaCheckVersion % "provided",
"org.scalatest" %% "scalatest" % scalatestVersion % "provided")
).dependsOn(
summingbirdCore % "test->test;compile->compile"
)