-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
86 lines (69 loc) · 3 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
lazy val projectName = "rest-server"
version := "1.0"
lazy val globalSettings = Seq(
conflictManager := ConflictManager.latestRevision, // this is the default, but we set it explicitly for IDEA. See: https://youtrack.jetbrains.com/issue/SCL-7646
organization := "com.coloso",
scalaVersion := "2.11.8",
updateOptions := updateOptions.value.withCachedResolution(true),
version := sys.env.get("BUILD_NUMBER") getOrElse s"${System.currentTimeMillis}-SNAPSHOT"
)
lazy val subprojectSettings = Seq(
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.3.0",
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.2",
"org.apache.logging.log4j" % "log4j-api" % "2.2",
"org.apache.logging.log4j" % "log4j-core" % "2.2",
"com.google.guava" % "guava" % "19.0",
"com.google.oauth-client" % "google-oauth-client-java6" % "1.22.0",
"com.twitter.finatra" %% "finatra-http" % "2.1.6"
exclude("com.google.guava", "guava")
),
libraryDependencies ++= testLibraries map { _ % Test }
)
lazy val testLibraries = Seq(
"org.scalatest" %% "scalatest" % "2.2.4",
"org.scalacheck" %% "scalacheck" % "1.12.4",
"org.scalamock" %% "scalamock-scalatest-support" % "3.2.2",
"org.mockito" % "mockito-all" % "1.10.19"
)
lazy val rootSettings = Seq.empty
lazy val serviceSettings = Seq.empty ++
{
// Assembly Plugin
import sbtassembly.AssemblyKeys._
import sbtassembly.MergeStrategy
Seq(
mainClass := Option("com.coloso.ColosoServerMain"),
assemblyJarName in assembly := s"${projectName}-service.jar",
test in assembly := {},
assemblyMergeStrategy in assembly := {
case PathList("org", "apache", "commons", "logging", _*) => MergeStrategy.first
case PathList("org", "apache", "log4j", _*) => MergeStrategy.first
case PathList("org", "slf4j", "impl", _*) => MergeStrategy.first
case PathList("META-INF", "MANIFEST.MF", _*) => MergeStrategy.discard
case PathList("META-INF", "mime.types", _*) => MergeStrategy.first
case "BUILD" => MergeStrategy.discard
case s => (assemblyMergeStrategy in assembly).value(s)
}
)
}
lazy val remoteTestsSettings = Seq.empty ++
{
// Workaround to make test libraries visible in IDEA
Seq(libraryDependencies ++= testLibraries)
}
lazy val End2EndTest = config("e2e") extend Test
lazy val root = Project(id = projectName, base = file("."))
.aggregate(service, remoteTests)
.settings(globalSettings: _*)
.settings(rootSettings: _*)
lazy val service = (project in file("service"))
.configs(IntegrationTest)
.settings(globalSettings: _*)
.settings(subprojectSettings: _*)
.settings(serviceSettings: _*)
lazy val remoteTests = (project in file("remoteTests"))
.configs(End2EndTest)
.settings(globalSettings: _*)
.settings(subprojectSettings: _*)
.settings(remoteTestsSettings: _*)