-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathbuild.sbt
179 lines (160 loc) · 6.32 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
177
178
179
import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings
import com.softwaremill.Publish.ossPublishSettings
val scala2_12 = "2.12.18"
val scala2_13 = "2.13.11"
val scala3 = "3.3.0"
val scala2 = List(scala2_12, scala2_13)
val scala2And3 = List(scala2_12, scala2_13, scala3)
lazy val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
versionScheme := Some("early-semver")
)
val akkaHttpVersion = "10.2.7"
val akkaStreamsVersion = "2.6.18"
val json4sVersion = "4.0.4"
val akkaStreamsProvided = "com.typesafe.akka" %% "akka-stream" % akkaStreamsVersion % "provided"
val akkaStreamsTestkit = "com.typesafe.akka" %% "akka-stream-testkit" % akkaStreamsVersion % "test"
val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" % "test"
lazy val rootProject = (project in file("."))
.settings(akkaCommonSettings: _*)
.settings(publish / skip := true, name := "akka-http-session-root", scalaVersion := scala2_13)
.aggregate(core.projectRefs ++ jwt.projectRefs ++ example.projectRefs ++ javaTests.projectRefs ++
pekkoCore.projectRefs ++ pekkoJwt.projectRefs ++ pekkoExample.projectRefs ++ pekkoJavaTests.projectRefs: _*)
//
lazy val akkaCommonSettings = commonSettings ++ Seq(
organization := "com.softwaremill.akka-http-session"
)
lazy val core = (projectMatrix in file("core"))
.settings(akkaCommonSettings: _*)
.settings(
name := "core",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
akkaStreamsProvided,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test",
akkaStreamsTestkit,
"org.scalacheck" %% "scalacheck" % "1.15.4" % "test",
scalaTest
)
)
.jvmPlatform(scalaVersions = scala2)
lazy val jwt = (projectMatrix in file("jwt"))
.settings(akkaCommonSettings: _*)
.settings(
name := "jwt",
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-jackson" % json4sVersion,
"org.json4s" %% "json4s-ast" % json4sVersion,
"org.json4s" %% "json4s-core" % json4sVersion,
akkaStreamsProvided,
scalaTest
),
// generating docs for 2.13 causes an error: "not found: type DefaultFormats$"
Compile / doc / sources := Seq.empty
)
.jvmPlatform(scalaVersions = scala2)
.dependsOn(core)
lazy val example = (projectMatrix in file("example"))
.settings(akkaCommonSettings: _*)
.settings(
publishArtifact := false,
libraryDependencies ++= Seq(
akkaStreamsProvided,
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.4",
"ch.qos.logback" % "logback-classic" % "1.2.10",
"org.json4s" %% "json4s-ext" % json4sVersion
)
)
.jvmPlatform(scalaVersions = scala2)
.dependsOn(core, jwt)
lazy val javaTests = (projectMatrix in file("javaTests"))
.settings(akkaCommonSettings: _*)
.settings(
name := "javaTests",
Test / testOptions := Seq(Tests.Argument(TestFrameworks.JUnit, "-a")), // required for javadsl JUnit tests
crossPaths := false, // https://github.com/sbt/junit-interface/issues/35
publishArtifact := false,
libraryDependencies ++= Seq(
akkaStreamsProvided,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test",
akkaStreamsTestkit,
"junit" % "junit" % "4.13.2" % "test",
"com.github.sbt" % "junit-interface" % "0.13.3" % "test",
scalaTest
)
)
.jvmPlatform(scalaVersions = scala2)
.dependsOn(core, jwt)
// Pekko build
lazy val pekkoCommonSettings = commonSettings ++ Seq(
organization := "com.softwaremill.pekko-http-session"
)
val pekkoHttpVersion = "1.0.0"
val pekkoStreamsVersion = "1.0.1"
val pekkoStreamsProvided = "org.apache.pekko" %% "pekko-stream" % pekkoStreamsVersion % "provided"
val pekkoStreamsTestkit = "org.apache.pekko" %% "pekko-stream-testkit" % pekkoStreamsVersion % "test"
val scalaJava8CompatVersion = "1.0.2"
lazy val pekkoCore = (projectMatrix in file("pekko-http-session/core"))
.settings(pekkoCommonSettings: _*)
.settings(
name := "core",
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion,
"org.scala-lang.modules" %% "scala-java8-compat" % scalaJava8CompatVersion,
pekkoStreamsProvided,
"org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % "test",
pekkoStreamsTestkit,
"org.scalacheck" %% "scalacheck" % "1.15.4" % "test",
scalaTest
)
)
.jvmPlatform(scalaVersions = scala2And3)
lazy val pekkoJwt = (projectMatrix in file("pekko-http-session/jwt"))
.settings(pekkoCommonSettings: _*)
.settings(
name := "jwt",
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-jackson" % json4sVersion,
"org.json4s" %% "json4s-ast" % json4sVersion,
"org.json4s" %% "json4s-core" % json4sVersion,
pekkoStreamsProvided,
scalaTest
),
// generating docs for 2.13 causes an error: "not found: type DefaultFormats$"
Compile / doc / sources := Seq.empty
)
.jvmPlatform(scalaVersions = scala2And3)
.dependsOn(pekkoCore)
lazy val pekkoExample = (projectMatrix in file("pekko-http-session/example"))
.settings(pekkoCommonSettings: _*)
.settings(
publishArtifact := false,
libraryDependencies ++= Seq(
pekkoStreamsProvided,
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.4",
"ch.qos.logback" % "logback-classic" % "1.2.12",
"org.json4s" %% "json4s-ext" % json4sVersion
)
)
.jvmPlatform(scalaVersions = scala2And3)
.dependsOn(pekkoCore, pekkoJwt)
lazy val pekkoJavaTests = (projectMatrix in file("pekko-http-session/javaTests"))
.settings(pekkoCommonSettings: _*)
.settings(
name := "javaTests",
Test / testOptions := Seq(Tests.Argument(TestFrameworks.JUnit, "-a")), // required for javadsl JUnit tests
crossPaths := false, // https://github.com/sbt/junit-interface/issues/35
publishArtifact := false,
libraryDependencies ++= Seq(
pekkoStreamsProvided,
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion,
"org.scala-lang.modules" %% "scala-java8-compat" % scalaJava8CompatVersion,
"org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % "test",
pekkoStreamsTestkit,
"junit" % "junit" % "4.13.2" % "test",
"com.github.sbt" % "junit-interface" % "0.13.3" % "test",
scalaTest
)
)
.jvmPlatform(scalaVersions = scala2And3)
.dependsOn(pekkoCore, pekkoJwt)