1- import sbt .Keys .publish
1+ import Dependencies .*
2+ import ProjectMatrixSyntax .*
3+ import sbt .Keys .*
24import sbt .internal .ProjectMatrix
35
4- lazy val ScalaVersions = Seq (" 2.13.16" , " 3.3.3 " )
6+ lazy val scalaVersions = Seq (" 2.13.16" , " 3.3.6 " )
57
68lazy val commonSettings = Seq (
79 organization := " com.evolutiongaming" ,
810 homepage := Some (url(" https://github.com/evolution-gaming/sequentially" )),
911 startYear := Some (2018 ),
1012 organizationName := " Evolution" ,
1113 organizationHomepage := Some (url(" https://evolution.com" )),
14+ licenses := Seq ((" MIT" , url(" https://opensource.org/licenses/MIT" ))),
15+
16+ // compiler settings
1217 Compile / scalacOptions ++= {
1318 if (scalaBinaryVersion.value == " 2.13" ) {
1419 Seq (
@@ -17,99 +22,76 @@ lazy val commonSettings = Seq(
1722 } else Seq .empty
1823 },
1924 Compile / doc / scalacOptions += " -no-link-warnings" ,
25+
26+ // publishing and versioning settings
2027 publishTo := Some (Resolver .evolutionReleases),
21- licenses := Seq ((" MIT" , url(" https://opensource.org/licenses/MIT" ))),
2228 versionScheme := Some (" semver-spec" ),
29+ versionPolicyIntention := Compatibility .BinaryCompatible ,
2330)
2431
25- // Your next release will be binary compatible with the previous one,
26- // but it may not be source compatible (ie, it will be a minor release).
27- ThisBuild / versionPolicyIntention := Compatibility .None
28-
29- lazy val root = (project
30- in file(" ." )
31- settings (name := " sequentially-root" )
32- settings commonSettings
33- settings (publish / skip := true )
34- aggregate (
35- sequentially.projectRefs ++
36- benchmark.projectRefs ++
37- `sequentially-metrics`.projectRefs: _*
38- ))
39- lazy val PekkoVersion = " 1.1.3"
40- lazy val sequentially = (projectMatrix
41- in file(" sequentially" )
42- settings (name := " sequentially" )
43- settings commonSettings
44- settings (libraryDependencies ++= Seq (
45- " com.evolutiongaming" %% " future-helper" % " 1.0.7" ,
46- " org.scalatest" %% " scalatest" % " 3.2.19" % Test ,
47- )))
48- .jvmPlatform(
49- scalaVersions = ScalaVersions ,
50- axisValues = Seq (ConfigAxis .Provider .pekko),
51- configure = _.settings(
52- moduleName := moduleName.value + " -pekko" ,
53- libraryDependencies ++= Seq (
54- " org.apache.pekko" %% " pekko-actor" % PekkoVersion ,
55- " org.apache.pekko" %% " pekko-stream" % PekkoVersion ,
56- " org.apache.pekko" %% " pekko-testkit" % PekkoVersion % Test ,
57- " com.evolution" %% " akka-to-pekko-adapter-actor" % " 0.0.5" ,
58- " com.evolution" %% " akka-to-pekko-adapter-stream" % " 0.0.5" ,
59- " com.evolution" %% " akka-to-pekko-adapter-test-kit" % " 0.0.5" % Test ,
60- ),
61- ),
32+ lazy val root = project
33+ .in(file(" ." ))
34+ .settings(commonSettings)
35+ .settings(
36+ name := " sequentially-root" ,
37+ publish / skip := true ,
38+ // setting the Scala version so this module does not pull scalafix & others for 2.12
39+ scalaVersion := scalaVersions.head,
6240 )
63- .jvmPlatform(
64- scalaVersions = ScalaVersions ,
65- axisValues = Seq (ConfigAxis .Provider .akka),
66- configure = _.settings(
67- libraryDependencies ++= Seq (
68- " com.typesafe.akka" %% " akka-stream" % " 2.6.21" ,
69- " com.typesafe.akka" %% " akka-testkit" % " 2.6.21" % Test ,
70- )
71- ),
41+ .aggregate(
42+ (sequentially.projectRefs ++
43+ benchmark.projectRefs ++
44+ `sequentially-metrics`.projectRefs) *
7245 )
7346
74- lazy val benchmark = (projectMatrix
75- in file(" benchmark" )
76- enablePlugins JmhPlugin
77- settings (name := " benchmark" )
78- settings commonSettings
79- dependsOn sequentially % " compile->compile" )
80- .jvmPlatform(
81- scalaVersions = ScalaVersions ,
82- axisValues = Seq (ConfigAxis .Provider .pekko),
83- configure = _.settings(
84- moduleName := moduleName.value + " -pekko"
85- ),
47+ lazy val sequentially = projectMatrix
48+ .in(file(" sequentially" ))
49+ .settings(commonSettings)
50+ .settings(
51+ name := " sequentially"
8652 )
87- .jvmPlatform(
88- scalaVersions = ScalaVersions ,
89- axisValues = Seq (ConfigAxis .Provider .akka),
90- configure = identity,
53+ .settings(
54+ libraryDependencies ++= Seq (
55+ FutureHelper ,
56+ Scalatest % Test ,
57+ )
9158 )
92-
93- lazy val `sequentially-metrics` = (projectMatrix
94- in file(" sequentially-metrics" )
95- settings (name := " sequentially-metrics" )
96- settings commonSettings
97- dependsOn sequentially % " compile->compile"
98- settings (libraryDependencies ++= Seq (
99- " com.evolutiongaming" %% " prometheus-tools" % " 1.1.0"
100- )))
101- .jvmPlatform(
102- scalaVersions = ScalaVersions ,
103- axisValues = Seq (ConfigAxis .Provider .pekko),
104- configure = _.settings(
105- moduleName := moduleName.value + " -pekko"
59+ .configureMatrix(asAkkaPekkoModule(
60+ akkaDependencies = Seq (
61+ Akka .Stream ,
62+ Akka .Testkit % Test ,
10663 ),
64+ pekkoDependencies = Seq (
65+ Pekko .Stream ,
66+ Pekko .Testkit % Test ,
67+ AkkaToPekkoAdapter .Actor ,
68+ AkkaToPekkoAdapter .Stream ,
69+ AkkaToPekkoAdapter .Testkit % Test ,
70+ ),
71+ ))
72+
73+ lazy val benchmark = projectMatrix
74+ .in(file(" benchmark" ))
75+ .settings(commonSettings)
76+ .enablePlugins(JmhPlugin )
77+ .settings(
78+ name := " benchmark" ,
79+ publish / skip := true ,
10780 )
108- .jvmPlatform(
109- scalaVersions = ScalaVersions ,
110- axisValues = Seq (ConfigAxis .Provider .akka),
111- configure = identity,
81+ .dependsOn(sequentially)
82+ .configureMatrix(asAkkaPekkoModule())
83+
84+ lazy val `sequentially-metrics` = projectMatrix
85+ .in(file(" sequentially-metrics" ))
86+ .settings(commonSettings)
87+ .settings(name := " sequentially-metrics" )
88+ .dependsOn(sequentially)
89+ .settings(
90+ libraryDependencies ++= Seq (
91+ PrometheusTools
92+ )
11293 )
94+ .configureMatrix(asAkkaPekkoModule())
11395
11496// used by evolution-gaming/scala-github-actions
11597addCommandAlias(
@@ -118,3 +100,27 @@ addCommandAlias(
118100)
119101
120102addCommandAlias(" fmtAll" , " all scalafmtAll scalafmtSbt; scalafixEnable; scalafixAll" )
103+
104+ def asAkkaPekkoModule (
105+ akkaDependencies : Seq [ModuleID ] = Seq .empty,
106+ pekkoDependencies : Seq [ModuleID ] = Seq .empty,
107+ )(
108+ p : ProjectMatrix
109+ ): ProjectMatrix = {
110+ p
111+ .jvmPlatform(
112+ scalaVersions = scalaVersions,
113+ axisValues = Seq (ConfigAxis .Provider .pekko),
114+ configure = _.settings(
115+ moduleName := moduleName.value + " -pekko" ,
116+ libraryDependencies ++= pekkoDependencies,
117+ ),
118+ )
119+ .jvmPlatform(
120+ scalaVersions = scalaVersions,
121+ axisValues = Seq (ConfigAxis .Provider .akka),
122+ configure = _.settings(
123+ libraryDependencies ++= akkaDependencies
124+ ),
125+ )
126+ }
0 commit comments