forked from johanandren/akka-persistence-spanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
141 lines (131 loc) · 6.02 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 sbt.Keys.parallelExecution
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
inThisBuild(
Seq(
organization := "com.lightbend.akka",
organizationName := "Lightbend Inc.",
homepage := Some(url("https://doc.akka.io/docs/akka-persistence-spanner/current")),
scmInfo := Some(
ScmInfo(
url("https://github.com/akka/akka-persistence-spanner"),
"https://github.com/akka/akka-persistence-spanner.git"
)
),
startYear := Some(2020),
developers += Developer(
"contributors",
"Contributors",
"https://gitter.im/akka/dev",
url("https://github.com/akka/akka-persistence-spanner/graphs/contributors")
),
licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))),
description := "A replicated Akka Persistence journal backed by Spanner",
// due to the emulator
parallelExecution := false,
// add snapshot repo when Akka version overriden
resolvers ++=
(if (System.getProperty("override.akka.version") != null)
Seq("Akka Snapshots".at("https://oss.sonatype.org/content/repositories/snapshots/"))
else Seq.empty)
)
)
def common: Seq[Setting[_]] =
Seq(
crossScalaVersions := Seq(Dependencies.Scala213),
scalaVersion := Dependencies.Scala213,
crossVersion := CrossVersion.binary,
sonatypeProfileName := "com.lightbend",
// Setting javac options in common allows IntelliJ IDEA to import them automatically
compile / javacOptions ++= Seq("-encoding", "UTF-8", "-source", "1.8", "-target", "1.8"),
headerLicense := Some(HeaderLicense.Custom("""Copyright (C) 2021 Lightbend Inc. <https://www.lightbend.com>""")),
Test / logBuffered := System.getProperty("akka.logBufferedTests", "false").toBoolean,
// show full stack traces and test case durations
Test / testOptions += Tests.Argument("-oDF"),
// -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug".
// -a Show stack traces and exception class name for AssertionErrors.
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),
projectInfoVersion := (if (isSnapshot.value) "snapshot" else version.value),
// For akka snapshots:
resolvers += Resolver.sonatypeRepo("snapshots")
)
lazy val dontPublish = Seq(publish / skip := true, Compile / publishArtifact := false)
lazy val root = project
.in(file("."))
.settings(common)
.settings(dontPublish)
.settings(
name := "akka-persistence-spanner-root",
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))
)
.aggregate(journal, testkit)
lazy val dumpSchema = taskKey[Unit]("Dumps schema for docs")
dumpSchema := (journal / Test / runMain).toTask(" akka.persistence.spanner.PrintSchema").value
def suffixFileFilter(suffix: String): FileFilter = new SimpleFileFilter(f => f.getAbsolutePath.endsWith(suffix))
lazy val journal = project
.in(file("journal"))
.enablePlugins(AkkaGrpcPlugin)
.settings(common)
.settings(
name := "akka-persistence-spanner",
libraryDependencies ++= Dependencies.journal,
// Workaround for https://github.com/akka/akka-persistence-spanner/issues/62
PB.generate / excludeFilter ~= (
f =>
f ||
suffixFileFilter("google/protobuf/any.proto") ||
suffixFileFilter("google/protobuf/api.proto") ||
suffixFileFilter("google/protobuf/descriptor.proto") ||
suffixFileFilter("google/protobuf/duration.proto") ||
suffixFileFilter("google/protobuf/empty.proto") ||
suffixFileFilter("google/protobuf/field_mask.proto") ||
suffixFileFilter("google/protobuf/source_context.proto") ||
suffixFileFilter("google/protobuf/struct.proto") ||
suffixFileFilter("google/protobuf/timestamp.proto") ||
suffixFileFilter("google/protobuf/type.proto") ||
suffixFileFilter("google/protobuf/wrappers.proto")
)
)
lazy val testkit = project
.in(file("testkit"))
.settings(common)
.dependsOn(journal)
.settings(name := "akka-persistence-spanner-testkit", libraryDependencies ++= Dependencies.testkit)
lazy val example = project
.in(file("example"))
.settings(common)
.settings(dontPublish)
.settings(
name := "akka-persistence-spanner-example",
libraryDependencies ++= Dependencies.example,
run / fork := false,
Global / cancelable := false // let ctrl-c kill sbt
)
.dependsOn(journal)
lazy val docs = project
.in(file("docs"))
.enablePlugins(AkkaParadoxPlugin, ParadoxSitePlugin, PublishRsyncPlugin)
.dependsOn(journal)
.settings(common)
.settings(dontPublish)
.settings(
name := "Akka Persistence Spanner",
(Compile / paradox) := (Compile / paradox).dependsOn(root / dumpSchema).value,
crossScalaVersions := Seq(Dependencies.Scala213),
previewPath := (Paradox / siteSubdirName).value,
Paradox / siteSubdirName := s"docs/akka-persistence-spanner/${projectInfoVersion.value}",
paradoxGroups := Map("Language" -> Seq("Java", "Scala")),
Compile / paradoxProperties ++= Map(
"project.url" -> "https://doc.akka.io/docs/akka-persistence-spanner/current/",
"canonical.base_url" -> "https://doc.akka.io/docs/akka-persistence-spanner/current",
"akka.version" -> Dependencies.AkkaVersion,
"extref.akka.base_url" -> s"https://doc.akka.io/docs/akka/${Dependencies.AkkaVersionInDocs}/%s",
"extref.akka-docs.base_url" -> s"https://doc.akka.io/docs/akka/${Dependencies.AkkaVersionInDocs}/%s",
"extref.java-docs.base_url" -> "https://docs.oracle.com/en/java/javase/11/%s",
"scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/current/",
"scaladoc.akka.base_url" -> s"https://doc.akka.io/api/akka/${Dependencies.AkkaVersion}",
"scaladoc.com.typesafe.config.base_url" -> s"https://lightbend.github.io/config/latest/api/"
),
resolvers += Resolver.jcenterRepo,
publishRsyncArtifacts += makeSite.value -> "www/",
publishRsyncHost := "[email protected]"
)