-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
361 lines (337 loc) · 12.4 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / versionPolicyIntention := Compatibility.None
ThisBuild / versionPolicyIgnoredInternalDependencyVersions := Some(
"^\\d+\\.\\d+\\.\\d+\\+\\d+".r
)
inThisBuild(
List(
organization := "io.github.pityka",
homepage := Some(url("https://pityka.github.io/tasks/")),
licenses := List(
("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0"))
),
developers := List(
Developer(
"pityka",
"Istvan Bartha",
"bartha.pityu@gmail.com",
url("https://github.com/pityka/tasks")
)
)
)
)
lazy val commonSettings = Seq(
scalaVersion := "2.13.14",
crossScalaVersions := Seq("2.13.14", "3.4.3"),
parallelExecution in Test := false,
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) =>
Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:postfixOps",
"-language:implicitConversions",
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
// "-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow" // A local type parameter shadows a type already in scope.
// "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
// "-Ywarn-numeric-widen", // Warn when numerics are widened.
// "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
// "-Ywarn-unused:imports", // Warn if an import selector is not referenced.
// "-Ywarn-unused:locals", // Warn if a local definition is unused.
// "-Ywarn-unused:params", // Warn if a value parameter is unused.
// "-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
// "-Ywarn-unused:privates" // Warn if a private member is unused.
)
case _ =>
Seq(
"-experimental",
"-encoding",
"utf-8",
"-feature",
"-language:postfixOps",
"-language:implicitConversions",
"-unchecked",
"-deprecation"
)
})
) ++ Seq(
fork := true,
cancelable in Global := true,
scalacOptions in (Compile, doc) ~= (_ filterNot (_ == "-Xfatal-warnings")),
scalacOptions in (Compile, console) ~= (_ filterNot (_ == "-Xfatal-warnings"))
)
lazy val circeVersion = "0.14.9"
lazy val jsoniterVersion = "2.30.9"
lazy val akkaVersion = "2.6.19"
lazy val http4sVersion = "0.23.27"
lazy val scribeVersion = "3.13.3"
lazy val fs2Version = "3.11.0"
lazy val shared = crossProject(JSPlatform, JVMPlatform)
.crossType(sbtcrossproject.CrossPlugin.autoImport.CrossType.Pure)
.in(file("shared"))
.settings(
name := "tasks-shared",
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal"
)
)
.settings(commonSettings: _*)
.jsSettings(
fork := false,
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % jsoniterVersion,
"com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal"
)
)
lazy val sharedJVM = shared.jvm
lazy val sharedJS = shared.js
resolvers += Resolver.jcenterRepo
lazy val spores = project
.in(file("spores"))
.settings(commonSettings: _*)
.settings(
name := "tasks-spores",
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal"
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) =>
Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
case _ => Seq.empty
}) ++ List(
"org.scalatest" %% "scalatest" % "3.2.19" % "test"
)
)
lazy val akkaProvided = List(
"com.typesafe.akka" %% "akka-actor" % akkaVersion % Provided,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion % Provided,
"com.typesafe.akka" %% "akka-remote" % akkaVersion % Provided
)
lazy val akkaReal = List(
"com.typesafe.akka" %% "akka-actor" % akkaVersion ,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion ,
"com.typesafe.akka" %% "akka-remote" % akkaVersion
)
lazy val core = project
.in(file("core"))
.settings(commonSettings: _*)
.settings(
name := "tasks-core",
libraryDependencies ++= Seq(
"co.fs2" %% "fs2-io" % fs2Version,
"co.fs2" %% "fs2-reactive-streams" % fs2Version,
"org.http4s" %% "http4s-ember-client" % http4sVersion,
"org.http4s" %% "http4s-ember-server" % http4sVersion,
"org.http4s" %% "http4s-dsl" % http4sVersion,
"software.amazon.awssdk" % "s3" % "2.23.13",
"com.google.guava" % "guava" % "33.0.0-jre", // scala-steward:off
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test",
"com.typesafe" % "config" % "1.4.2",
"org.typelevel" %% "cats-effect" % "3.5.3",
"io.github.pityka" %% "selfpackage" % "2.1.0",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"com.outr" %% "scribe" % scribeVersion,
"com.outr" %% "scribe-slf4j" % scribeVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "test"
) ++ akkaProvided ++ (CrossVersion
.partialVersion(scalaVersion.value) match {
case Some((2, 13)) =>
Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
case _ => Seq.empty
})
)
.dependsOn(sharedJVM, spores)
lazy val ec2 = project
.in(file("ec2"))
.settings(commonSettings: _*)
.settings(
name := "tasks-ec2",
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-ec2" % "1.12.244" // scala-steward:off
) ++ akkaProvided
)
.dependsOn(core)
lazy val ssh = project
.in(file("ssh"))
.settings(commonSettings: _*)
.settings(
name := "tasks-ssh",
libraryDependencies ++= Seq(
"ch.ethz.ganymed" % "ganymed-ssh2" % "262"
) ++ akkaProvided
)
.dependsOn(core % "compile->compile;test->test")
lazy val kubernetes = project
.in(file("kubernetes"))
.settings(commonSettings: _*)
.settings(
name := "tasks-kubernetes",
libraryDependencies ++= Seq(
"com.goyeau" %% "kubernetes-client" % "0.11.0",
"io.github.pityka" %% "selfpackage-jib" % "2.1.3",
) ++ akkaProvided
)
.dependsOn(core % "compile->compile;test->test")
lazy val kubernetesTest = project
.in(file("kubernetes-test"))
.settings(commonSettings: _*)
.settings(
name := "tasks-kubernetes-test",
publish / skip := true,
libraryDependencies ++= akkaReal
)
.enablePlugins(JavaAppPackaging)
.dependsOn(kubernetes)
// lazy val tracker = project
// .in(file("tracker"))
// .settings(commonSettings: _*)
// .settings(
// name := "tasks-tracker",
// libraryDependencies ++= Seq(
// "org.scalatest" %% "scalatest" % "3.2.10" % "test",
// "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal"
// ) ++ akkaProvided,
// // resources in Compile += (fastOptJS in Compile in uifrontend).value.data
// )
// .dependsOn(core % "compile->compile;test->test")
// lazy val uibackend = project
// .in(file("uibackend"))
// .settings(commonSettings: _*)
// .settings(
// name := "tasks-ui-backend",
// libraryDependencies ++= Seq(
// "org.scalatest" %% "scalatest" % "3.2.10" % "test"
// ) ++ akkaProvided,
// resources in Compile += (fastOptJS in Compile in uifrontend).value.data
// )
// .dependsOn(core % "compile->compile;test->test")
// lazy val uifrontend = project
// .in(file("uifrontend"))
// .settings(commonSettings: _*)
// .settings(
// name := "tasks-ui-frontend",
// libraryDependencies ++= Seq(
// "org.scala-js" %%% "scalajs-dom" % "1.2.0",
// "com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-core" % jsoniterVersion,
// "com.github.plokhotnyuk.jsoniter-scala" %%% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal",
// "com.raquo" %%% "laminar" % "0.13.0"
// ),
// mimaPreviousArtifacts := Set.empty,
// fork := false
// )
// .dependsOn(sharedJS)
// .enablePlugins(ScalaJSPlugin)
lazy val example = project
.in(file("example"))
.settings(commonSettings: _*)
.dependsOn(core, ssh)
.enablePlugins(JavaAppPackaging)
.settings(
executableScriptName := "entrypoint",
topLevelDirectory := None,
publishArtifact := false,
publish / skip := true,
libraryDependencies ++= Seq(
("com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal")
) ++ Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.akka" %% "akka-remote" % akkaVersion
)
)
lazy val upicklesupport = project
.in(file("upickle"))
.settings(commonSettings: _*)
.settings(
name := "tasks-upickle",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "upickle" % "1.4.4"
) ++ akkaProvided
)
.dependsOn(core)
lazy val circe = project
.in(file("circe"))
.settings(commonSettings: _*)
.settings(
name := "tasks-circe",
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"org.scalatest" %% "scalatest" % "3.2.19" % "test"
) ++ akkaProvided
)
.dependsOn(core)
lazy val ecoll = project
.in(file("collection"))
.settings(commonSettings: _*)
.settings(
name := "tasks-ecoll",
libraryDependencies ++= Seq(
"io.github.pityka" %% "flatjoin-akka-stream" % "0.0.17",
"io.github.pityka" %% "lame-bgzip-index" % "0.0.4",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoniterVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "compile-internal",
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoniterVersion % "test",
"org.scalatest" %% "scalatest" % "3.2.19" % "test"
) ++ akkaProvided
)
.dependsOn(core)
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true,
crossScalaVersions := Nil
)
.aggregate(
spores,
core,
upicklesupport,
circe,
sharedJVM,
sharedJS,
ec2,
ssh,
// uibackend,
// uifrontend,
kubernetes,
// tracker,
example
)
lazy val testables = (project in file("testables"))
.settings(commonSettings: _*)
.settings(
publishArtifact := false,
publish / skip := true
)
.aggregate(
spores,
core,
upicklesupport,
circe,
sharedJVM
// ssh
)