-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.sbt
171 lines (134 loc) · 5.2 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
name := "kafka-connect-cassandra"
version := "0.0.7"
crossScalaVersions := Seq("2.11.7", "2.10.6")
crossVersion := CrossVersion.binary
scalaVersion := sys.props.getOrElse("scala.version", crossScalaVersions.value.head)
organization := "com.tuplejump"
organizationHomepage := Some(new java.net.URL("http://www.tuplejump.com"))
description := "A Kafka Connect Cassandra Source and Sink connector."
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
import de.heikoseeberger.sbtheader.license.Apache2_0
de.heikoseeberger.sbtheader.HeaderPlugin.autoImport.headers := Map(
"scala" -> Apache2_0("2016", "Tuplejump"),
"conf" -> Apache2_0("2016", "Tuplejump", "#")
)
lazy val cassandra = sys.props.getOrElse("cassandra.version","3.0.0")//latest: 3.0.4
libraryDependencies ++= Seq(
"org.apache.kafka" % "connect-api" % "0.9.0.1" % "provided",
"com.datastax.cassandra" % "cassandra-driver-core" % cassandra,
"joda-time" % "joda-time" % "2.9.3",
"org.joda" % "joda-convert" % "1.8.1",
"org.scalatest" %% "scalatest" % "2.2.6" % "test,it",
"org.mockito" % "mockito-core" % "2.0.34-beta" % "test,it",
"ch.qos.logback" % "logback-classic" % "1.1.3" % "test,it",
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, minor)) if minor < 11 =>
"org.slf4j" % "slf4j-api" % "1.7.13"
case _ =>
"com.typesafe.scala-logging" %% "scala-logging" % "3.1.0"
}
)
publishMavenStyle := true
/* Compiler settings and checks, code checks and compliance: */
cancelable in Global := true
lazy val sourceEncoding = "UTF-8"
scalacOptions ++= Seq(
"-Xfatal-warnings",
"-deprecation",
"-feature",
"-language:_",
"-unchecked",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-encoding", sourceEncoding
)
scalacOptions ++= (
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, minor)) if minor < 11 => Seq.empty
case _ => Seq("-Ywarn-unused-import")
})
javacOptions ++= Seq(
"-Xmx1G",
"-Xlint:unchecked",
"-Xlint:deprecation",
"-encoding", sourceEncoding
)
evictionWarningOptions in update := sbt.EvictionWarningOptions.default
.withWarnTransitiveEvictions(false)
.withWarnDirectEvictions(false)
.withWarnScalaVersionEviction(false)
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
import org.scalastyle.sbt.ScalastylePlugin
ScalastylePlugin.scalastyleFailOnError := true
testScalastyle := ScalastylePlugin.scalastyle.in(Test).toTask("").value
compileScalastyle := ScalastylePlugin.scalastyle.in(Compile).toTask("").value
/* Test, IntegrationTest */
lazy val testOptionsSettings = Tests.Argument(TestFrameworks.ScalaTest, "-oDF")
lazy val testConfigSettings = inConfig(Test)(Defaults.testTasks) ++
inConfig(IntegrationTest)(Defaults.itSettings)
lazy val testSettings = testConfigSettings ++ Seq(
fork in IntegrationTest := false,
fork in Test := true,
parallelExecution in IntegrationTest := false,
parallelExecution in Test := true,
testOptions in Test += testOptionsSettings,
testOptions in IntegrationTest += testOptionsSettings,
(internalDependencyClasspath in IntegrationTest) <<= Classpaths.concat(
internalDependencyClasspath in IntegrationTest, exportedProducts in Test
))
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "io.netty.versions.properties") => MergeStrategy.last
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
pomExtra :=
<scm>
<url>git@github.com:tuplejump/kafka-connect-cassandra.git</url>
<connection>scm:git:git@github.com:tuplejump/kafka-connect-cassandra.git</connection>
</scm>
<developers>
<developer>
<id>Shiti</id>
<name>Shiti Saxena</name>
<url>https://twitter.com/eraoferrors</url>
</developer>
<developer>
<id>helena</id>
<name>Helena Edelson</name>
<url>https://twitter.com/helenaedelson</url>
</developer>
</developers>
publishTo <<= version {
(v: String) =>
val nexus = "https://oss.sonatype.org/"
if (v.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishArtifact in Test := false
pomIncludeRepository := {
_ => false
}
pomIncludeRepository := { _ => false }
homepage := Some(url("https://github.com/tuplejump/kafka-connect-cassandra"))
lazy val root = (project in file("."))
.configs(IntegrationTest)
.enablePlugins(BuildInfoPlugin)
.enablePlugins(AutomateHeaderPlugin)
.enablePlugins(CassandraITPlugin)
.settings(
buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := "com.tuplejump.kafka.connect.cassandra",
buildInfoObject := "CassandraConnectorInfo",
cassandraVersion := cassandra,
cassandraCqlInit := "src/it/resources/setup.cql",
cassandraStartDeadline := 40,
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc @throws links
)
)
.settings(testSettings)