forked from BenFradet/spark-kafka-writer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
102 lines (91 loc) · 3.07 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
import com.typesafe.sbt.SbtGit.GitKeys._
lazy val buildSettings = Seq(
organization := "com.github.benfradet",
version := "0.3.0-SNAPSHOT",
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.10.6", "2.11.8")
)
lazy val sparkVersion = "2.1.0"
lazy val kafka08Version = "0.8.2.1"
lazy val kafka010Version = "0.10.0.0"
lazy val compilerOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-Xlint"
)
lazy val baseSettings = Seq(
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core",
"org.apache.spark" %% "spark-streaming"
).map(_ % sparkVersion % "provided") ++ Seq(
"org.scalatest" %% "scalatest" % "2.2.6" % "test"
),
scalacOptions ++= compilerOptions,
parallelExecution in Test := false
)
lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact := true,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://github.com/BenFradet/spark-kafka-writer")),
scmInfo := Some(
ScmInfo(
url("https://github.com/BenFradet/spark-kafka-writer"),
"scm:git:[email protected]:BenFradet/spark-kafka-writer.git"
)
),
pomExtra :=
<developers>
<developer>
<id>BenFradet</id>
<name>Ben Fradet</name>
<url>https://benfradet.github.io/</url>
</developer>
</developers>
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val allSettings = baseSettings ++ buildSettings ++ publishSettings
lazy val docSettings = site.settings ++ ghpages.settings ++ unidocSettings ++ Seq(
site.addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), "docs"),
git.remoteRepo := "[email protected]:BenFradet/spark-kafka-writer.git"
)
lazy val sparkKafkaWriter = (project in file("."))
.settings(moduleName := "spark-kafka-writer")
.settings(allSettings)
.settings(docSettings)
.settings(noPublishSettings)
.aggregate(v08, v010)
lazy val v08 = (project in file("spark-kafka-0-8-writer"))
.settings(moduleName := "spark-kafka-0-8-writer")
.settings(allSettings)
.settings(libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-streaming-kafka-0-8" % sparkVersion,
"org.apache.kafka" %% "kafka" % kafka08Version
).map(_ % "provided"))
lazy val v010 = (project in file("spark-kafka-0-10-writer"))
.settings(moduleName := "spark-kafka-0-10-writer")
.settings(allSettings)
.settings(libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-streaming-kafka-0-10" % sparkVersion,
"org.apache.kafka" %% "kafka" % kafka010Version
).map(_ % "provided"))