-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sbt
176 lines (166 loc) · 5.13 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import Dependencies.Versions._
import Dependencies._
import sbt._
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value)
def crossScalacOptions(scalaVersion: String): Seq[String] =
CrossVersion.partialVersion(scalaVersion) match {
case Some((3L, _)) =>
Seq(
"-source:3.0-migration",
"-Xignore-scala2-macros"
)
case Some((2L, scalaMajor)) if scalaMajor >= 12 =>
Seq(
"-Ydelambdafy:method",
"-target:jvm-1.8",
"-Yrangepos",
"-Ywarn-unused"
)
}
val coreSettings = Seq(
organization := "com.github.j5ik2o",
homepage := Some(url("https://github.com/j5ik2o/akka-persistence-s3")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
id = "j5ik2o",
name = "Junichi Kato",
email = "[email protected]",
url = url("https://blog.j5ik2o.me")
)
),
scalaVersion := scala213Version,
crossScalaVersions ++= Seq(scala212Version, scala213Version, scala3Version),
scalacOptions ++= (Seq(
"-unchecked",
"-feature",
"-deprecation",
"-encoding",
"UTF-8",
"-language:_"
) ++ crossScalacOptions(scalaVersion.value)),
resolvers ++= Seq(
"Sonatype OSS Snapshot Repository" at "https://oss.sonatype.org/content/repositories/snapshots/",
"Sonatype OSS Release Repository" at "https://oss.sonatype.org/content/repositories/releases/",
"Seasar Repository" at "https://maven.seasar.org/maven2/",
"jitpack" at "https://jitpack.io"
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
Test / fork := true,
Test / publishArtifact := false,
Test / parallelExecution := false,
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (scalaVersion.value == scala3Version) {
Nil
} else {
old
}
}
)
lazy val test = (project in file("test"))
.settings(coreSettings)
.settings(
name := "akka-persistence-s3-test",
libraryDependencies ++= Seq(
typesafe.config,
software.awssdk.s3
),
libraryDependencies ++= Seq(
scalatest.scalatest,
j5ik2o.dockerControllerScalaScalatest,
j5ik2o.dockerControllerScalaMinio
).map(_.cross(CrossVersion.for3Use2_13)),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3L, _)) => Seq.empty
case Some((2L, scalaMajor)) if scalaMajor == 13 => Seq.empty
case Some((2L, scalaMajor)) if scalaMajor == 12 => Seq(scala.collectionCompat)
}
}
)
lazy val base = (project in file("base"))
.settings(coreSettings)
.settings(
name := "akka-persistence-s3-base",
libraryDependencies ++= Seq(
slf4j.api,
software.awssdk.s3,
logback.classic % Test
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, _)) =>
Seq(scala.reflect(scalaVersion.value))
case _ =>
Seq.empty
}
},
libraryDependencies ++= Seq(
iheart.ficus,
akka.slf4j,
akka.stream,
akka.testkit % Test
).map(_.cross(CrossVersion.for3Use2_13)),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3L, _)) =>
Seq.empty
case Some((2L, scalaMajor)) if scalaMajor == 13 =>
Seq.empty
case Some((2L, scalaMajor)) if scalaMajor == 12 =>
Seq(scala.collectionCompat)
}
}
)
.dependsOn(test % "test->compile")
lazy val snapshot = (project in file("snapshot"))
.settings(coreSettings)
.settings(
name := "akka-persistence-s3-snapshot",
libraryDependencies ++= Seq(
scalatest.scalatest % Test,
akka.persistence,
akka.persistenceTck % Test
).map(_.cross(CrossVersion.for3Use2_13))
)
.dependsOn(base % "test->test;compile->compile")
lazy val journal = (project in file("journal"))
.settings(coreSettings)
.settings(
name := "akka-persistence-s3-journal",
libraryDependencies ++= Seq(
scalatest.scalatest % Test,
akka.persistence,
akka.persistenceTck % Test
).map(_.cross(CrossVersion.for3Use2_13))
)
.dependsOn(base % "test->test;compile->compile", snapshot % "test->comple")
lazy val benchmark = (project in file("benchmark"))
.settings(coreSettings)
.settings(
name := "akka-persistence-dynamodb-benchmark",
publish / skip := true,
libraryDependencies ++= Seq(
logback.classic,
slf4j.api,
slf4j.julToSlf4J
),
libraryDependencies ++= Seq(
akka.slf4j,
akka.persistenceTyped
).map(_.cross(CrossVersion.for3Use2_13))
)
.enablePlugins(JmhPlugin)
.dependsOn(test, journal, snapshot)
lazy val root = (project in file("."))
.settings(coreSettings)
.settings(
name := "akka-persistence-s3-root",
publish / skip := true
)
.aggregate(base, journal, snapshot)
// --- Custom commands
addCommandAlias("lint", ";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt;scalafix RemoveUnused")