This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
197 lines (188 loc) · 6.01 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import sbt._
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value)
def crossScalacOptions(scalaVersion: String): Seq[String] = CrossVersion.partialVersion(scalaVersion) match {
case Some((2L, scalaMajor)) if scalaMajor >= 12 =>
Seq.empty
case Some((2L, scalaMajor)) if scalaMajor <= 11 =>
Seq("-Yinline-warnings")
}
val commonSettings = Seq(
organization := "com.chatwork",
homepage := Some(url("https://github.com/chatwork/akka-guard")),
licenses := List("The MIT License" -> url("http://opensource.org/licenses/MIT")),
developers := List(
Developer(
id = "j5ik2o",
name = "Junichi Kato",
email = "[email protected]",
url = url("https://blog.j5ik2o.me")
),
Developer(
id = "yoshiyoshifujii",
name = "Yoshitaka Fujii",
email = "[email protected]",
url = url("http://yoshiyoshifujii.hatenablog.com")
),
Developer(
id = "exoego",
name = "TATSUNO Yasuhiro",
email = "[email protected]",
url = url("https://www.exoego.net")
)
),
scalaVersion := ScalaVersions.scala213Version,
scalacOptions ++= (
Seq(
"-feature",
"-deprecation",
"-unchecked",
"-encoding",
"UTF-8",
"-language:_",
"-Ydelambdafy:method",
"-target:jvm-1.8",
"-Yrangepos",
"-Ywarn-unused"
) ++ crossScalacOptions(scalaVersion.value)
),
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
),
libraryDependencies ++= Seq(
ScalaTest.scalatest % Test,
ScalaTestPlus.scalacheck % Test,
ScalaCheck.scalaCheck % Test,
Enumeratum.latest,
ScalaLangModules.java8Compat
),
updateOptions := updateOptions.value.withCachedResolution(true),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
Test / parallelExecution := false,
Test / run / javaOptions ++= Seq("-Xms4g", "-Xmx4g", "-Xss10M", "-XX:+CMSClassUnloadingEnabled"),
Test / publishArtifact := false
)
lazy val `akka-guard-core` = (project in file("akka-guard-core"))
.settings(commonSettings: _*)
.settings(
name := "akka-guard-core",
crossScalaVersions := Seq(
ScalaVersions.scala211Version,
ScalaVersions.scala212Version,
ScalaVersions.scala213Version
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, scalaMajor)) if scalaMajor == 13 =>
Seq(
Akka.Version2_6.testKit % Test,
Cats.Version2_1.core,
Circe.Version0_13.core,
Circe.Version0_13.generic,
Circe.Version0_13.parser,
Akka.Version2_6.actor,
Akka.Version2_6.slf4j,
Logback.classic
)
case Some((2L, scalaMajor)) if scalaMajor == 12 =>
Seq(
Akka.Version2_6.testKit % Test,
ScalaLangModules.collectionCompat,
Cats.Version2_1.core,
Circe.Version0_13.core,
Circe.Version0_13.generic,
Circe.Version0_13.parser,
Akka.Version2_6.actor,
Akka.Version2_6.slf4j,
Logback.classic
)
case Some((2L, scalaMajor)) if scalaMajor == 11 =>
Seq(
Akka.Version2_5.testKit % Test,
ScalaLangModules.collectionCompat,
Cats.Version2_0.core,
Circe.Version0_11.core,
Circe.Version0_11.generic,
Circe.Version0_11.parser,
Akka.Version2_5.actor,
Akka.Version2_5.slf4j
)
}
}
)
lazy val `akka-guard-http` = (project in file("akka-guard-http"))
.settings(commonSettings: _*)
.settings(
name := "akka-guard-http",
crossScalaVersions := Seq(
ScalaVersions.scala211Version,
ScalaVersions.scala212Version,
ScalaVersions.scala213Version
),
libraryDependencies ++= Seq(
AkkaHttp.testKit % Test,
AkkaHttp.http
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, scalaMajor)) if scalaMajor == 13 =>
Seq(
Akka.Version2_6.testKit % Test,
Akka.Version2_6.streamTestKit % Test,
Akka.Version2_6.stream
)
case Some((2L, scalaMajor)) if scalaMajor == 12 =>
Seq(
Akka.Version2_6.testKit % Test,
Akka.Version2_6.streamTestKit % Test,
Akka.Version2_6.stream
)
case Some((2L, scalaMajor)) if scalaMajor == 11 =>
Seq(
Akka.Version2_5.testKit % Test,
Akka.Version2_5.streamTestKit % Test,
Akka.Version2_5.stream
)
}
}
)
.dependsOn(`akka-guard-core`)
lazy val `akka-guard-core-typed` = (project in file("akka-guard-core-typed"))
.settings(commonSettings: _*)
.settings(
name := "akka-guard-core-typed",
libraryDependencies ++= Seq(
Akka.Version2_6.testKitTyped % Test,
Cats.Version2_1.core,
Circe.Version0_13.core,
Circe.Version0_13.generic,
Circe.Version0_13.parser,
Akka.Version2_6.actorTyped,
Akka.Version2_6.slf4j,
Logback.classic
)
)
lazy val `akka-guard-http-typed` = (project in file("akka-guard-http-typed"))
.settings(commonSettings: _*)
.settings(
name := "akka-guard-http-typed",
libraryDependencies ++= Seq(
AkkaHttp.testKit % Test,
Akka.Version2_6.streamTestKit % Test,
Akka.Version2_6.testKitTyped % Test,
AkkaHttp.http,
Akka.Version2_6.streamTyped
)
)
.dependsOn(`akka-guard-core-typed`)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(
name := "akka-guard-root",
publish / skip := true
)
.aggregate(`akka-guard-core`, `akka-guard-http`, `akka-guard-core-typed`, `akka-guard-http-typed`)
// --- Custom commands
addCommandAlias("lint", ";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt")