-
Notifications
You must be signed in to change notification settings - Fork 155
/
Build.scala
172 lines (153 loc) · 5.06 KB
/
Build.scala
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
package chill
import sbt._
import Keys._
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys._
import scala.collection.JavaConverters._
object ChillBuild extends Build {
val kryoVersion = "2.22"
val sharedSettings = Project.defaultSettings ++ mimaDefaultSettings ++ Seq(
version := "0.3.4",
organization := "com.twitter",
scalaVersion := "2.9.3",
crossScalaVersions := Seq("2.9.3", "2.10.0"),
scalacOptions ++= Seq("-unchecked", "-deprecation"),
// Twitter Hadoop needs this, sorry 1.7 fans
javacOptions ++= Seq("-target", "1.6", "-source", "1.6", "-Xlint:-options"),
javacOptions in doc := Seq("-source", "1.6"),
resolvers ++= Seq(
Opts.resolver.sonatypeSnapshots,
Opts.resolver.sonatypeReleases
),
libraryDependencies ++= Seq(
"org.scalacheck" %% "scalacheck" % "1.10.0" % "test",
"org.scala-tools.testing" %% "specs" % "1.6.9" % "test",
"com.esotericsoftware.kryo" % "kryo" % kryoVersion
),
parallelExecution in Test := true,
// Publishing options:
publishMavenStyle := true,
publishTo <<= version { v =>
Some(
if (v.trim.toUpperCase.endsWith("SNAPSHOT"))
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
)
},
publishArtifact in Test := false,
pomIncludeRepository := { x => false },
pomExtra := (
<url>https://github.com/twitter/chill</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>git@github.com:twitter/chill.git</url>
<connection>scm:git:git@github.com:twitter/chill.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>
</developers>)
)
// Aggregated project
lazy val chillAll = Project(
id = "chill-all",
base = file("."),
settings = sharedSettings
).settings(
test := { },
publish := { },
publishLocal := { }
).aggregate(
chill,
chillBijection,
chillStorm,
chillJava,
chillHadoop
)
/**
* This returns the youngest jar we released that is compatible
* with the current.
*/
val unreleasedModules = Set[String]("akka")
val javaOnly = Set[String]("storm", "java", "hadoop")
def youngestForwardCompatible(subProj: String) =
Some(subProj)
.filterNot(unreleasedModules.contains(_))
.map { s =>
val suffix = if (javaOnly.contains(s)) "" else "_2.9.3"
"com.twitter" % ("chill-" + s + suffix) % "0.3.2"
}
def module(name: String) = {
val id = "chill-%s".format(name)
Project(id = id, base = file(id), settings = sharedSettings ++ Seq(
Keys.name := id,
previousArtifact := youngestForwardCompatible(name))
)
}
// We usually do the pattern of having a core module, but we don't want to cause
// pain for legacy deploys. With this, they can stay the same.
lazy val chill = Project(
id = "chill",
base = file("chill-scala"),
settings = sharedSettings
).settings(
name := "chill",
previousArtifact := Some("com.twitter" % "chill_2.9.3" % "0.3.3"),
libraryDependencies ++= Seq(
"org.ow2.asm" % "asm-commons" % "4.0"
)
).dependsOn(chillJava)
lazy val chillAkka = module("akka").settings(
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "0.3.1",
"com.typesafe.akka" % "akka-actor" % "2.0.5"
)
).dependsOn(chill % "test->test;compile->compile")
lazy val chillBijection = module("bijection").settings(
libraryDependencies ++= Seq(
"com.twitter" %% "bijection-core" % "0.5.2"
)
).dependsOn(chill % "test->test;compile->compile")
// This can only have java deps!
lazy val chillJava = module("java").settings(
crossPaths := false,
autoScalaLibrary := false
)
// This can only have java deps!
lazy val chillStorm = module("storm").settings(
crossPaths := false,
autoScalaLibrary := false,
resolvers ++= Seq(
"Clojars Repository" at "http://clojars.org/repo",
"Conjars Repository" at "http://conjars.org/repo"
),
libraryDependencies += "storm" % "storm" % "0.9.0-wip9" % "provided"
).dependsOn(chillJava)
// This can only have java deps!
lazy val chillHadoop = module("hadoop").settings(
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-core" % "0.20.2" % "provided",
"org.slf4j" % "slf4j-api" % "1.6.6",
"org.slf4j" % "slf4j-log4j12" % "1.6.6" % "provided"
)
).dependsOn(chillJava)
}