-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sbt
More file actions
100 lines (87 loc) · 3.31 KB
/
Copy pathbuild.sbt
File metadata and controls
100 lines (87 loc) · 3.31 KB
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
import Dependencies.*
import sbtrelease.ReleaseStateTransformations.*
import sbtversionpolicy.withsbtrelease.ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease
name := "facia-api-client"
description := "Scala client for The Guardian's Facia JSON API"
ThisBuild / scalaVersion := "2.13.16"
val sonatypeReleaseSettings = Seq(
releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value,
releaseCrossBuild := true, // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
)
def artifactProducingSettings(supportScala3: Boolean) = Seq(
organization := "com.gu",
licenses := Seq(License.Apache2),
crossScalaVersions := Seq(scalaVersion.value) ++ (if (supportScala3) Seq("3.3.6") else Seq.empty),
scalacOptions := Seq(
"-release:8",
"-feature",
"-deprecation",
"-Xfatal-warnings"
),
libraryDependencies += scalaTest
)
// fapi-client-core is independent of AWS SDK version.
lazy val fapiClient_core = (project in file("fapi-client-core")).settings(
libraryDependencies += eTagCachingS3Base,
artifactProducingSettings(supportScala3 = true)
)
lazy val root = (project in file(".")).aggregate(
fapiClient_core,
faciaJson_play28,
faciaJson_play29,
faciaJson_play30,
fapiClient_play28,
fapiClient_play29,
fapiClient_play30
).settings(
publish / skip := true,
sonatypeReleaseSettings
)
def playJsonSpecificProject(module: String, playJsonVersion: PlayJsonVersion) = Project(s"$module-${playJsonVersion.projectId}", file(s"$module-${playJsonVersion.projectId}"))
.settings(
sourceDirectory := baseDirectory.value / s"../$module/src"
)
def faciaJson(playJsonVersion: PlayJsonVersion) = playJsonSpecificProject("facia-json", playJsonVersion)
.dependsOn(fapiClient_core)
.settings(
libraryDependencies ++= Seq(
awsS3SdkV1, // ideally, this would be pushed out to a separate FAPI artifact, or just not used directly at all
commonsIo,
playJsonVersion.lib,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0",
scalaLogging
),
artifactProducingSettings(supportScala3 = playJsonVersion.supportsScala3)
)
def fapiClient(playJsonVersion: PlayJsonVersion) = playJsonSpecificProject("fapi-client", playJsonVersion)
.settings(
libraryDependencies ++= Seq(
eTagCachingS3SupportForTesting,
contentApi,
contentApiDefault,
commercialShared,
scalaTestMockito,
mockito,
),
artifactProducingSettings(supportScala3 = false) // currently blocked by contentApi & commercialShared clients
)
lazy val faciaJson_play28 = faciaJson(PlayJsonVersion.V28)
lazy val faciaJson_play29 = faciaJson(PlayJsonVersion.V29)
lazy val faciaJson_play30 = faciaJson(PlayJsonVersion.V30)
lazy val fapiClient_play28 = fapiClient(PlayJsonVersion.V28).dependsOn(faciaJson_play28)
lazy val fapiClient_play29 = fapiClient(PlayJsonVersion.V29).dependsOn(faciaJson_play29)
lazy val fapiClient_play30 = fapiClient(PlayJsonVersion.V30).dependsOn(faciaJson_play30)
Test/testOptions += Tests.Argument(
TestFrameworks.ScalaTest,
"-u", s"test-results/scala-${scalaVersion.value}", "-o"
)