-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
93 lines (80 loc) · 2.78 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
import play.sbt.PlayImport.PlayKeys._
import Dependencies._
import sbtbuildinfo.BuildInfo
import scala.sys.env
Test / parallelExecution := false
val scalaVersionNumber = "2.13.12"
val buildInfo = Seq(
buildInfoPackage := "build",
buildInfoKeys +=
"gitCommitId" -> env.getOrElse("GITHUB_SHA", "Unknown"),
)
val commonSettings = Seq(
scalaVersion := scalaVersionNumber,
ThisBuild / scalaVersion := scalaVersionNumber,
organization := "com.gu",
version := "0.1",
Test / fork := false,
resolvers ++= Seq(
"Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"
),
scalacOptions ++= Seq("-feature", "-deprecation", "-language:higherKinds", "-Xfatal-warnings")
)
def project(path: String): Project = Project(path, file(path)).settings(commonSettings)
def playProject(path: String): Project =
Project(path, file("."))
.enablePlugins(PlayScala, JDebPackaging, SystemdPlugin, BuildInfoPlugin)
.settings(
libraryDependencies += "org.playframework" %% "play-ahc-ws" % "3.0.1",
pipelineStages := Seq(digest, gzip)
)
.settings(commonSettings ++ buildInfo)
.dependsOn(commonLib)
.dependsOn(commonLib % "test->test")
lazy val commonLib = project("common-lib")
.settings(
libraryDependencies
++= Seq(
"org.playframework" %% "play" % "3.0.1", "org.playframework" %% "play-ahc-ws" % "3.0.1",
"com.fasterxml.jackson.core" % "jackson-core" % "2.15.0"
)
++ logbackDependencies
++ testDependencies
++ awsDependencies
++ jsonDependencies
++ cacheDependencies
++ cryptoDependencies
)
val application = "workflow-frontend"
lazy val root = playProject(application)
.enablePlugins(JDebPackaging, BuildInfoPlugin)
.settings(
libraryDependencies
++= awsDependencies
++ authDependencies
++ testDependencies
++ jsonDependencies
++ permissionsDependencies
)
.settings(libraryDependencies += filters)
.settings(playDefaultPort := 9090)
.settings(
Universal / packageName := application,
Universal / concurrentRestrictions := List(Tags.limit(Tags.All, 1)),
Universal / javaOptions ++= Seq(
// Since play uses separate pidfile we have to provide it with a proper path
// name of the pid file must be play.pid
s"-Dpidfile.path=/var/run/${packageName.value}/play.pid"
),
Universal / javaOptions ++= Seq(
"-Dpidfile.path=/dev/null"
),
debianPackageDependencies := Seq("java11-runtime-headless"),
maintainer := "Digital CMS <[email protected]>",
packageSummary := "workflow-frontend",
packageDescription := """Workflow, part of the suite of Guardian CMS tools"""
)
.settings(
Universal / topLevelDirectory := Some(normalizedName.value),
Universal / name := normalizedName.value
)