forked from akka/alpakka-kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
141 lines (128 loc) · 5.01 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
import scalariform.formatter.preferences.{CompactControlReadability, DoubleIndentClassDeclaration, PreserveSpaceBeforeArguments, SpacesAroundMultiImports}
import de.heikoseeberger.sbtheader.HeaderPattern
name := "akka-stream-kafka"
val akkaVersion = "2.4.18"
val kafkaVersion = "0.11.0.0"
val kafkaClients = "org.apache.kafka" % "kafka-clients" % kafkaVersion
val commonDependencies = Seq(
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test
)
val coreDependencies = Seq(
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
kafkaClients,
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.reactivestreams" % "reactive-streams-tck" % "1.0.0" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test",
"junit" % "junit" % "4.12" % "test",
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion % "test",
"com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion % "test",
"ch.qos.logback" % "logback-classic" % "1.1.3" % "test",
"org.slf4j" % "log4j-over-slf4j" % "1.7.12" % "test",
"org.mockito" % "mockito-core" % "1.10.19" % "test",
"net.manub" %% "scalatest-embedded-kafka" % "0.14.0" % "test" exclude("log4j", "log4j"),
"org.apache.kafka" %% "kafka" % kafkaVersion % "test" exclude("org.slf4j", "slf4j-log4j12")
)
val commonSettings =
scalariformSettings ++ Seq(
organization := "com.typesafe.akka",
organizationName := "Lightbend",
startYear := Some(2014),
test in assembly := {},
licenses := Seq("Apache License 2.0" -> url("http://opensource.org/licenses/Apache-2.0")),
scalaVersion := "2.11.11",
crossScalaVersions := Seq(scalaVersion.value, "2.12.2"),
crossVersion := CrossVersion.binary,
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-feature",
"-unchecked",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture"
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(PreserveSpaceBeforeArguments, true)
.setPreference(CompactControlReadability, true)
.setPreference(SpacesAroundMultiImports, false),
headers := headers.value ++ Map(
"scala" -> (
HeaderPattern.cStyleBlockComment,
"""|/*
| * Copyright (C) 2014 - 2016 Softwaremill <http://softwaremill.com>
| * Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
| */
|""".stripMargin
)
))
resolvers in ThisBuild ++= Seq(Resolver.bintrayRepo("manub", "maven"))
lazy val root =
project.in( file(".") )
.settings(commonSettings)
.settings(Seq(
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))))
.aggregate(core, benchmarks, docs)
lazy val core = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(Seq(
name := "akka-stream-kafka",
libraryDependencies ++= commonDependencies ++ coreDependencies
))
lazy val docs = project.in(file("docs"))
.enablePlugins(ParadoxPlugin)
.dependsOn(core)
.settings(commonSettings)
.settings(
name := "akka-stream-kafka-docs",
publishArtifact := false,
paradoxTheme := Some(builtinParadoxTheme("generic")),
paradoxNavigationDepth := 3,
paradoxProperties ++= Map(
"version" -> version.value,
"akkaVersion" -> akkaVersion,
"kafkaVersion" -> kafkaVersion,
"scalaVersion" -> scalaVersion.value,
"scalaBinaryVersion" -> scalaBinaryVersion.value,
"extref.akka-docs.base_url" -> s"http://doc.akka.io/docs/akka/$akkaVersion/%s",
"extref.kafka-docs.base_url" -> s"https://kafka.apache.org/documentation/%s",
"scaladoc.akka.base_url" -> s"http://doc.akka.io/api/akka/$akkaVersion"
)
)
lazy val Benchmark = config("bench") extend Test
lazy val benchmarks = project
.enablePlugins(AutomateHeaderPlugin)
.enablePlugins(DockerPlugin)
.settings(commonSettings)
.settings(Seq(
publishArtifact := false,
name := "akka-stream-kafka-benchmarks",
parallelExecution in Benchmark := false,
libraryDependencies ++= commonDependencies ++ coreDependencies ++ Seq(
"com.typesafe.scala-logging" %% "scala-logging" % "3.5.0",
"io.dropwizard.metrics" % "metrics-core" % "3.1.0",
"ch.qos.logback" % "logback-classic" % "1.1.3",
"org.slf4j" % "log4j-over-slf4j" % "1.7.12",
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-stream" % akkaVersion
),
dockerfile in docker := {
val artifact: File = assembly.value
val artifactTargetPath = s"/app/${artifact.name}"
new Dockerfile {
from("netflixoss/java:8")
add(artifact, artifactTargetPath)
entryPoint("java", "-jar", artifactTargetPath)
expose(8080)
}
}
)
)
.configs(Benchmark)
.settings(inConfig(Benchmark)(Defaults.testSettings): _*)
.dependsOn(core)