-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.sbt
148 lines (127 loc) · 4.96 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
import sbtunidoc.Plugin.UnidocKeys._
import com.typesafe.sbt.SbtGhPages.GhPagesKeys._
lazy val docsMappingsAPIDir = settingKey[String]("Name of subdirectory in site target directory for api docs")
val commonSettings = Seq(
scalaVersion := "2.11.8",
scalacOptions ++= Seq(
"-encoding", "UTF-8",
"-deprecation", // warning and location for usages of deprecated APIs
"-feature", // warning and location for usages of features that should be imported explicitly
"-unchecked", // additional warnings where generated code depends on assumptions
"-Xlint", // recommended additional warnings
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver
"-Ywarn-inaccessible",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-language:existentials"
),
organization in Global := "com.iheart",
name := "kanaloa",
git.remoteRepo := "git@github.com:iheartradio/kanaloa.git",
scmInfo := Some(ScmInfo(url("https://github.com/iheartradio/kanaloa"), "scm:" + git.remoteRepo.value))
)
lazy val docsSettings = Seq(
docsMappingsAPIDir := "api",
micrositeName := "Kanaloa",
micrositeDescription := "Kanaloa - resiliency against traffic oversaturation",
micrositeAuthor := "Kanaloa contributors",
micrositeHighlightTheme := "atom-one-light",
micrositeHomepage := "http://iheartradio.github.io/kanaloa",
micrositeBaseUrl := "kanaloa",
micrositeDocumentationUrl := "/" + micrositeBaseUrl.value + "/" + docsMappingsAPIDir.value,
micrositeGithubOwner := "iheartradio",
micrositeGithubRepo := "kanaloa",
autoAPIMappings := true,
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), docsMappingsAPIDir),
ghpagesNoJekyll := false,
fork in tut := true,
micrositePalette := Map(
"brand-primary" -> "#5B5988",
"brand-secondary" -> "#292E53",
"brand-tertiary" -> "#222749",
"gray-dark" -> "#49494B",
"gray" -> "#7B7B7E",
"gray-light" -> "#E5E5E6",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"),
fork in (ScalaUnidoc, unidoc) := true,
unidocProjectFilter in (ScalaUnidoc, unidoc) :=
inProjects(core, cluster),
scalacOptions in (ScalaUnidoc, unidoc) ++= Seq(
"-Xfatal-warnings",
"-doc-source-url", scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala",
"-sourcepath", baseDirectory.in(LocalRootProject).value.getAbsolutePath,
"-diagrams"
),
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.yml" | "*.md"
)
val noPublishing = Seq(publish := (), publishLocal := (), publishArtifact := false)
lazy val root = project.in(file("."))
.aggregate(core, cluster)
.settings(moduleName := "kanaloa")
.settings(noPublishing)
lazy val core = project
.configs(Testing.Integration)
.settings(moduleName := "kanaloa-core")
.settings(commonSettings)
.settings(Dependencies.settings)
.settings(Format.settings)
.settings(Publish.settings)
.settings(Publish.extraReleaseStep)
.settings(Testing.settings)
lazy val cluster = project
.dependsOn(core)
.aggregate(core)
.settings(moduleName := "kanaloa-cluster")
.configs(Testing.Integration)
.settings(commonSettings)
.settings(Dependencies.settings)
.settings(Format.settings)
.settings(Publish.settings)
.settings(Testing.settings)
.settings(ClusterTests.settings)
.settings(
libraryDependencies ++= Dependencies.akkaCluster
).configs(MultiJvm)
//following three modules are for benchmarks
lazy val stressBackend = project.in(file("./stress/backend"))
.aggregate(core, cluster)
.dependsOn(core, cluster)
.settings(commonSettings)
.settings(moduleName := "kanaloa-stress-backend")
.settings(noPublishing)
.settings(
libraryDependencies ++= Dependencies.akkaThrottler ++ Dependencies.akkaHttp
)
lazy val stressFrontend = project.in(file("./stress/frontend"))
.aggregate(stressBackend)
.dependsOn(stressBackend)
.settings(moduleName := "kanaloa-stress-frontend")
.settings(noPublishing)
.settings(commonSettings)
.settings(
libraryDependencies ++= Dependencies.akkaHttp
)
lazy val stressGatling = project.in(file("./stress/gatling"))
.aggregate(stressFrontend)
.dependsOn(stressFrontend)
.enablePlugins(GatlingPlugin)
.settings(moduleName := "kanaloa-stress-gatling")
.settings(noPublishing)
.settings(commonSettings)
.settings(
resolvers += Resolver.sonatypeRepo("snapshots"),
libraryDependencies ++= Dependencies.gatling
)
lazy val docs = project
.dependsOn(core, cluster)
.settings(commonSettings)
.settings(unidocSettings)
.settings(tutScalacOptions ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))))
.settings(docsSettings)
.settings(noPublishing)
.enablePlugins(MicrositesPlugin)
addCommandAlias("root", ";project root")
addCommandAlias("stress", ";stressGatling/gatling:test-only kanaloa.stress.Kanaloa*")
addCommandAlias("validate", ";root;clean;compile;test;integration:test;docs/makeMicrosite")
addCommandAlias("root", ";project root")