-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.sbt
149 lines (133 loc) · 4.84 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
import sbt.*
import sbt.Keys.*
import Dependencies.*
import sbtrelease.*
import ReleaseStateTransformations.*
import xerial.sbt.Sonatype.*
import play.sbt.PlayImport.PlayKeys.*
import sbtversionpolicy.withsbtrelease.ReleaseVersion
val scala212 = "2.12.20"
val scala213 = "2.13.14"
ThisBuild / scalaVersion := scala213
val commonSettings =
Seq(
crossScalaVersions := List(scala212, scala213),
organization := "com.gu",
Test / fork := false,
scalacOptions ++= Seq(
"-feature",
"-deprecation",
// upgrade warnings to errors except deprecations
"-Wconf:cat=deprecation:ws,any:e",
"-release:11"
),
licenses := Seq(License.Apache2),
)
lazy val panDomainAuthVerification = subproject("pan-domain-auth-verification")
.settings(
libraryDependencies
++= cryptoDependencies
++ awsDependencies
++ testDependencies
++ loggingDependencies
++ scalaCollectionCompatDependencies,
)
lazy val panDomainAuthCore = subproject("pan-domain-auth-core")
.dependsOn(panDomainAuthVerification)
.settings(
libraryDependencies
++= awsDependencies
++ googleDirectoryApiDependencies
++ cryptoDependencies
++ testDependencies
++ scalaCollectionCompatDependencies,
)
lazy val panDomainAuthPlay_2_8 = subproject("pan-domain-auth-play_2-8")
.settings(sourceDirectory := (ThisBuild / baseDirectory).value / "pan-domain-auth-play" / "src")
.settings(
libraryDependencies
++= playLibs_2_8
++ scalaCollectionCompatDependencies,
).dependsOn(panDomainAuthCore)
lazy val panDomainAuthPlay_2_9 = subproject("pan-domain-auth-play_2-9")
.settings(sourceDirectory := (ThisBuild / baseDirectory).value / "pan-domain-auth-play" / "src")
.settings(
crossScalaVersions := Seq(scala213),
libraryDependencies
++= playLibs_2_9
++ scalaCollectionCompatDependencies,
).dependsOn(panDomainAuthCore)
lazy val panDomainAuthPlay_3_0 = subproject("pan-domain-auth-play_3-0")
.settings(sourceDirectory := (ThisBuild / baseDirectory).value / "pan-domain-auth-play" / "src")
.settings(
crossScalaVersions := Seq(scala213),
libraryDependencies
++= playLibs_3_0
++ scalaCollectionCompatDependencies,
).dependsOn(panDomainAuthCore)
lazy val panDomainAuthHmac_2_8 = subproject("panda-hmac-play_2-8")
.settings(sourceDirectory := (ThisBuild / baseDirectory).value / "pan-domain-auth-hmac" / "src")
.settings(
libraryDependencies ++= hmacLibs ++ playLibs_2_8 ++ testDependencies,
).dependsOn(panDomainAuthPlay_2_8)
lazy val panDomainAuthHmac_2_9 = subproject("panda-hmac-play_2-9")
.settings(sourceDirectory := (ThisBuild / baseDirectory).value / "pan-domain-auth-hmac" / "src")
.settings(
crossScalaVersions := Seq(scala213),
libraryDependencies ++= hmacLibs ++ playLibs_2_9 ++ testDependencies,
).dependsOn(panDomainAuthPlay_2_9)
lazy val panDomainAuthHmac_3_0 = subproject("panda-hmac-play_3-0")
.settings(sourceDirectory := (ThisBuild / baseDirectory).value / "pan-domain-auth-hmac" / "src")
.settings(
crossScalaVersions := Seq(scala213),
libraryDependencies ++= hmacLibs ++ playLibs_3_0 ++ testDependencies,
).dependsOn(panDomainAuthPlay_3_0)
lazy val exampleApp = subproject("pan-domain-auth-example")
.enablePlugins(PlayScala)
.settings(libraryDependencies ++= (awsDependencies :+ ws))
.dependsOn(panDomainAuthPlay_2_9)
.settings(
crossScalaVersions := Seq(scala213),
publish / skip := true,
playDefaultPort := 9500
)
lazy val sonatypeReleaseSettings = {
sonatypeSettings ++ Seq(
// sbt and sbt-release implement cross-building support differently. sbt does it better
// (it supports each subproject having different crossScalaVersions), so disable sbt-release's
// implementation, and do the publish step with a `+`,
// ie. (`releaseStepCommandAndRemaining("+publishSigned")`)
// See https://www.scala-sbt.org/1.x/docs/Cross-Build.html#Note+about+sbt-release
// Never run with "release cross" or "+release"! Odd things start happening
releaseCrossBuild := false,
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
)
}
lazy val root = Project("pan-domain-auth-root", file(".")).aggregate(
panDomainAuthVerification,
panDomainAuthCore,
panDomainAuthPlay_2_8,
panDomainAuthPlay_2_9,
panDomainAuthPlay_3_0,
panDomainAuthHmac_2_8,
panDomainAuthHmac_2_9,
panDomainAuthHmac_3_0,
exampleApp
).settings(sonatypeReleaseSettings)
.settings(
organization := "com.gu",
publish / skip := true,
)
def subproject(path: String): Project =
Project(path, file(path)).settings(commonSettings: _*)