-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.sbt
100 lines (83 loc) · 3.3 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
import BuildSettings._
import Dependencies._
organization := "be.wegenenverkeer"
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1)
lazy val scala212 = "2.12.16"
lazy val scala213 = "2.13.8"
ThisBuild / crossScalaVersions := Seq(scala212, scala213)
ThisBuild / scalacOptions := {
val commonOptions = Seq(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-deprecation", // warning and location for usages of deprecated APIs
"-feature", // warning and location for usages of features that should be imported explicitly
"-unchecked", // additional warnings where generated code depends on assumptions
"-Xlint:-infer-any", // recommended additional warnings
"-Ywarn-value-discard", // Warn when non-Unit expression results are unused
// "-Ywarn-dead-code",
// "-Xfatal-warnings",
"-language:reflectiveCalls",
"-Ydelambdafy:method",
//"-Wconf:cat=lint-multiarg-infix:s" // mute warning on Slick <> operator: https://contributors.scala-lang.org/t/multiarg-infix-application-considered-warty/4490
)
val scalaVersionSpecificOptions = scalaVersion.value match {
case v: String if v startsWith "2.13" => Seq()
case v: String if v startsWith "2.12" =>
Seq(
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver,
"-Ywarn-inaccessible"
)
}
commonOptions ++ scalaVersionSpecificOptions
}
lazy val akkaPersistencePgModule = {
val mainDeps = Seq(
slick,
slickHikariCp,
postgres,
akkaPersistence,
akkaPersistenceQuery,
akkaActor,
akkaStreams,
akkaTest,
akkaPersistenceTestkit,
slf4jSimple
)
val It = config("it") extend Test
Project(
id = "akka-persistence-pg",
base = file("modules/akka-persistence-pg")
).configs(It)
.settings(Defaults.coreDefaultSettings ++ commonSettings ++ publishSettings)
.settings(Defaults.itSettings: _*)
.settings(crossScalaVersions := (ThisBuild / crossScalaVersions).value)
.settings(libraryDependencies ++= mainDeps ++ mainTestDependencies)
.settings(libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2,n)) if n <= 12 => Seq("org.scala-lang.modules" %% "scala-java8-compat" % "0.9.0")
case _ => Seq("org.scala-lang.modules" %% "scala-java8-compat" % "1.0.0")
}
})
}
lazy val benchmarkModule = {
//val mainDeps = Seq(scalaJava8Compat, gatling % "it", gatlinHighcharts % "it")
import _root_.io.gatling.sbt.GatlingPlugin
Project(
id = "benchmark",
base = file("modules/benchmark")
).dependsOn(akkaPersistencePgModule % "it->test;test->test;compile->compile")
.enablePlugins(GatlingPlugin)
.configs(GatlingIt)
.settings(Defaults.coreDefaultSettings ++ commonSettings ++ Seq(publish / skip := true))
.settings(crossScalaVersions := (ThisBuild / crossScalaVersions).value.filter(_ startsWith "2.13"))
.settings(scalaVersion := crossScalaVersions.value.last)
}
val main = Project(
id = "akka-persistence-postgresql",
base = file(".")
).settings(
Defaults.coreDefaultSettings ++ commonSettings ++
Seq(publishLocal := {}, publish := {}, packagedArtifacts := Map.empty, crossScalaVersions := Seq.empty)
)
.aggregate(akkaPersistencePgModule, benchmarkModule)