This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sc
2562 lines (2390 loc) · 82.2 KB
/
build.sc
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 $ivy.`com.lihaoyi::mill-contrib-scoverage:$MILL_VERSION`
import coursier.Repository
import mill.api.Loose
import mill.define.{Sources, Target, Task}
import mill.modules.{Jvm, Util}
import mill.scalalib._
import mill.scalalib.publish._
import mill._
import os.{Path, RelPath}
import coursier.maven.MavenRepository
import coursier.core.Authentication
import mill.modules.Jvm.JarManifest
// This import the mill-osgi plugin
import $ivy.`de.tototec::de.tobiasroeser.mill.osgi:0.3.0`
import de.tobiasroeser.mill.osgi._
// imports from the blended-mill plugin
import $ivy.`de.wayofquality.blended::blended-mill:0.4.15`
import de.wayofquality.blended.mill.versioning.GitModule
import de.wayofquality.blended.mill.publish.BlendedPublishModule
import de.wayofquality.blended.mill.webtools.WebTools
import de.wayofquality.blended.mill.modules._
import de.wayofquality.blended.mill.utils._
import de.wayofquality.blended.mill.feature._
import $file.build_util
import build_util.ScoverageReport
trait CoreDependencies extends BlendedDependencies
object CoreDependencies {
def scalaVersions: Map[String, CoreDependencies] =
Seq(Deps_2_13).map(d => d.scalaVersion -> d).toMap
object Deps_2_13 extends CoreDependencies {
override def scalaVersion = "2.13.6"
override def slf4jVersion = "1.7.32"
override def logbackCore = ivy"ch.qos.logback:logback-core:1.2.11"
override def logbackClassic = ivy"ch.qos.logback:logback-classic:1.2.11"
}
/////////////////////////////////////////////////////////////////////////////////////
/** Project directory. */
}
val projectDir: os.Path = build.millSourcePath
/** The revision of bundles provided via akka-osgi */
val akkaBundleRevision: String = "1"
object GitSupport extends GitModule {
override def millSourcePath: Path = projectDir
}
def blendedVersion = T { GitSupport.publishVersion() }
/** Configure additional repositories. */
trait CoreCoursierModule extends CoursierModule {
private def zincWorker: ZincWorkerModule = mill.scalalib.ZincWorkerModule
override def repositories: Seq[Repository] = {
zincWorker.repositories ++ Seq(
MavenRepository(s"file://${System.getProperty("user.home")}/.m2/repository"),
MavenRepository("https://repo.spring.io/libs-release"),
MavenRepository("http://repository.springsource.com/maven/bundles/release"),
MavenRepository("http://repository.springsource.com/maven/bundles/external")
)
}
}
/** Configure plublish settings. */
trait CorePublishModule extends BlendedPublishModule {
override def description: T[String] = s"Blended module ${artifactName()}"
def githubRepo: String = "blended"
def scpTargetDir: String = "blended"
override def publishVersion = T { blendedVersion() }
}
trait DistModule extends CoreCoursierModule {
def deps: CoreDependencies
override def millSourcePath: Path = super.millSourcePath / os.up
/** Sources to put into the dist file. */
def sources: Sources
/** Sources to put into the dist file after filtering */
def filteredSources: Sources
/** Filter properties to apply to [[filteredSources]]. */
def filterProperties: Target[Map[String, String]]
/** Dependencies to put under lib directory inside the dist. */
def libIvyDeps: Target[Loose.Agg[Dep]] = T { Agg.empty[Dep] }
/** Dependencies to put under lib directory inside the dist. */
def libModules: Seq[PublishModule] = Seq()
def filterRegex: String = "[@]([^\\n]+?)[@]"
def scalaVersion: Target[String] = T { deps.scalaVersion }
def expandedFilteredSources: Target[PathRef] =
T {
val dest = T.ctx().dest
FilterUtil.filterDirs(
unfilteredResourcesDirs = filteredSources().map(_.path),
pattern = filterRegex,
filterTargetDir = dest,
props = filterProperties(),
failOnMiss = true
)
PathRef(dest)
}
def transitiveLibModules: Seq[PublishModule] =
libModules.flatMap(_.transitiveModuleDeps).collect { case m: PublishModule => m }.distinct
/**
* The transitive ivy dependencies of this module and all it's upstream modules
*/
def transitiveLibIvyDeps: T[Agg[Dep]] =
T {
libIvyDeps() ++ T.traverse(libModules)(_.transitiveIvyDeps)().flatten
}
def distName: T[String] = T { "out" }
override def resolveCoursierDependency: Task[Dep => coursier.Dependency] =
T.task {
Lib.depToDependency(_: Dep, scalaVersion(), "")
}
def resolvedLibs: Target[PathRef] =
T {
val dest = T.dest
val libs = Target.traverse(transitiveLibModules)(m =>
T.task {
(m.artifactId(), m.publishVersion(), m.jar().path)
}
)()
libs.foreach {
case (aId, version, jar) =>
val target = dest / "lib" / s"${aId}-${version}.jar"
os.copy(jar, target, createFolders = true)
}
val jars = resolveDeps(transitiveLibIvyDeps)().map(_.path)
jars.iterator.foreach { jar =>
os.copy(jar, dest / "lib" / jar.last, createFolders = true)
}
PathRef(dest)
}
/** Creates the distribution zip file */
def zip: T[PathRef] =
T {
val dirs =
sources().map(_.path) ++ Seq(
expandedFilteredSources().path,
resolvedLibs().path
)
Jvm.createJar(dirs)
}
}
object blended extends Cross[BlendedCross](CoreDependencies.scalaVersions.keys.toSeq: _*)
class BlendedCross(crossScalaVersion: String) extends GenIdeaModule { blended =>
override def skipIdea: Boolean = crossScalaVersion != CoreDependencies.Deps_2_13.scalaVersion
// correct the unneeded cross sub-dir
override def millSourcePath: Path = super.millSourcePath / os.up
val deps = CoreDependencies.scalaVersions(crossScalaVersion)
trait CoreModule extends BlendedBaseModule with BlendedOsgiModule with CoreCoursierModule with CorePublishModule {
override def scalaVersion: T[String] = deps.scalaVersion
override def baseDir: os.Path = projectDir
override type ProjectDeps = CoreDependencies
override def deps = blended.deps
// remove the scala version
override def skipIdea: Boolean = crossScalaVersion != CoreDependencies.Deps_2_13.scalaVersion
trait CoreTests extends super.BlendedTests {
override def skipIdea: Boolean = crossScalaVersion != CoreDependencies.Deps_2_13.scalaVersion
}
trait CoreForkedTests extends super.BlendedForkedTests {
override def skipIdea: Boolean = crossScalaVersion != CoreDependencies.Deps_2_13.scalaVersion
}
}
object activemq extends Module {
object brokerstarter extends CoreModule {
override def description =
"""A simple wrapper around an Active MQ broker that makes sure that the broker is completely
|started before exposing a connection factory OSGi service""".stripMargin
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.activeMqBroker,
deps.activeMqSpring,
deps.springBeans,
deps.springContext,
deps.springCore
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.akka,
blended.jms.utils,
blended.security.boot,
blended.security
)
override def osgiHeaders =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Some(s"${blendedModule}.internal.BrokerActivator")
)
}
override def testGroups: Map[String, Set[String]] =
Map(
"BrokerActivatorSpec" -> Set("blended.activemq.brokerstarter.internal.BrokerActivatorSpec")
)
object test extends Cross[Test](crossTestGroups: _*)
class Test(override val testGroup: String) extends CoreForkedTests {
override def otherModule: CoreForkedTests = brokerstarter.test(otherTestGroup)
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.akkaSlf4j(akkaBundleRevision),
deps.activeMqKahadbStore,
deps.springCore,
deps.springBeans,
deps.springContext,
deps.springExpression
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)
}
}
object client extends CoreModule {
override def description = "An Active MQ Connection factory as a service"
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.activeMqClient
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.util,
blended.util.logging,
blended.jms.utils,
blended.akka,
blended.streams
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Some(s"${blendedModule}.internal.AmqClientActivator")
)
}
override def testGroups: Map[String, Set[String]] =
Map(
"DefaultClientActivatorSpec" -> Set("blended.activemq.client.internal.DefaultClientActivatorSpec"),
"SlowRoundtripSpec" -> Set("blended.activemq.client.internal.SlowRoundtripSpec"),
"FailingClientActivatorSpec" -> Set("blended.activemq.client.internal.FailingClientActivatorSpec"),
"RoundtripConnectionVerifierSpec" -> Set("blended.activemq.client.internal.RoundtripConnectionVerifierSpec")
)
object test extends Cross[Test](crossTestGroups: _*)
class Test(override val testGroup: String) extends CoreForkedTests {
override def otherModule: CoreForkedTests = client.test(otherTestGroup)
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.akkaSlf4j(akkaBundleRevision),
deps.activeMqBroker,
deps.activeMqKahadbStore
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)
}
}
}
object aws extends Module {
object s3 extends CoreModule {
override def description =
"""A simple service to download files using the Amazon S3 protocol."""
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.httpComponents
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.util.logging,
blended.container.context.api,
blended.domino,
blended.akka.http
)
object test extends CoreTests {
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)
}
}
}
object akka extends CoreModule {
override def description = "Provide OSGi services and API to use Actors in OSGi bundles with a shared ActorSystem."
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.orgOsgi,
deps.akkaActor(akkaBundleRevision),
deps.akkaStream(akkaBundleRevision),
deps.domino
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.util.logging,
blended.container.context.api,
blended.domino
)
override def essentialImportPackage: Seq[String] =
super.essentialImportPackage ++ Seq(
"""akka.stream;version="[2.6,3)"""",
"""akka.stream.serialization;version="[2.6,3)""""
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Some(s"${blendedModule}.internal.BlendedAkkaActivator")
)
}
object test extends CoreTests {
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)
}
object http extends CoreModule {
override def description = "Provide Akka HTTP support"
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.akkaStream(akkaBundleRevision),
deps.akkaHttp(akkaBundleRevision),
deps.akkaHttpCore(akkaBundleRevision)
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.container.context.api,
blended.domino,
blended.util,
blended.util.logging,
blended.akka,
blended.jmx
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Some(s"${blendedModule}.internal.BlendedAkkaHttpActivator")
)
}
object test extends CoreTests {
override def forkArgs = T { super.forkArgs() ++ Seq("-Dsun.net.client.defaultReadTimeout=3000") }
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.akkaTestkit,
deps.akkaSlf4j(akkaBundleRevision),
deps.mockitoAll,
deps.akkaHttpTestkit,
deps.akkaStreamTestkit,
deps.sttp,
deps.sttpAkka
)
}
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)
}
object jmsqueue extends CoreModule {
override def description = "Provide a simple REST interface to consume messages from JMS Queues"
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.jms11Spec
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.domino,
blended.container.context.api,
blended.akka,
blended.akka.http,
blended.util
)
object test extends CoreTests {
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.sttp,
deps.sttpAkka,
deps.akkaSlf4j(akkaBundleRevision),
deps.akkaTestkit,
deps.akkaStreamTestkit,
deps.akkaHttpTestkit,
deps.activeMqBroker,
deps.activeMqKahadbStore
)
}
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.activemq.brokerstarter,
blended.streams,
blended.testsupport,
blended.testsupport.pojosr
)
}
}
object proxy extends CoreModule {
override def description = "Provide Akka HTTP Proxy support"
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.akkaStream(akkaBundleRevision),
deps.akkaHttp(akkaBundleRevision),
deps.akkaActor(akkaBundleRevision)
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.domino,
blended.container.context.api,
blended.akka,
blended.akka.http,
blended.util,
blended.util.logging
)
object test extends CoreTests {
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.akkaSlf4j(akkaBundleRevision),
deps.akkaTestkit,
deps.akkaStreamTestkit,
deps.akkaHttpTestkit
)
}
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)
}
}
object restjms extends CoreModule {
override def description = "Provide a simple REST interface to perform JMS request / reply operations"
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.akkaStream(akkaBundleRevision),
deps.akkaHttp(akkaBundleRevision),
deps.akkaActor(akkaBundleRevision),
deps.jms11Spec
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.domino,
blended.container.context.api,
blended.akka,
blended.streams,
blended.akka.http,
blended.jms.bridge,
blended.util
)
override def testGroups: Map[String, Set[String]] =
Map(
"JMSRequestorSpec" -> Set("blended.akka.http.restjms.internal.JMSRequestorSpec"),
"JMSChunkedRequestorSpec" -> Set("blended.akka.http.restjms.internal.JMSChunkedRequestorSpec")
)
object test extends Cross[Test](crossTestGroups: _*)
class Test(override val testGroup: String) extends CoreForkedTests {
override def otherModule: CoreForkedTests = restjms.test(otherTestGroup)
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.sttp,
deps.sttpAkka,
deps.activeMqBroker,
deps.activeMqClient,
deps.springBeans,
deps.springContext,
deps.akkaSlf4j(akkaBundleRevision),
deps.akkaTestkit
)
}
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.activemq.brokerstarter,
blended.testsupport.pojosr
)
}
}
object sample extends Module {
object helloworld extends CoreModule {
override def description = "A sample Akka HTTP bases HTTP endpoint for the blended container"
override def millSourcePath: Path = baseDir / "blended.samples" / blendedModule
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.orgOsgi,
deps.orgOsgiCompendium,
deps.slf4j
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.akka,
blended.akka.http
)
override def osgiHeaders =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Option(s"$blendedModule.internal.HelloworldActivator")
)
}
object test extends CoreTests {
override def ivyDeps =
T {
super.ivyDeps() ++ Agg(
deps.slf4jLog4j12,
deps.akkaStreamTestkit,
deps.akkaHttpTestkit
)
}
}
}
}
}
object logging extends CoreModule {
override def description = "Redirect Akka Logging to the Blended logging framework"
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.akkaActor(akkaBundleRevision)
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.util.logging
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Private-Package` = Seq(blendedModule),
`Fragment-Host` = Some(s"${deps.blendedOrg}.akka.actor_${scalaBinVersion()}")
)
}
}
}
object container extends Module {
object context extends Module {
object api extends CoreModule {
override def description = "The API for the Container Context and Identifier Service"
override def ivyDeps =
Agg(
deps.typesafeConfig
)
override def essentialImportPackage: Seq[String] = Seq("blended.launcher.runtime;resolution:=optional")
override def moduleDeps =
Seq(
blended.util.logging,
blended.security.crypto
)
object test extends CoreTests {
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport
)
}
}
object impl extends CoreModule {
override def description = "A simple OSGi service to provide access to the container's config directory"
override def ivyDeps =
Agg(
deps.orgOsgiCompendium,
deps.orgOsgi,
deps.domino,
deps.slf4j,
deps.julToSlf4j,
deps.springExpression,
deps.springCore
)
override def moduleDeps =
Seq(
blended.security.crypto,
blended.container.context.api,
blended.util.logging,
blended.util,
blended.updater.config,
blended.launcher
)
override def essentialImportPackage: Seq[String] = Seq("blended.launcher.runtime;resolution:=optional")
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Some(s"${blendedModule}.internal.ContainerContextActivator")
)
}
object test extends CoreTests {
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.scalacheck
)
}
override def moduleDeps: Seq[JavaModule] =
super.moduleDeps ++ Seq(
blended.testsupport
)
}
}
}
}
object domino extends CoreModule {
override def description = "Blended Domino extension for new Capsule scopes"
override def ivyDeps =
Agg(
deps.typesafeConfig,
deps.domino
)
override def moduleDeps =
Seq(
blended.util.logging,
blended.container.context.api
)
object test extends CoreTests
}
object hawtio extends Module {
object login extends CoreModule {
override def description = "Adding required imports to the hawtio war bundle"
override def essentialImportPackage: Seq[String] =
Seq(
"blended.security.boot",
"com.sun.jndi.ldap;resolution:=optional"
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Fragment-Host` = Some("io.hawt.hawtio-web")
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.security.boot
)
}
}
object itest extends Module {
object runner extends CoreModule {
override def description = "API for long running integration tests"
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Some(s"${blendedModule}.internal.TestRunnerActivator")
)
}
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.domino
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.akka,
blended.domino,
blended.jmx,
blended.util.logging,
blended.util
)
object test extends CoreTests {
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.akkaSlf4j(akkaBundleRevision)
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.itestsupport,
blended.testsupport,
blended.testsupport.pojosr
)
}
}
}
object jetty extends Module {
object boot extends CoreModule {
override def description =
"Bundle wrapping the original jetty boot bundle to dynamically provide SSL Context via OSGI services"
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.jettyUtil,
deps.jettyOsgiBoot
)
}
override def moduleDeps: Seq[PublishModule] =
super.moduleDeps ++ Seq(
blended.domino,
blended.util.logging
)
private val jettyVersion = """version="[9.4,20)""""
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Option(s"${blendedModule}.internal.JettyActivator"),
`Import-Package` = Seq(
s"org.eclipse.jetty.annotations;$jettyVersion;resolution:=optional",
s"org.eclipse.jetty.deploy;$jettyVersion",
s"org.eclipse.jetty.deploy.bindings;$jettyVersion",
s"org.eclipse.jetty.deploy.graph;$jettyVersion",
s"org.eclipse.jetty.http;$jettyVersion",
s"org.eclipse.jetty.server;$jettyVersion",
s"org.eclipse.jetty.server.handler;$jettyVersion",
s"org.eclipse.jetty.util;$jettyVersion",
s"org.eclipse.jetty.util.thread;$jettyVersion",
s"org.eclipse.jetty.util.component;$jettyVersion",
s"org.eclipse.jetty.util.log;$jettyVersion",
s"org.eclipse.jetty.util.resource;$jettyVersion",
s"org.eclipse.jetty.webapp;$jettyVersion",
s"org.eclipse.jetty.xml;$jettyVersion",
s"org.osgi.service.event",
s"javax.mail.*;resolution:=optional",
s"javax.transaction.*;resolution:=optional",
s"org.objectweb.asm;resolution:=optional",
s"org.osgi.service.cm",
s"org.osgi.service.url",
s"org.slf4j",
s"org.xml.sax,org.xml.sax.helpers",
"*"
),
`DynamicImport-Package` = Seq(
s"org.eclipse.jetty.*;$jettyVersion"
),
`Bundle-Classpath` = Seq(".") ++ embeddedJars().map(_.path.last)
)
}
override def embeddedJars: T[Seq[PathRef]] =
T {
super.embeddedJars() ++
resolveDeps(T.task {
Agg(deps.jettyOsgiBoot.exclude("*" -> "*"))
})().toSeq
}
}
}
object jms extends Module {
object bridge extends CoreModule {
override def description = "A generic JMS bridge to connect the local JMS broker to en external JMS"
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.akkaActor(akkaBundleRevision),
deps.akkaStream(akkaBundleRevision),
deps.typesafeConfig
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.util,
blended.util.logging,
blended.jms.utils,
blended.domino,
blended.akka,
blended.streams
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Option(s"${blendedModule}.internal.BridgeActivator")
)
}
override def testGroups: Map[String, Set[String]] =
Map(
"RouteAfterRetrySpec" -> Set("blended.jms.bridge.internal.RouteAfterRetrySpec"),
"InboundRejectBridgeSpec" -> Set("blended.jms.bridge.internal.InboundRejectBridgeSpec"),
"TransactionSendFailedRejectBridgeSpec" -> Set(
"blended.jms.bridge.internal.TransactionSendFailedRejectBridgeSpec"
),
"TransactionSendFailedRetryBridgeSpec" -> Set(
"blended.jms.bridge.internal.TransactionSendFailedRetryBridgeSpec"
),
"SendFailedRetryBridgeSpec" -> Set("blended.jms.bridge.internal.SendFailedRetryBridgeSpec"),
"MapToExternalBridgeSpec" -> Set("blended.jms.bridge.internal.MapToExternalBridgeSpec"),
"OutboundBridgeSpec" -> Set("blended.jms.bridge.internal.OutboundBridgeSpec"),
"InboundBridgeTrackedSpec" -> Set("blended.jms.bridge.internal.InboundBridgeTrackedSpec"),
"InboundBridgeUntrackedSpec" -> Set("blended.jms.bridge.internal.InboundBridgeUntrackedSpec"),
"SendFailedRejectBridgeSpec" -> Set("blended.jms.bridge.internal.SendFailedRejectBridgeSpec"),
"SessionFailRetrySpec" -> Set("blended.jms.bridge.internal.SessionFailRetrySpec")
)
object test extends Cross[Test](crossTestGroups: _*)
class Test(override val testGroup: String) extends CoreForkedTests {
override def otherModule: CoreForkedTests = bridge.test(otherTestGroup)
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.akkaSlf4j(akkaBundleRevision),
deps.activeMqBroker,
deps.scalacheck,
deps.scalatestplusScalacheck,
deps.springCore,
deps.springBeans,
deps.springContext,
deps.springExpression
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.activemq.brokerstarter,
blended.testsupport,
blended.testsupport.pojosr,
blended.streams.testsupport
)
}
}
object utils extends CoreModule {
override def description =
"A bundle to provide a ConnectionFactory wrapper that monitors a single connection and is able to monitor the connection via an active ping."
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.jms11Spec
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.domino,
blended.mgmt.base,
blended.container.context.api,
blended.updater.config,
blended.util.logging,
blended.akka
)
object test extends CoreTests {
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.akkaSlf4j(akkaBundleRevision),
deps.akkaStream(akkaBundleRevision),
deps.activeMqBroker,
deps.activeMqKahadbStore,
deps.akkaTestkit
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.testsupport
)
}
}
}
object jmx extends CoreModule {
override def description = "Helper bundle to expose the platform's MBeanServer as OSGI Service."
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.domino,
deps.prickle,
deps.typesafeConfig
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.util,
blended.util.logging,
blended.akka
)
override def exportPackages: Seq[String] =
super.exportPackages ++ Seq(
s"${blendedModule}.json",
s"${blendedModule}.statistics"
)
override def osgiHeaders: T[OsgiHeaders] =
T {
super
.osgiHeaders()
.copy(
`Bundle-Activator` = Option(s"${blendedModule}.internal.BlendedJmxActivator")
)
}
object test extends CoreTests {
override def ivyDeps: Target[Loose.Agg[Dep]] =
T {
super.ivyDeps() ++ Agg(
deps.scalacheck,
deps.scalatestplusScalacheck
)
}
override def moduleDeps =
super.moduleDeps ++ Seq(
blended.testsupport,
blended.testsupport.pojosr
)