forked from lagom/lagom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
1589 lines (1464 loc) · 56 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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import java.net.InetSocketAddress
import java.nio.channels.ServerSocketChannel
import com.typesafe.sbt.SbtMultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys._
import com.typesafe.tools.mima.core._
import lagom.Protobuf
import lagom.build._
// Turn off "Resolving" log messages that clutter build logs
ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet
def defineSbtVersion(scalaBinVer: String): String = scalaBinVer match {
case "2.12" => "1.2.8"
case _ => "0.13.18"
}
def evictionSettings: Seq[Setting[_]] = Seq(
// This avoids a lot of dependency resolution warnings to be showed.
// They are not required in Lagom since we have a more strict whitelist
// of which dependencies are allowed. So it should be safe to not have
// the build logs polluted with evictions warnings.
evictionWarningOptions in update := EvictionWarningOptions.default
.withWarnTransitiveEvictions(false)
.withWarnDirectEvictions(false)
)
def overridesScalaParserCombinators = Seq(
dependencyOverrides ++= Dependencies.scalaParserCombinatorOverrides
)
def common: Seq[Setting[_]] = releaseSettings ++ bintraySettings ++ evictionSettings ++ Seq(
organization := "com.lightbend.lagom",
// Must be "Apache-2.0", because bintray requires that it is a license that it knows about
licenses := Seq(("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html"))),
homepage := Some(url("https://www.lagomframework.com/")),
sonatypeProfileName := "com.lightbend",
headerLicense := Some(
HeaderLicense.Custom(
// When updating, keep in sync with docs/build.sbt configuration
"Copyright (C) 2016-2019 Lightbend Inc. <https://www.lightbend.com>"
)
),
pomExtra := {
<scm>
<url>https://github.com/lagom/lagom</url>
<connection>scm:git:git@github.com:lagom/lagom.git</connection>
</scm>
<developers>
<developer>
<id>lagom</id>
<name>Lagom Contributors</name>
<url>https://github.com/lagom</url>
</developer>
</developers>
},
pomIncludeRepository := { _ =>
false
},
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
scalacOptions in (Compile, doc) ++= (scalaBinaryVersion.value match {
case "2.12" => Seq("-no-java-comments")
case _ => Seq.empty
}),
// Setting javac options in common allows IntelliJ IDEA to import them automatically
javacOptions in compile ++= Seq(
"-encoding",
"UTF-8",
"-source",
"1.8",
"-target",
"1.8",
"-parameters",
"-Xlint:unchecked",
"-Xlint:deprecation"
),
LagomPublish.validatePublishSettingsSetting
)
def bintraySettings: Seq[Setting[_]] = Seq(
bintrayOrganization := Some("lagom"),
bintrayRepository := "sbt-plugin-releases",
bintrayPackage := "lagom-sbt-plugin",
bintrayReleaseOnPublish := false
)
// Customise sbt-dynver's behaviour to make it work with Lagom's tags (which aren't v-prefixed)
dynverVTagPrefix in ThisBuild := false
// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Global / onLoad := (Global / onLoad).value.andThen { s =>
val v = version.value
if (dynverGitDescribeOutput.value.hasNoTags)
throw new MessageOnlyException(
s"Failed to derive version from git tags. Maybe run `git fetch --unshallow`? Version: $v"
)
s
}
def releaseSettings: Seq[Setting[_]] = Seq(
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseTagName := (version in ThisBuild).value,
releaseProcess := {
import ReleaseTransformations._
Seq[ReleaseStep](
checkSnapshotDependencies,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepTask(bintrayRelease in thisProjectRef.value),
releaseStepCommand("sonatypeRelease"),
pushChanges
)
}
)
/**
* sbt release's releaseStepCommand does not execute remaining commands, which sbt-doge relies on
*/
def releaseStepCommandAndRemaining(command: String): State => State = { originalState =>
import sbt.complete.Parser
// Capture current remaining commands
val originalRemaining = originalState.remainingCommands
def runCommand(command: String, state: State): State = {
val newState = Parser.parse(command, state.combinedParser) match {
case Right(cmd) => cmd()
case Left(msg) => throw sys.error(s"Invalid programmatic input:\n$msg")
}
if (newState.remainingCommands.isEmpty) {
newState
} else {
runCommand(
newState.remainingCommands.head.commandLine,
newState.copy(remainingCommands = newState.remainingCommands.tail)
)
}
}
runCommand(command, originalState.copy(remainingCommands = Nil)).copy(remainingCommands = originalRemaining)
}
def sonatypeSettings: Seq[Setting[_]] = Seq(
publishTo := sonatypePublishTo.value
)
def runtimeScalaSettings: Seq[Setting[_]] = Seq(
crossScalaVersions := Dependencies.Versions.Scala,
scalaVersion := Dependencies.Versions.Scala.head,
// compile options
scalacOptions in Compile ++= Seq(
"-encoding",
"UTF-8",
"-target:jvm-1.8",
"-feature",
"-unchecked",
"-Xlog-reflective-calls",
"-deprecation"
)
)
def runtimeLibCommon: Seq[Setting[_]] = common ++ sonatypeSettings ++ runtimeScalaSettings ++ Seq(
Dependencies.validateDependenciesSetting,
Dependencies.pruneWhitelistSetting,
Dependencies.dependencyWhitelistSetting,
// show full stack traces and test case durations
testOptions in Test += Tests.Argument("-oDF"),
// -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug".
// -a Show stack traces and exception class name for AssertionErrors.
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a")
)
val defaultMultiJvmOptions: List[String] = {
import scala.collection.JavaConverters._
// multinode.D= and multinode.X= makes it possible to pass arbitrary
// -D or -X arguments to the forked jvm, e.g.
// -Djava.net.preferIPv4Stack=true or -Dmultinode.Xmx512m
val MultinodeJvmArgs = "multinode\\.(D|X)(.*)".r
val knownPrefix = Set("akka.", "lagom.")
val properties = System.getProperties.stringPropertyNames.asScala.toList.collect {
case MultinodeJvmArgs(a, b) =>
val value = System.getProperty("multinode." + a + b)
"-" + a + b + (if (value == "") "" else "=" + value)
case key if knownPrefix.exists(pre => key.startsWith(pre)) => "-D" + key + "=" + System.getProperty(key)
}
"-Xmx128m" :: properties
}
def databasePortSetting: List[String] = {
def gimmePort = {
val serverSocket = ServerSocketChannel.open().socket()
try {
serverSocket.bind(new InetSocketAddress("127.0.0.1", 0))
serverSocket.getLocalPort
} finally serverSocket.close()
}
List(
s"-Djavadsl.database.port=$gimmePort",
s"-Dscaladsl.database.port=$gimmePort",
)
}
def multiJvmTestSettings: Seq[Setting[_]] = {
// change multi-jvm lib folder to reflect the scala version used during crossbuild
// must be done using a dynamic setting because we must read crossTarget.value
def crossbuildMultiJvm = Def.settingDyn {
val path = crossTarget.value.getName
Def.setting {
target.apply { targetFile =>
new File(targetFile, path + "/multi-run-copied-libraries")
}.value
}
}
SbtMultiJvm.multiJvmSettings ++
forkedTests ++
// enabling HeaderPlugin in MultiJvm requires two sets of settings.
// see https://github.com/sbt/sbt-header/issues/37
headerSettings(MultiJvm) ++
automateHeaderSettings(MultiJvm) ++
Seq(
parallelExecution in Test := false,
MultiJvmKeys.jvmOptions in MultiJvm := databasePortSetting ::: defaultMultiJvmOptions,
// make sure that MultiJvm test are compiled by the default test compilation
compile in MultiJvm := (compile in MultiJvm).triggeredBy(compile in Test).value,
// tag MultiJvm tests so that we can use concurrentRestrictions to disable parallel tests
executeTests in MultiJvm := (executeTests in MultiJvm).tag(Tags.Test).value,
// make sure that MultiJvm tests are executed by the default test target,
// and combine the results from ordinary test and multi-jvm tests
executeTests in Test := {
val testResults = (executeTests in Test).value
val multiNodeResults = (executeTests in MultiJvm).value
import TestResult.Error
import TestResult.Failed
import TestResult.Passed
val overall = (testResults.overall, multiNodeResults.overall) match {
case (Passed, Passed) => Passed
case (Failed, Failed) => Failed
case (Error, Error) => Error
case (Passed, Failed) | (Failed, Passed) => Failed
case (Passed, Error) | (Error, Passed) => Error
case (Failed, Error) | (Error, Failed) => Error
}
Tests.Output(
overall,
testResults.events ++ multiNodeResults.events,
testResults.summaries ++ multiNodeResults.summaries
)
},
// change multi-jvm lib folder to reflect the scala version used during crossbuild
multiRunCopiedClassLocation in MultiJvm := crossbuildMultiJvm.value
)
}
def macroCompileSettings: Seq[Setting[_]] = Seq(
compile in Test ~= { a =>
// Delete classes in "compile" packages after compiling.
// These are used for compile-time tests and should be recompiled every time.
val products = (a.asInstanceOf[sbt.internal.inc.Analysis]).relations.allProducts.toSeq ** new SimpleFileFilter(
_.getParentFile.getName == "compile"
)
IO.delete(products.get)
a
}
)
val version150 = "1.5.0"
val version151 = "1.5.1"
def mimaSettings(since: String): Seq[Setting[_]] = {
val versions = Seq(since)
Seq(
mimaPreviousArtifacts := {
scalaVersionFilter(scalaBinaryVersion.value, versions).map { version =>
organization.value % s"${moduleName.value}_${scalaBinaryVersion.value}" % version
}.toSet
},
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[Problem]("com.lightbend.lagom.internal.*"),
ProblemFilters.exclude[Problem]("com.lightbend.lagom.*Components*"),
ProblemFilters.exclude[Problem]("com.lightbend.lagom.*Module*"),
ProblemFilters
.exclude[DirectMissingMethodProblem]("*lagom.*dsl.persistence.PersistentEntityRegistry.gracefulShutdown"),
// Remove APIs deprecated in Lagom 1.3.x: https://github.com/lagom/lagom/pull/1967
ProblemFilters
.exclude[DirectMissingMethodProblem]("com.lightbend.lagom.javadsl.api.ServiceInfo.getLocatableServices"),
ProblemFilters.exclude[DirectMissingMethodProblem]("com.lightbend.lagom.javadsl.api.ServiceInfo.this"),
ProblemFilters.exclude[IncompatibleResultTypeProblem](
"com.lightbend.lagom.scaladsl.api.ServiceInfo#ServiceInfoImpl.copy$default$2"
),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.api.ServiceInfo#ServiceInfoImpl.copy"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"com.lightbend.lagom.scaladsl.api.ServiceInfo#ServiceInfoImpl.locatableServices"
),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.api.ServiceInfo#ServiceInfoImpl.this"),
ProblemFilters
.exclude[DirectMissingMethodProblem]("com.lightbend.lagom.scaladsl.api.ServiceInfo.locatableServices"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.api.ServiceInfo#ServiceInfoImpl.apply"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"com.lightbend.lagom.scaladsl.server.LagomApplicationLoader.describeServices"
),
ProblemFilters.exclude[DirectMissingMethodProblem]("com.lightbend.lagom.scaladsl.server.LagomServer.forServices"),
ProblemFilters
.exclude[DirectMissingMethodProblem]("com.lightbend.lagom.scaladsl.server.LagomServer.serviceBindings"),
ProblemFilters.exclude[ReversedMissingMethodProblem](
"com.lightbend.lagom.scaladsl.server.LagomServer.serviceBinding"
),
// Remove APIs deprecated in Lagom 1.4.x: https://github.com/lagom/lagom/pull/1987
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.api.AdditionalConfiguration.++"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.api.AdditionalConfiguration.this"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.client.ConfigurationServiceLocator.this"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.client.CircuitBreakingServiceLocator.this"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.client.RoundRobinServiceLocator.this"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.scaladsl.client.StaticServiceLocator.this"),
ProblemFilters
.exclude[IncompatibleMethTypeProblem]("com.lightbend.lagom.javadsl.client.CircuitBreakingServiceLocator.this"),
ProblemFilters
.exclude[MissingClassProblem]("com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraContactPoint"),
ProblemFilters.exclude[MissingClassProblem]("com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraConfig"),
ProblemFilters
.exclude[MissingClassProblem]("com.lightbend.lagom.scaladsl.persistence.cassandra.CassandraContactPoint$"),
ProblemFilters.exclude[MissingClassProblem]("com.lightbend.lagom.javadsl.persistence.cassandra.CassandraConfig"),
ProblemFilters
.exclude[MissingClassProblem]("com.lightbend.lagom.javadsl.persistence.cassandra.CassandraContactPoint"),
)
)
}
def scalaVersionFilter(scalaBinaryVersion: String, versions: Seq[String]): Seq[String] = {
// parse version into (major, minor, patch) for comparison
def Version(version: String): (String, String, String) = version.split(".", 3).toSeq match {
case Seq(major, minor, patch) => (major, minor, patch)
case _ => throw new IllegalArgumentException("version does not match major.minor.patch format")
}
import scala.math.Ordering.Implicits._
val sinceVersion = Version(scalaVersionSince.getOrElse(scalaBinaryVersion, "1.0.0"))
versions.filter(Version(_) >= sinceVersion)
}
def scalaVersionSince = Map(
"2.12" -> "1.4.0"
)
val javadslProjects = Seq[Project](
`api-javadsl`,
`server-javadsl`,
`client-javadsl`,
`broker-javadsl`,
`kafka-client-javadsl`,
`kafka-broker-javadsl`,
`akka-management-javadsl`,
`akka-discovery-service-locator-javadsl`,
`cluster-javadsl`,
`persistence-javadsl`,
`persistence-cassandra-javadsl`,
`persistence-jdbc-javadsl`,
`persistence-jpa-javadsl`,
`pubsub-javadsl`,
jackson,
`testkit-javadsl`,
immutables,
`integration-client-javadsl`
)
val scaladslProjects = Seq[Project](
`api-scaladsl`,
`client-scaladsl`,
`broker-scaladsl`,
`kafka-client-scaladsl`,
`kafka-broker-scaladsl`,
`server-scaladsl`,
`akka-management-scaladsl`,
`akka-discovery-service-locator-scaladsl`,
`cluster-scaladsl`,
`persistence-scaladsl`,
`persistence-cassandra-scaladsl`,
`persistence-jdbc-scaladsl`,
`pubsub-scaladsl`,
`testkit-scaladsl`,
`devmode-scaladsl`,
`play-json`
)
val coreProjects = Seq[Project](
`api-tools`,
api,
client,
server,
spi,
`akka-management-core`,
`akka-discovery-service-locator-core`,
`cluster-core`,
`kafka-client`,
`kafka-broker`,
`persistence-core`,
`persistence-testkit`,
`persistence-cassandra-core`,
`persistence-jdbc-core`,
`testkit-core`,
logback,
log4j2
)
val otherProjects = devEnvironmentProjects ++ Seq[Project](
`integration-tests-javadsl`,
`integration-tests-scaladsl`,
`macro-testkit`
)
val sbtScriptedProjects = Seq[Project](
`sbt-scripted-tools`,
`sbt-scripted-library`
)
lazy val root = (project in file("."))
.settings(name := "lagom")
.settings(runtimeLibCommon: _*)
.settings(
crossScalaVersions := Nil,
scalaVersion := Dependencies.Versions.Scala.head,
PgpKeys.publishSigned := {},
publishLocal := {},
publishArtifact in Compile := false,
publish := {}
)
.enablePlugins(lagom.UnidocRoot)
.settings(
UnidocRoot.settings(javadslProjects.map(Project.projectToRef), scaladslProjects.map(Project.projectToRef)): _*
)
.aggregate(
(javadslProjects ++ scaladslProjects ++ coreProjects ++ otherProjects ++ sbtScriptedProjects)
.map(Project.projectToRef): _*
)
def RuntimeLibPlugins = AutomateHeaderPlugin && Sonatype && PluginsAccessor.exclude(BintrayPlugin) && Unidoc
def SbtPluginPlugins = AutomateHeaderPlugin && BintrayPlugin && PluginsAccessor.exclude(Sonatype)
lazy val api = (project in file("service/core/api"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-api",
Dependencies.api
)
lazy val `api-javadsl` = (project in file("service/javadsl/api"))
.settings(name := "lagom-javadsl-api")
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
Dependencies.`api-javadsl`
)
.dependsOn(api)
lazy val `api-scaladsl` = (project in file("service/scaladsl/api"))
.settings(name := "lagom-scaladsl-api")
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
Dependencies.`api-scaladsl`
)
.dependsOn(api)
lazy val immutables = (project in file("immutables"))
.settings(name := "lagom-javadsl-immutables")
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
Dependencies.immutables
)
lazy val spi = (project in file("spi"))
.settings(name := "lagom-spi")
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
lazy val jackson = (project in file("jackson"))
.settings(name := "lagom-javadsl-jackson")
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(Dependencies.jackson)
.dependsOn(`api-javadsl`, immutables % "test->compile")
lazy val `play-json` = (project in file("play-json"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-scaladsl-play-json",
Dependencies.`play-json`
)
lazy val `api-tools` = (project in file("api-tools"))
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
Dependencies.`api-tools`
)
.settings(overridesScalaParserCombinators: _*)
.dependsOn(
spi,
`server-javadsl` % Test,
`server-scaladsl` % Test
)
lazy val client = (project in file("service/core/client"))
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-client",
Dependencies.client
)
.dependsOn(api, spi)
lazy val `client-javadsl` = (project in file("service/javadsl/client"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-javadsl-client",
Dependencies.`client-javadsl`
)
.dependsOn(client, `api-javadsl`, jackson)
lazy val `client-scaladsl` = (project in file("service/scaladsl/client"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(macroCompileSettings: _*)
.settings(
name := "lagom-scaladsl-client",
Dependencies.`client-scaladsl`
)
.dependsOn(client, `api-scaladsl`, `macro-testkit` % Test)
lazy val `integration-client-javadsl` = (project in file("service/javadsl/integration-client"))
.settings(
name := "lagom-javadsl-integration-client",
Dependencies.`integration-client-javadsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.dependsOn(`client-javadsl`, `service-registry-client-javadsl`, `kafka-client-javadsl`)
lazy val server = (project in file("service/core/server"))
.settings(
name := "lagom-server",
Dependencies.server
)
.enablePlugins(RuntimeLibPlugins)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.dependsOn(client)
lazy val `server-javadsl` = (project in file("service/javadsl/server"))
.settings(
name := "lagom-javadsl-server",
Dependencies.`server-javadsl`
)
.enablePlugins(RuntimeLibPlugins)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.dependsOn(`akka-management-javadsl`, server, `client-javadsl`, immutables % "provided")
// bring jackson closer to the root of the dependency tree to prompt Maven to choose the right version
.dependsOn(jackson)
lazy val `server-scaladsl` = (project in file("service/scaladsl/server"))
.settings(
name := "lagom-scaladsl-server",
Dependencies.`server-scaladsl`
)
.enablePlugins(RuntimeLibPlugins)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.dependsOn(`akka-management-scaladsl`, server, `client-scaladsl`, `play-json`)
lazy val `testkit-core` = (project in file("testkit/core"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-core-testkit",
Dependencies.`testkit-core`
)
.settings(overridesScalaParserCombinators: _*)
.settings(forkedTests: _*)
.dependsOn(
`dev-mode-ssl-support`, // TODO: remove this when SSLContext provider is promoted to play or ssl-config
// Ideally, this would be the other way around,
// but it will require some more refactoring
`persistence-testkit`
)
lazy val `testkit-javadsl` = (project in file("testkit/javadsl"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(forkedTests: _*)
.settings(
name := "lagom-javadsl-testkit",
Dependencies.`testkit-javadsl`
)
.settings(overridesScalaParserCombinators: _*)
.dependsOn(
`testkit-core`,
`server-javadsl`,
`pubsub-javadsl`,
`broker-javadsl`,
`dev-mode-ssl-support`, // TODO: remove this when SSLContext provider is promoted to play or ssl-config
`persistence-core` % "compile;test->test",
`persistence-cassandra-javadsl` % "test->test",
`jackson` % "test->test",
`persistence-jdbc-javadsl` % Test
)
lazy val `testkit-scaladsl` = (project in file("testkit/scaladsl"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(forkedTests: _*)
.settings(overridesScalaParserCombinators: _*)
.settings(
name := "lagom-scaladsl-testkit",
Dependencies.`testkit-scaladsl`
)
.dependsOn(
`testkit-core`,
`server-scaladsl`,
`broker-scaladsl`,
`kafka-broker-scaladsl`,
`dev-mode-ssl-support`, // TODO: remove this when SSLContext provider is promoted to play or ssl-config
`persistence-core` % "compile;test->test",
`persistence-scaladsl` % "compile;test->test",
`persistence-cassandra-scaladsl` % "compile;test->test",
`persistence-jdbc-scaladsl` % Test
)
lazy val `integration-tests-javadsl` = (project in file("service/javadsl/integration-tests"))
.settings(runtimeLibCommon: _*)
.enablePlugins(AutomateHeaderPlugin)
.settings(forkedTests: _*)
.settings(
name := "lagom-javadsl-integration-tests",
Dependencies.`integration-tests-javadsl`,
PgpKeys.publishSigned := {},
publish := {}
)
.dependsOn(
`server-javadsl`,
`persistence-cassandra-javadsl`,
`pubsub-javadsl`,
`testkit-javadsl`,
logback,
`integration-client-javadsl`
)
lazy val `integration-tests-scaladsl` = (project in file("service/scaladsl/integration-tests"))
.settings(runtimeLibCommon: _*)
.enablePlugins(AutomateHeaderPlugin)
.settings(forkedTests: _*)
.settings(
name := "lagom-scaladsl-integration-tests",
Dependencies.`integration-tests-scaladsl`,
PgpKeys.publishSigned := {},
publish := {}
)
.dependsOn(`server-scaladsl`, logback, `testkit-scaladsl`)
// for forked tests
def forkedTests: Seq[Setting[_]] = Seq(
fork in Test := true,
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
javaOptions in Test ++= Seq("-Xms256M", "-Xmx512M"),
testGrouping in Test := singleTestsGrouping((definedTests in Test).value)
)
// group tests, a single test per group
def singleTestsGrouping(tests: Seq[TestDefinition]) = {
// We could group non Cassandra tests into another group
// to avoid new JVM for each test, see http://www.scala-sbt.org/release/docs/Testing.html
val javaOptions = Vector("-Xms256M", "-Xmx512M")
tests.map { test =>
Tests.Group(
name = test.name,
tests = Seq(test),
runPolicy = Tests.SubProcess(ForkOptions().withRunJVMOptions(javaOptions))
)
}
}
lazy val `akka-discovery-service-locator-core` = (project in file("akka-service-locator/core"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version151): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-akka-discovery-service-locator-core",
Dependencies.`lagom-akka-discovery-service-locator-core`
)
lazy val `akka-discovery-service-locator-javadsl` = (project in file("akka-service-locator/javadsl"))
.dependsOn(`akka-discovery-service-locator-core`)
.dependsOn(`client-javadsl`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version151): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-javadsl-akka-discovery-service-locator"
)
lazy val `akka-discovery-service-locator-scaladsl` = (project in file("akka-service-locator/scaladsl"))
.dependsOn(`akka-discovery-service-locator-core`)
.dependsOn(`client-scaladsl`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version151): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-scaladsl-akka-discovery-service-locator",
Dependencies.`lagom-akka-discovery-service-locator-scaladsl`
)
.dependsOn(`testkit-scaladsl`)
lazy val `akka-management-core` = (project in file("akka-management/core"))
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-akka-management-core",
Dependencies.`akka-management-core`
)
lazy val `akka-management-javadsl` = (project in file("akka-management/javadsl"))
.dependsOn(`akka-management-core`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-akka-management-javadsl",
Dependencies.`akka-management-javadsl`
)
lazy val `akka-management-scaladsl` = (project in file("akka-management/scaladsl"))
.dependsOn(`akka-management-core`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-akka-management-scaladsl",
Dependencies.`akka-management-scaladsl`
)
lazy val `cluster-core` = (project in file("cluster/core"))
.dependsOn(`akka-management-core`)
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-cluster-core",
Dependencies.`cluster-core`
)
lazy val `cluster-javadsl` = (project in file("cluster/javadsl"))
.dependsOn(`akka-management-javadsl`, `cluster-core`, jackson)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-javadsl-cluster",
Dependencies.`cluster-javadsl`
)
.configs(MultiJvm)
lazy val `cluster-scaladsl` = (project in file("cluster/scaladsl"))
.dependsOn(`akka-management-scaladsl`, `cluster-core`, `play-json`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-scaladsl-cluster",
Dependencies.`cluster-scaladsl`
)
.configs(MultiJvm)
lazy val `pubsub-javadsl` = (project in file("pubsub/javadsl"))
.dependsOn(`cluster-javadsl`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-javadsl-pubsub",
Dependencies.`pubsub-javadsl`
)
.configs(MultiJvm)
lazy val `pubsub-scaladsl` = (project in file("pubsub/scaladsl"))
.dependsOn(`cluster-scaladsl`)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-scaladsl-pubsub",
Dependencies.`pubsub-scaladsl`
)
.configs(MultiJvm)
lazy val `persistence-core` = (project in file("persistence/core"))
.dependsOn(`cluster-core`, logback % Test)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(Protobuf.settings)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-persistence-core",
Dependencies.`persistence-core`
)
lazy val `persistence-testkit` = (project in file("persistence/testkit"))
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-persistence-testkit",
Dependencies.`persistence-testkit`
)
lazy val `persistence-javadsl` = (project in file("persistence/javadsl"))
.settings(
name := "lagom-javadsl-persistence",
Dependencies.`persistence-javadsl`
)
.dependsOn(
`persistence-core` % "compile;test->test",
`persistence-testkit`,
jackson,
`cluster-javadsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(Protobuf.settings)
.enablePlugins(RuntimeLibPlugins)
lazy val `persistence-scaladsl` = (project in file("persistence/scaladsl"))
.settings(
name := "lagom-scaladsl-persistence",
Dependencies.`persistence-scaladsl`
)
.dependsOn(
`persistence-core` % "compile;test->test",
`persistence-testkit`,
`play-json`,
`cluster-scaladsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(Protobuf.settings)
.enablePlugins(RuntimeLibPlugins)
lazy val `persistence-cassandra-core` = (project in file("persistence-cassandra/core"))
.dependsOn(`persistence-core` % "compile;test->test")
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-persistence-cassandra-core",
Dependencies.`persistence-cassandra-core`
)
lazy val `persistence-cassandra-javadsl` = (project in file("persistence-cassandra/javadsl"))
.settings(
name := "lagom-javadsl-persistence-cassandra",
Dependencies.`persistence-cassandra-javadsl`
)
.dependsOn(
`persistence-core` % "compile;test->test",
`persistence-javadsl` % "compile;test->test",
`persistence-cassandra-core` % "compile;test->test",
`api-javadsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings()
.configs(MultiJvm)
lazy val `persistence-cassandra-scaladsl` = (project in file("persistence-cassandra/scaladsl"))
.settings(
name := "lagom-scaladsl-persistence-cassandra",
Dependencies.`persistence-cassandra-scaladsl`
)
.dependsOn(
`persistence-core` % "compile;test->test",
`persistence-scaladsl` % "compile;test->test",
`persistence-cassandra-core` % "compile;test->test",
`api-scaladsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings()
.configs(MultiJvm)
lazy val `persistence-jdbc-core` = (project in file("persistence-jdbc/core"))
.dependsOn(
`persistence-core` % "compile;test->test"
)
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(forkedTests: _*)
.settings(
name := "lagom-persistence-jdbc-core",
Dependencies.`persistence-jdbc-core`
)
lazy val `persistence-jdbc-javadsl` = (project in file("persistence-jdbc/javadsl"))
.settings(
name := "lagom-javadsl-persistence-jdbc",
Dependencies.`persistence-jdbc-javadsl`
)
.dependsOn(
`persistence-jdbc-core` % "compile;test->test",
`persistence-core` % "compile;test->test",
`persistence-javadsl` % "compile;test->test"
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(forkedTests: _*)
.configs(MultiJvm)
lazy val `persistence-jdbc-scaladsl` = (project in file("persistence-jdbc/scaladsl"))
.settings(
name := "lagom-scaladsl-persistence-jdbc",
Dependencies.`persistence-jdbc-scaladsl`
)
.dependsOn(
`persistence-jdbc-core` % "compile;test->test",
`persistence-core` % "compile;test->test",
`persistence-scaladsl` % "compile;test->test"
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.settings(multiJvmTestSettings: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(forkedTests: _*)
.configs(MultiJvm)
lazy val `persistence-jpa-javadsl` = (project in file("persistence-jpa/javadsl"))
.dependsOn(`persistence-jdbc-javadsl` % "compile;test->test")
.settings(runtimeLibCommon: _*)
.enablePlugins(RuntimeLibPlugins)
.settings(forkedTests: _*)
.settings(
name := "lagom-javadsl-persistence-jpa",
Dependencies.`persistence-jpa-javadsl`,
Dependencies.dependencyWhitelist ++= Dependencies.JpaTestWhitelist
)
lazy val `broker-javadsl` = (project in file("service/javadsl/broker"))
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-javadsl-broker",
Dependencies.`broker-javadsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.dependsOn(`api-javadsl`, `persistence-javadsl`)
lazy val `broker-scaladsl` = (project in file("service/scaladsl/broker"))
.enablePlugins(RuntimeLibPlugins)
.settings(
name := "lagom-scaladsl-broker",
Dependencies.`broker-scaladsl`
)
.settings(runtimeLibCommon: _*)
.settings(mimaSettings(since = version150): _*)
.dependsOn(`api-scaladsl`, `persistence-scaladsl`)
lazy val `kafka-client` = (project in file("service/core/kafka/client"))
.enablePlugins(RuntimeLibPlugins)