-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
130 lines (112 loc) · 5.66 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
import Commons._
import Dependencies._
ThisBuild / offline := true
ThisBuild / updateOptions := updateOptions.value.withCachedResolution(true).withLatestSnapshots(false)
ThisBuild / scalaVersion := versionScala213
ThisBuild / scalafmtOnCompile := true
lazy val root = Project(id = "akka-cookbook", base = file(".")).aggregate(
book,
actionOauth2,
storageCassandra,
integrationSpring,
cookbookGrpc,
cookbookPersistence,
cookbookCluster,
cookbookStreams,
cookbookActor,
cookbookCommon)
lazy val book =
_project("book")
.enablePlugins(AkkaParadoxPlugin)
.dependsOn(
storageCassandra,
actionOauth2,
integrationSpring,
cookbookGrpc,
cookbookPersistence,
cookbookCluster,
cookbookStreams,
cookbookActor,
cookbookCommon)
.settings(Publishing.noPublish: _*)
.settings(
resolvers += Resolver.jcenterRepo,
publish / skip := true,
paradoxRoots := List("index.html"),
paradoxGroups := Map("Language" -> Seq("Scala", "Java")),
sourceDirectory in Compile in paradoxTheme := sourceDirectory.value / "main" / "paradox" / "_template",
Compile / paradoxProperties ++= Map(
"project.name" -> "Akka Cookbook",
"canonical.base_url" -> "https://www.yangbajing.me/akka-cookbook",
"github.base_url" -> s"https://github.com/yangbajing/akka-cookbook/tree/master",
"version" -> version.value,
"scaladoc.akka.base_url" -> "https://doc.akka.io/api/akka/2.6",
"scaladoc.akka.http.base_url" -> "https://doc.akka.io/api/akka-http/current",
"javadoc.akka.base_url" -> "https://doc.akka.io/japi/akka/2.6",
"javadoc.akka.http.base_url" -> "https://doc.akka.io/japi/akka-http/current",
"scala.version" -> scalaVersion.value,
"scala.binary_version" -> scalaBinaryVersion.value,
"extref.wikipedia.base_url" -> "https://en.wikipedia.org/wiki/%s",
"alpakka.version" -> versionAlpakka,
"scaladoc.akka.base_url" -> s"http://doc.akka.io/api/$versionAkka",
"algolia.docsearch.api_key" -> "bc8e6a27d54d01e7d322395f061bf539",
"algolia.docsearch.index_name" -> "akka-cookbook",
"akka.version" -> versionAkka))
lazy val cookbookGrpc = _project("cookbook-grpc")
.enablePlugins(AkkaGrpcPlugin, JavaAgent, JavaAppPackaging)
.dependsOn(cookbookStreams, cookbookCommon % "compile->compile;test->test")
.settings(
javaAgents += _alpnAgent % "runtime;test",
mainClass in assembly := Some("greeter.GreeterApplication"),
test in assembly := {},
assemblyMergeStrategy in assembly := {
case PathList("io", "netty", xs @ _*) => MergeStrategy.first
case PathList("google", "protobuf", xs @ _*) => MergeStrategy.first
case PathList("com", "google", "protobuf", xs @ _*) => MergeStrategy.first
case PathList("scalapb", xs @ _*) => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case "reference.conf" => MergeStrategy.concat
case "module-info.class" => MergeStrategy.concat
case "META-INF/io.netty.versions.properties" => MergeStrategy.first
case "META-INF/native/libnetty-transport-native-epoll.so" =>
MergeStrategy.first
case n if n.endsWith(".txt") => MergeStrategy.concat
case n if n.endsWith("NOTICE") => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
akkaGrpcCodeGeneratorSettings += "server_power_apis",
libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
_akkaDiscovery))
lazy val actionOauth2 = _project("action-oauth2")
.dependsOn(cookbookCommon % "compile->compile;test->test")
.settings(libraryDependencies ++= Seq(_akkaSerializationJackson, _akkaPersistenceTyped) ++ _akkaClusters)
lazy val cookbookActor = _project("cookbook-actor").dependsOn(cookbookCommon % "compile->compile;test->test")
lazy val cookbookStreams = _project("cookbook-streams")
.dependsOn(cookbookCommon % "compile->compile;test->test")
.settings(libraryDependencies ++= Seq(_akkaHttp, _alpakkaCsv, _alpakkaFtp, _alpakkaFile))
lazy val cookbookCluster = _project("cookbook-cluster")
.dependsOn(cookbookCommon % "compile->compile;test->test")
.settings(libraryDependencies ++= Seq(_guava, _akkaSerializationJackson) ++ _akkaClusters)
lazy val cookbookPersistence = _project("cookbook-persistence")
.dependsOn(cookbookCluster, cookbookCommon % "compile->compile;test->test")
.settings(libraryDependencies ++= Seq(_akkaPersistenceTyped))
lazy val storageCassandra = _storageProject("cookbook-cassandra")
.dependsOn(cookbookCluster, cookbookCommon % "compile->compile;test->test")
.settings(libraryDependencies ++= _cassandras)
lazy val integrationSpring = _integrationProject("cookbook-spring")
.dependsOn(cookbookCommon % "compile->compile;test->test")
.settings(libraryDependencies ++= Seq(_alpakkaSpringWeb) ++ _springs)
lazy val cookbookCommon = _project("cookbook-common").settings(libraryDependencies ++= Seq(
_akkaSerializationJackson % Provided,
_akkaHttp % Provided,
_javaUuidGenerator) ++ _akkas ++ _logs)
def _integrationProject(name: String) = _project(name, s"integration/$name")
def _storageProject(name: String) = _project(name, s"storage/$name")
def _project(name: String, _base: String = null) =
Project(id = name, base = file(if (_base eq null) name else _base))
.enablePlugins(AutomateHeaderPlugin)
.settings(basicSettings: _*)
.settings(Publishing.noPublish: _*)