This repository has been archived by the owner on May 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.sbt
174 lines (159 loc) · 6.47 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
import scala.collection.immutable.Seq
import ReleaseTransformations._
lazy val Versions = new {
val akka = "2.5.20"
val akkaHttp = "10.0.15"
val akkaManagement = "0.20.0"
val lagom14 = "1.4.0"
val play25 = "2.5.0"
val play26 = "2.6.0"
val scala211 = "2.11.12"
val scala212 = "2.12.8"
val scalaTest = "3.0.1"
val typesafeConfig = "1.3.1"
}
ThisBuild / organization := "com.lightbend.rp"
ThisBuild / organizationName := "Lightbend, Inc."
ThisBuild / startYear := Option(2017)
ThisBuild / licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / homepage := Option(url("https://www.lightbend.com/"))
ThisBuild / developers := List(
Developer("lightbend", "Lightbend Contributors", "", url("https://github.com/lightbend/reactive-lib"))
)
ThisBuild / scmInfo := Option(ScmInfo(url("https://github.com/lightbend/reactive-lib"), "git@github.com:lightbend/reactive-lib.git"))
ThisBuild / scalaVersion := Versions.scala212
def semanticVersioningMajor(version: String) =
version
.reverse
.dropWhile(_ != '.')
.dropWhile(_ == '.')
.reverse
def createProject(id: String, path: String, headers: Boolean = true) =
(
if (headers)
Project(id, file(path)).enablePlugins(AutomateHeaderPlugin)
else
Project(id, file(path)))
.settings(
name := id,
scalacOptions ++= Vector("-deprecation"),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % Versions.scalaTest % "test"
),
sonatypeProfileName := "com.lightbend.rp",
publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
),
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseCrossBuild := false,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("+test"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
pushChanges
)
)
lazy val root = createProject("reactive-lib", ".")
.aggregate(
akkaClusterBootstrap,
akkaManagement,
common,
secrets,
serviceDiscovery,
serviceDiscoveryLagom14Java,
serviceDiscoveryLagom14Scala,
status
).
settings(
crossScalaVersions := Vector()
)
lazy val common = createProject("reactive-lib-common", "common")
.settings(
crossScalaVersions := Vector(Versions.scala211, Versions.scala212)
)
lazy val serviceDiscovery = createProject("reactive-lib-service-discovery", "service-discovery")
.dependsOn(common)
.settings(
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % Versions.akka,
"com.typesafe.akka" %% "akka-testkit" % Versions.akka % Test,
),
crossScalaVersions := Vector(Versions.scala211, Versions.scala212)
)
lazy val serviceDiscoveryLagom14Java = createProject("reactive-lib-service-discovery-lagom14-java", "service-discovery-lagom14-java")
.dependsOn(serviceDiscovery)
.settings(
libraryDependencies ++= Seq(
"com.lightbend.lagom" %% "lagom-javadsl-client" % Versions.lagom14 % "provided"
),
crossScalaVersions := Vector(Versions.scala211, Versions.scala212)
)
lazy val serviceDiscoveryLagom14Scala = createProject("reactive-lib-service-discovery-lagom14-scala", "service-discovery-lagom14-scala")
.dependsOn(serviceDiscovery)
.settings(
libraryDependencies ++= Seq(
"com.lightbend.lagom" %% "lagom-scaladsl-client" % Versions.lagom14 % "provided",
),
crossScalaVersions := Vector(Versions.scala211, Versions.scala212)
)
lazy val akkaClusterBootstrap = createProject("reactive-lib-akka-cluster-bootstrap", "akka-cluster-bootstrap")
.dependsOn(akkaManagement, serviceDiscovery, status)
.settings(
libraryDependencies ++= Seq(
"com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % Versions.akkaManagement,
"com.lightbend.akka.discovery" %% "akka-discovery-marathon-api" % Versions.akkaManagement,
"com.lightbend.akka.discovery" %% "akka-discovery-dns" % Versions.akkaManagement,
"com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % Versions.akkaManagement,
"com.typesafe.akka" %% "akka-testkit" % Versions.akka % "test",
"com.typesafe.akka" %% "akka-cluster" % Versions.akka % "provided"
),
crossScalaVersions := Vector(Versions.scala211, Versions.scala212)
)
lazy val integrationTest = (project in file("integration-test"))
.enablePlugins(SbtPlugin)
.settings(
publish / skip := true,
// pass in -Ddeckhand.openshift to run scripted test with -Ddeckhand.openshift
scriptedLaunchOpts := { scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value) ++
sys.props.get("deckhand.openshift").toList.map(_ => "-Ddeckhand.openshift")
},
scriptedBufferLog := false
)
lazy val akkaManagement = createProject("reactive-lib-akka-management", "akka-management")
.dependsOn(common)
.settings(
crossScalaVersions := Vector(Versions.scala211, Versions.scala212),
libraryDependencies ++= Seq(
"com.lightbend.akka.management" %% "akka-management" % Versions.akkaManagement,
// Akka HTTP Spray JSON and Akka HTTP are needed here to align with Lagom's usage of Akka HTTP.
// Ref https://github.com/lagom/lagom/issues/1652
"com.typesafe.akka" %% "akka-http-spray-json" % Versions.akkaHttp,
"com.typesafe.akka" %% "akka-http" % Versions.akkaHttp,
"com.typesafe.akka" %% "akka-actor" % Versions.akka % "provided"
)
)
lazy val secrets = createProject("reactive-lib-secrets", "secrets")
.dependsOn(common)
.settings(
crossScalaVersions := Vector(Versions.scala211, Versions.scala212),
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % Versions.akka % "provided",
"com.typesafe.akka" %% "akka-stream" % Versions.akka % "provided"
)
)
lazy val status = createProject("reactive-lib-status", "status")
.dependsOn(akkaManagement)
.settings(
crossScalaVersions := Vector(Versions.scala211, Versions.scala212)
)