This repository was archived by the owner on May 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.sbt
More file actions
189 lines (177 loc) · 6.79 KB
/
build.sbt
File metadata and controls
189 lines (177 loc) · 6.79 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import com.gilt.sbt.newrelic.NewRelic.autoImport._
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
//import JavaAppPackaging.autoImport._
import sbt.Keys._
//import scoverage._
lazy val buildSettings = Seq(
organization := "com.redbubble",
scalaVersion := "2.12.3"
)
lazy val finagleHawkVersion = "0.2.1"
lazy val finchSangriaVersion = "0.3.1"
lazy val rbScalaUtilsVersion = "0.1.1"
lazy val circeVersion = "0.8.0"
lazy val catsVersion = "0.9.0"
lazy val mouseVersion = "0.9"
// The version numbers for Finagle, Twitter, Finch & Catbird *must* work together. See the Finch build.sbt for known good versions.
lazy val finagleVersion = "6.45.0"
lazy val finagleHttpAuthVersion = "0.1.0"
lazy val twitterServerVersion = "1.30.0"
lazy val finchVersion = "0.15.1"
lazy val sangriaVersion = "1.2.2"
lazy val sangriaCirceVersion = "1.1.0"
lazy val featherbedVersion = "0.3.1"
lazy val specsVersion = "3.9.4"
lazy val scalaCacheVersion = "0.9.4"
lazy val scalaUriVersion = "0.4.16"
lazy val fetchVersion = "0.6.2"
lazy val slf4jVersion = "1.7.25"
lazy val gattlingVersion = "2.2.5"
lazy val nrVersion = "3.40.0"
lazy val finagleHawk = "com.redbubble" %% "finagle-hawk" % finagleHawkVersion
lazy val finchSangria = "com.redbubble" %% "finch-sangria" % finchSangriaVersion
lazy val rbScalaUtils = "com.redbubble" %% "rb-scala-utils" % rbScalaUtilsVersion
lazy val cats = "org.typelevel" %% "cats-core" % catsVersion
lazy val circeCore = "io.circe" %% "circe-core" % circeVersion
lazy val mouse = "com.github.benhutchison" %% "mouse" % mouseVersion
lazy val finagleHttp = "com.twitter" %% "finagle-http" % finagleVersion
lazy val finagleStats = "com.twitter" %% "finagle-stats" % finagleVersion
lazy val finagleHttpAuth = "com.github.finagle" %% "finagle-http-auth" % finagleHttpAuthVersion
lazy val twitterServer = "com.twitter" %% "twitter-server" % twitterServerVersion
lazy val finchCore = "com.github.finagle" %% "finch-core" % finchVersion
lazy val finchCirce = "com.github.finagle" %% "finch-circe" % finchVersion
lazy val scalaUri = "com.netaporter" %% "scala-uri" % scalaUriVersion
lazy val fetch = "com.47deg" %% "fetch" % fetchVersion
lazy val featherbedCore = "io.github.finagle" %% "featherbed-core" % featherbedVersion
lazy val featherbedCirce = "io.github.finagle" %% "featherbed-circe" % featherbedVersion
lazy val sangria = "org.sangria-graphql" %% "sangria" % sangriaVersion
lazy val sangriaCirce = "org.sangria-graphql" %% "sangria-circe" % sangriaCirceVersion
lazy val sangriaRelay = "org.sangria-graphql" %% "sangria-relay" % sangriaVersion
lazy val newRelic = "com.newrelic.agent.java" % "newrelic-api" % nrVersion
lazy val gattlingHighCharts = ("io.gatling.highcharts" % "gatling-charts-highcharts" % gattlingVersion % "it,test")
.excludeAll(ExclusionRule("org.scala-lang.modules", "scala-xml_2.11"))
.excludeAll(ExclusionRule("org.scala-lang.modules", "scala-java8-compat_2.11"))
.excludeAll(ExclusionRule("org.scala-lang.modules", "scala-parser-combinators_2.11"))
lazy val gattlingTest = ("io.gatling" % "gatling-test-framework" % gattlingVersion % "it,test")
.excludeAll(ExclusionRule("org.scala-lang.modules", "scala-xml_2.11"))
.excludeAll(ExclusionRule("org.scala-lang.modules", "scala-java8-compat_2.11"))
.excludeAll(ExclusionRule("org.scala-lang.modules", "scala-parser-combinators_2.11"))
lazy val specsCore = "org.specs2" %% "specs2-core" % specsVersion
lazy val specsScalacheck = "org.specs2" %% "specs2-scalacheck" % specsVersion
// https://tpolecat.github.io/2014/04/11/scalac-flags.html
lazy val compilerOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-unchecked",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-Xlint",
//"-Yno-predef",
//"-Ywarn-unused-import", // gives false positives
"-Xfatal-warnings",
"-Ywarn-value-discard",
"-Ypartial-unification"
)
lazy val apiDependencies = Seq(
finagleHawk,
finchSangria,
rbScalaUtils,
cats,
mouse,
circeCore,
twitterServer,
finagleHttp,
finagleHttpAuth,
finagleStats,
finchCore,
finchCirce,
sangria,
sangriaCirce,
sangriaRelay,
scalaUri,
fetch,
featherbedCore,
featherbedCirce,
newRelic
)
lazy val perfDependencies = Seq(
gattlingHighCharts,
gattlingTest
)
lazy val testDependencies = Seq(
specsCore,
specsScalacheck
)
lazy val baseSettings = Seq(
libraryDependencies ++= testDependencies.map(_ % "test"),
resolvers ++= Seq(
Resolver.jcenterRepo,
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots"),
"Twitter" at "http://maven.twttr.com",
Resolver.url("bintray-sbt-plugin-releases", url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns),
Resolver.bintrayRepo("redbubble", "open-source")
),
scalacOptions ++= compilerOptions,
scalacOptions in Test ++= Seq("-Yrangepos"),
scalacOptions in(Compile, console) += "-Yrepl-class-based",
testOptions in Test += Tests.Setup(() => System.setProperty("ENV", "test"))
)
lazy val apiSettings = buildSettings ++ baseSettings ++ Seq(
libraryDependencies ++= apiDependencies
)
lazy val perfSettings = buildSettings ++ baseSettings ++ Defaults.itSettings ++ Seq(
libraryDependencies ++= perfDependencies
)
lazy val finchTemplateSettings = buildSettings ++ baseSettings ++ Seq(
name := "finch-template",
moduleName := "finch-template",
libraryDependencies ++= apiDependencies,
mainClass in Compile := Some("com.redbubble.finchtemplate.App"),
aggregate in run := false,
aggregate in reStart := false,
coverageMinimum := 25.0,
coverageFailOnMinimum := true,
coverageExcludedPackages := "com\\.redbubble\\.finchtemplate\\.spec\\.*",
newrelicAppName := "Finch Template",
newrelicVersion := nrVersion,
newrelicCustomTracing := true,
newrelicIncludeApi := true
)
lazy val api = (project in file("api"))
.settings(apiSettings)
lazy val perf = (project in file("perf"))
.settings(perfSettings)
.configs(IntegrationTest)
.dependsOn(api % "test->test;compile->compile")
.enablePlugins(GatlingPlugin)
lazy val finchTemplate = project.in(file("."))
.settings(finchTemplateSettings)
.aggregate(api, perf)
.dependsOn(api, perf)
.enablePlugins(JavaAppPackaging)
.enablePlugins(NewRelic)
shellPrompt in ThisBuild := { state =>
s"${scala.Console.MAGENTA}${Project.extract(state).currentRef.project}> ${scala.Console.RESET}"
}
// Note. We aggregate coverage as a separate command in CI, see https://github.com/scoverage/sbt-scoverage#multi-project-reports
val ciCommands = List(
"clean",
// TODO Re-enable this.
// "scalastyle",
// "test:scalastyle",
"compile",
"test:compile",
"coverage",
"test",
"coverageReport",
"stage"
)
addCommandAlias("ci", ciCommands.mkString(";", ";", ""))