-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.sbt
65 lines (54 loc) · 2.09 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
import sbt.Keys._
import ReleaseTransformations._
import Dependencies._
import sbtversionpolicy.withsbtrelease.ReleaseVersion
val ghProject = "content-api-client"
lazy val root = (project in file("."))
.aggregate(client, defaultClient)
.settings(
publish / skip := true,
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value,
releaseProcess := Seq(
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
)
lazy val client = (project in file("client"))
.settings(artifactProductionSettings, clientSettings)
.enablePlugins(BuildInfoPlugin)
lazy val defaultClient = (project in file("client-default"))
.dependsOn(client)
.settings(artifactProductionSettings, defaultClientSettings)
lazy val artifactProductionSettings: Seq[Setting[_]] = Seq(
crossScalaVersions := scalaVersions,
scalaVersion := scalaVersions.max,
scalacOptions ++= Seq("-deprecation", "-unchecked", "-release:8"),
licenses := Seq(License.Apache2),
organization := "com.gu"
)
lazy val clientSettings: Seq[Setting[_]] = Seq(
name := ghProject,
description := "Scala client for the Guardian's Content API",
buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := "com.gu.contentapi.buildinfo",
buildInfoObject := "CapiBuildInfo",
libraryDependencies ++= clientDeps
)
lazy val defaultClientSettings: Seq[Setting[_]] = Seq(
name := ghProject + "-default",
description := "Default scala client for the Guardian's Content API",
libraryDependencies ++= clientDeps ++ defaultClientDeps,
console / initialCommands := """
import com.gu.contentapi.client._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Await
import scala.concurrent.duration._
"""
)
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-u", sys.env.getOrElse("SBT_JUNIT_OUTPUT", "junit"))