-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathbuild.sbt
More file actions
183 lines (161 loc) · 5.54 KB
/
build.sbt
File metadata and controls
183 lines (161 loc) · 5.54 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
import ReleaseTransformations._
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform._
val avroVersion = "1.7.5"
val bijectionVersion = "0.9.5"
val chillVersion = "0.8.3"
val scalacheckVersion = "1.13.4"
val scalaTestVersion = "3.0.1"
val slf4jVersion = "1.6.6"
val stormVersion = "1.0.2"
val twitter4jVersion = "3.0.3"
val extraSettings = mimaDefaultSettings ++ scalariformSettings
def ciSettings: Seq[Def.Setting[_]] =
if (sys.env.getOrElse("TRAVIS", "false").toBoolean) Seq(
ivyLoggingLevel := UpdateLogging.Quiet,
logLevel in Global := Level.Warn,
logLevel in Compile := Level.Warn,
logLevel in Test := Level.Info
) else Seq.empty[Def.Setting[_]]
val sharedSettings = extraSettings ++ ciSettings ++ Seq(
organization := "com.twitter",
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.1"),
javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
javacOptions in doc := Seq("-source", "1.6"),
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % slf4jVersion,
"org.apache.storm" % "storm-core" % stormVersion % "provided",
"org.scalacheck" %% "scalacheck" % scalacheckVersion % "test",
"org.scalatest" %% "scalatest" % scalaTestVersion % "test"
),
scalacOptions ++= Seq("-unchecked", "-deprecation", "-Yresolve-term-conflict:package"),
resolvers ++= Seq(
Opts.resolver.sonatypeSnapshots,
Opts.resolver.sonatypeReleases
),
parallelExecution in Test := false,
scalacOptions ++= Seq("-unchecked", "-deprecation", "-language:implicitConversions", "-language:higherKinds", "-language:existentials"),
scalacOptions ++= (if (scalaVersion.value startsWith "2.10")
Seq("-Xdivergence211")
else
Seq()),
// 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,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges),
publishTo := Some(
if (version.value.trim.toUpperCase.endsWith("SNAPSHOT"))
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
pomExtra := (
<url>https://github.com/twitter/tormenta</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/tormenta.git</url>
<connection>scm:git:git@github.com:twitter/tormenta.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>)
)
lazy val formattingPreferences = {
import scalariform.formatter.preferences._
FormattingPreferences().
setPreference(AlignParameters, false).
setPreference(PreserveSpaceBeforeArguments, true)
}
/**
* 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" % ("tormenta-" + s + "_2.10") % "0.12.0" }
/**
* Empty this each time we publish a new version (and bump the minor number)
*/
val ignoredABIProblems = {
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters._
Seq(
)
}
lazy val noPublishSettings = Seq(
publish := (),
publishLocal := (),
test := (),
publishArtifact := false
)
lazy val tormenta = Project(
id = "tormenta",
base = file("."),
settings = sharedSettings)
.settings(noPublishSettings)
.aggregate(
tormentaCore,
tormentaKafka,
tormentaTwitter,
tormentaAvro
)
def module(name: String) = {
val id = "tormenta-%s".format(name)
Project(id = id, base = file(id), settings = sharedSettings ++ Seq(
Keys.name := id,
mimaPreviousArtifacts := youngestForwardCompatible(name).toSet,
mimaBinaryIssueFilters ++= ignoredABIProblems
))
}
lazy val tormentaCore = module("core").settings(
libraryDependencies += "com.twitter" %% "chill" % chillVersion
exclude("com.esotericsoftware.kryo", "kryo")
)
lazy val tormentaTwitter = module("twitter").settings(
libraryDependencies += "org.twitter4j" % "twitter4j-stream" % twitter4jVersion
).dependsOn(tormentaCore % "test->test;compile->compile")
lazy val tormentaKafka = module("kafka").settings(
libraryDependencies += "org.apache.storm" % "storm-kafka" % stormVersion
).dependsOn(tormentaCore % "test->test;compile->compile")
lazy val tormentaAvro = module("avro").settings(
libraryDependencies ++= Seq(
"org.apache.avro" % "avro" % avroVersion,
"com.twitter" %% "bijection-core" % bijectionVersion,
"com.twitter" %% "bijection-avro" % bijectionVersion)
).dependsOn(tormentaCore % "test->test;compile->compile")