-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.sbt
172 lines (149 loc) · 5.59 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
name := "facia-tool"
version := "1.0"
maintainer := "Editorial Tools Team <[email protected]>"
packageSummary := "Facia tool"
packageDescription := "Guardian front pages editor"
ThisBuild / scalaVersion := "2.13.13"
import sbt.Resolver
debianPackageDependencies := Seq("java11-runtime-headless")
def env(key: String): Option[String] = Option(System.getenv(key))
ThisBuild / javacOptions := Seq("-g", "-encoding", "utf8")
Universal / javaOptions ++= Seq(
"-Dpidfile.path=/dev/null",
"-J-XX:MaxRAMFraction=2",
"-J-XX:InitialRAMFraction=2",
"-J-XX:MaxMetaspaceSize=500m",
s"-J-Xloggc:/var/log/${packageName.value}/gc.log",
"-Dcom.amazonaws.sdk.disableCbor"
)
routesGenerator := InjectedRoutesGenerator
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-release:11",
"-Xcheckinit",
"-encoding",
"utf8",
"-feature"
)
Compile / doc / sources := Seq.empty
Compile / packageDoc / publishArtifact := false
TwirlKeys.templateImports ++= Seq(
"conf._",
"play.api.Play"
)
// include the enum path bindables
routesImport += "model.editions._"
val awsVersion = "1.12.470"
val capiModelsVersion = "25.0.0"
val capiClientVersion = "32.0.0"
val json4sVersion = "4.0.3"
val circeVersion = "0.13.0"
resolvers ++= Seq(
Resolver.file("Local", file(Path.userHome.absolutePath + "/.ivy2/local"))(
Resolver.ivyStylePatterns
),
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
libraryDependencies ++= Seq(
ws,
filters,
evolutions,
jdbc,
"com.amazonaws" % "aws-java-sdk-rds" % awsVersion,
"com.amazonaws" % "aws-java-sdk-core" % awsVersion,
"com.amazonaws" % "aws-java-sdk-cloudwatch" % awsVersion,
"com.amazonaws" % "aws-java-sdk-s3" % awsVersion,
"com.amazonaws" % "aws-java-sdk-sns" % awsVersion,
"com.amazonaws" % "aws-java-sdk-sqs" % awsVersion,
"com.amazonaws" % "aws-java-sdk-ssm" % awsVersion,
"com.amazonaws" % "aws-java-sdk-sts" % awsVersion,
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsVersion,
"com.gu" %% "content-api-models-scala" % capiModelsVersion,
"com.gu" %% "content-api-models-json" % capiModelsVersion,
"com.gu" %% "content-api-client-aws" % "0.6",
"com.gu" %% "content-api-client-default" % capiClientVersion,
"com.gu" %% "editorial-permissions-client" % "3.0.0",
"com.gu" %% "fapi-client-play30" % "12.0.0",
"com.gu" %% "mobile-notifications-api-models" % "3.0.0",
"com.gu" %% "pan-domain-auth-play_3-0" % "4.0.0",
"org.scanamo" %% "scanamo" % "1.1.1" exclude ("org.scala-lang.modules", "scala-java8-compat_2.13"),
"com.github.blemale" %% "scaffeine" % "4.1.0" % "compile",
"com.gu" %% "thrift-serializer" % "4.0.2",
"net.logstash.logback" % "logstash-logback-encoder" % "6.6",
"org.julienrf" %% "play-json-derived-codecs" % "11.0.0",
"org.json4s" %% "json4s-native" % json4sVersion,
"org.json4s" %% "json4s-jackson" % json4sVersion,
"org.playframework" %% "play-json-joda" % "3.0.2",
"ai.x" %% "play-json-extensions" % "0.40.2",
"org.postgresql" % "postgresql" % "42.3.9",
"org.scalikejdbc" %% "scalikejdbc" % "4.2.0",
"org.scalikejdbc" %% "scalikejdbc-config" % "4.2.1",
"org.scalikejdbc" %% "scalikejdbc-play-initializer" % "3.0.0-scalikejdbc-4.2",
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"com.beachape" %% "enumeratum" % "1.7.3",
"com.beachape" %% "enumeratum-play" % "1.8.0",
"org.playframework" %% "play" % "3.0.2",
"org.apache.commons" % "commons-text" % "1.10.0",
"com.beust" % "jcommander" % "1.75",
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"org.mockito" % "mockito-core" % "5.11.0" % Test
)
excludeDependencies ++= Seq(
// As of Play 3.0, groupId has changed to org.playframework; exclude transitive dependencies to the old artifacts
// Hopefully this workaround can be removed once play-json-extensions either updates to Play 3.0 or is merged into play-json
ExclusionRule(organization = "com.typesafe.play")
)
dependencyOverrides ++= Seq(
// Pinned to resolve transitive dependencies between Play and Scalikejdbc
"org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1"
)
val UsesDatabaseTest = config("database-int") extend Test
lazy val root = (project in file("."))
.enablePlugins(PlayScala, JDebPackaging, SystemdPlugin, BuildInfoPlugin)
.configs(UsesDatabaseTest)
.settings(
buildInfoPackage := "facia",
buildInfoKeys := {
Seq[BuildInfoKey](
BuildInfoKey.constant(
"buildNumber",
env("GITHUB_BUILD_NUMBER").getOrElse("unknown")
),
// so this next one is constant to avoid it always recompiling on dev machines.
// we only really care about build time on teamcity, when a constant based on when
// it was loaded is just fine
BuildInfoKey.constant("buildTime", System.currentTimeMillis),
BuildInfoKey
.constant("gitCommitId", env("GITHUB_SHA").getOrElse("unknown"))
)
}
)
.settings(inConfig(UsesDatabaseTest)(Defaults.testTasks): _*)
.settings(
UsesDatabaseTest / testOptions := Seq(
Tests.Argument(
TestFrameworks.ScalaTest,
// only include tests with this tag
"-n",
"fixtures.UsesDatabase",
// show full stack traces when an exception is thrown
"-oF"
)
)
)
// We exclude in other tests
.settings(
Test / testOptions := Seq(
Tests.Argument(
TestFrameworks.ScalaTest,
// exclude tests tagged with UsesDatabase
"-l",
"fixtures.UsesDatabase",
// show full stack traces when an exception is thrown
"-oF"
)
)
)