forked from akka/akka-persistence-cassandra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
112 lines (103 loc) · 5.73 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
ThisBuild / resolvers += "Akka Snapshots".at("https://repo.akka.io/snapshots/")
lazy val root = (project in file("."))
.enablePlugins(Common, ScalaUnidocPlugin)
.disablePlugins(SitePlugin)
.aggregate(core, cassandraLauncher, session)
.settings(name := "akka-persistence-cassandra-root", publish / skip := true)
lazy val session = (project in file("session"))
.enablePlugins(Common, AutomateHeaderPlugin, SbtOsgi)
.dependsOn(cassandraLauncher % Test)
.settings(osgiSettings: _*)
.settings(
name := "akka-cassandra-session",
libraryDependencies ++= Dependencies.akkaCassandraSessionDependencies,
Compile / packageBin / packageOptions += Package.ManifestAttributes(
"Automatic-Module-Name" -> "akka.cassandra.session"),
OsgiKeys.exportPackage := Seq("akka.cassandra.session.*"),
OsgiKeys.importPackage := Seq(akkaImport(), optionalImport("org.apache.cassandra.*"), "*"),
OsgiKeys.privatePackage := Nil)
lazy val dumpSchema = taskKey[Unit]("Dumps cassandra schema for docs")
dumpSchema := (core / runMain in (Test)).toTask(" akka.persistence.cassandra.PrintCreateStatements").value
lazy val core = (project in file("core"))
.enablePlugins(Common, AutomateHeaderPlugin, SbtOsgi, MultiJvmPlugin)
.dependsOn(cassandraLauncher % Test, session)
.settings(osgiSettings: _*)
.settings({
val silencerVersion = "1.4.4"
Seq(
libraryDependencies ++= Seq(
compilerPlugin(("com.github.ghik" %% "silencer-plugin" % silencerVersion).cross(CrossVersion.patch)),
("com.github.ghik" %% "silencer-lib" % silencerVersion % Provided).cross(CrossVersion.patch)))
})
.settings(
name := "akka-persistence-cassandra",
libraryDependencies ++= Dependencies.akkaPersistenceCassandraDependencies,
Compile / packageBin / packageOptions += Package.ManifestAttributes(
"Automatic-Module-Name" -> "akka.persistence.cassandra"),
OsgiKeys.exportPackage := Seq("akka.persistence.cassandra.*"),
OsgiKeys.importPackage := Seq(akkaImport(), optionalImport("org.apache.cassandra.*"), "*"),
OsgiKeys.privatePackage := Nil,
testOptions in Test ++= Seq(Tests.Argument(TestFrameworks.ScalaTest, "-o")))
.configs(MultiJvm)
lazy val cassandraLauncher = (project in file("cassandra-launcher"))
.enablePlugins(Common)
.settings(
name := "akka-persistence-cassandra-launcher",
managedResourceDirectories in Compile += (target in cassandraBundle).value / "bundle",
managedResources in Compile += (assembly in cassandraBundle).value)
// This project doesn't get published directly, rather the assembled artifact is included as part of cassandraLaunchers
// resources
lazy val cassandraBundle = (project in file("cassandra-bundle"))
.enablePlugins(Common, AutomateHeaderPlugin)
.settings(
name := "akka-persistence-cassandra-bundle",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies += ("org.apache.cassandra" % "cassandra-all" % "3.11.3")
.exclude("commons-logging", "commons-logging"),
dependencyOverrides += "com.github.jbellis" % "jamm" % "0.3.3", // See jamm comment in https://issues.apache.org/jira/browse/CASSANDRA-9608
target in assembly := target.value / "bundle" / "akka" / "persistence" / "cassandra" / "launcher",
assemblyJarName in assembly := "cassandra-bundle.jar")
lazy val dseTest =
(project in file("dse-test"))
.dependsOn(core % "test->test")
.settings(libraryDependencies ++= Dependencies.dseTestDependencies)
lazy val docs = project
.enablePlugins(Common, AkkaParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, PublishRsyncPlugin)
.dependsOn(core)
.settings(
name := "Akka Persistence Cassandra",
(Compile / paradox) := (Compile / paradox).dependsOn(root / dumpSchema).value,
publish / skip := true,
whitesourceIgnore := true,
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
previewPath := (Paradox / siteSubdirName).value,
Preprocess / siteSubdirName := s"api/akka-persistence-cassandra/${if (isSnapshot.value) "snapshot"
else version.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value,
Preprocess / preprocessRules := Seq(("\\.java\\.scala".r, _ => ".java")),
Paradox / siteSubdirName := s"docs/akka-persistence-cassandra/${if (isSnapshot.value) "snapshot" else version.value}",
paradoxProperties ++= Map(
"akka.version" -> Dependencies.AkkaVersion,
// Akka
"extref.akka.base_url" -> s"https://doc.akka.io/docs/akka/${Dependencies.AkkaVersion}/%s",
"scaladoc.akka.base_url" -> s"https://doc.akka.io/api/akka/${Dependencies.AkkaVersion}/",
"javadoc.akka.base_url" -> s"https://doc.akka.io/japi/akka/${Dependencies.AkkaVersion}/",
// Cassandra
"extref.cassandra.base_url" -> s"https://cassandra.apache.org/doc/${Dependencies.CassandraVersionInDocs}/%s",
// Java
"javadoc.base_url" -> "https://docs.oracle.com/javase/8/docs/api/",
// Scala
"scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/${scalaBinaryVersion.value}.x/",
"scaladoc.akka.persistence.cassandra.base_url" -> s"/${(Preprocess / siteSubdirName).value}/"),
paradoxGroups := Map("Language" -> Seq("Java", "Scala")),
resolvers += Resolver.jcenterRepo,
publishRsyncArtifact := makeSite.value -> "www/",
publishRsyncHost := "[email protected]")
def akkaImport(packageName: String = "akka.*") =
versionedImport(packageName, "2.4", "2.5")
def configImport(packageName: String = "com.typesafe.config.*") =
versionedImport(packageName, "1.3.0", "1.4.0")
def versionedImport(packageName: String, lower: String, upper: String) =
s"""$packageName;version="[$lower,$upper)""""
def optionalImport(packageName: String) = s"$packageName;resolution:=optional"