-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
93 lines (83 loc) · 2.99 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
import Dependencies._
import sbtassembly.AssemblyPlugin.autoImport.assemblyJarName
import sbtassembly.MergeStrategy
import scala.collection.immutable
val testAndCompileDependencies: String = "test->test;compile->compile"
ThisBuild / libraryDependencySchemes +=
"org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always // due to Identity using lift-json
def projectMaker(projectName: String) = Project(projectName, file(projectName))
.enablePlugins(RiffRaffArtifact)
.settings(
List(
name := projectName,
riffRaffManifestProjectName := s"Mobile::${name.value}"
) ++ commonAssemblySettings(projectName)
)
.dependsOn(common % "compile->compile")
.aggregate(common)
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
def commonAssemblySettings(module: String): immutable.Seq[Def.Setting[_]] =
commonSettings ++ List(
assemblyJarName := s"${name.value}.jar",
riffRaffPackageType := assembly.value,
riffRaffUploadArtifactBucket := Option("riffraff-artifact"),
riffRaffUploadManifestBucket := Option("riffraff-builds")
)
val commonSettings: immutable.Seq[Def.Setting[_]] = List(
fork := true, // was hitting deadlock, fxxund similar complaints online, disabling concurrency helps: https://github.com/sbt/sbt/issues/3022, https://github.com/mockito/mockito/issues/1067
resolvers ++= Resolver.sonatypeOssRepos("releases"),
libraryDependencies ++= Seq(
awsLambda,
awsDynamo,
awsLambdaLog,
awsJavaSdk,
jackson,
jacksonDataFormat,
jacksonJsrDataType,
commonsIo,
scanamo,
okHttp,
slf4jSimple,
identityAuthCore,
specsCore,
specsScalaCheck,
specsMock
),
ThisBuild / assemblyMergeStrategy := {
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
case PathList(ps @ _*) if ps.last equalsIgnoreCase "Log4j2Plugins.dat" => sbtassembly.Log4j2MergeStrategy.plugincache
case _ => MergeStrategy.first
},
organization := "com.gu",
version := "1.0",
scalaVersion := "2.13.15",
scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-release:21",
"-Ywarn-dead-code"
)
)
lazy val common = project
.in(file("common"))
.settings(commonSettings: _*)
lazy val saveforlaterapp = projectMaker("mobile-save-for-later").settings(
riffRaffArtifactResources += (file(
"cdk/cdk.out/MobileSaveForLater-CODE.template.json"
), "mobile-save-for-later-cfn/MobileSaveForLater-CODE.template.json"),
riffRaffArtifactResources += (file(
"cdk/cdk.out/MobileSaveForLater-PROD.template.json"
), "mobile-save-for-later-cfn/MobileSaveForLater-PROD.template.json")
)
lazy val userDeletion =
projectMaker("mobile-save-for-later-user-deletion").settings(
libraryDependencies ++= Seq(
awsLambdaEvent,
awsSqs
),
riffRaffArtifactResources += (file(
"mobile-save-for-later-user-deletion/conf/cfn.yaml"
), "mobile-save-for-later-user-deletion-cfn/cfn.yaml")
)
lazy val root = project.in(file(".")).aggregate(saveforlaterapp)