-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
270 lines (254 loc) · 10.4 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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// *****************************************************************************
// Projects
// *****************************************************************************
// shadow sbt-scalajs' crossProject and CrossType until Scala.js 1.0.0 is released
import sbtcrossproject.{crossProject, CrossType}
lazy val frontend =
project
.in(file("frontend"))
.enablePlugins(
AutomateHeaderPlugin,
GitVersioning,
GitBranchPrompt,
PlayScala,
SbtWeb
)
.settings(settings)
.settings(
name := "frontend",
compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
libraryDependencies ++= Seq(
library.akka,
library.akkaQuartz,
library.catsCore,
library.circeCore,
library.circeGeneric,
library.circeParser,
library.ficus,
library.guice,
library.playBootstrap,
library.playMailer,
library.playMailerGuice,
library.playSil,
library.playSilBcrypt,
library.playSilPersist,
library.playSilJca,
library.playSlick,
library.playSlickEvo,
library.postgresql,
library.scalaJsScripts,
library.slickPg,
library.slickPgCirce,
library.webjarsBoot,
library.webjarsPlay,
library.akkaTestkit % Test,
library.scalaCheck % Test,
library.scalaTest % Test,
library.scalaTestPlus % Test,
ehcache,
filters,
guice
),
Assets / pipelineStages := Seq(scalaJSPipeline),
pipelineStages := Seq(digest, gzip),
scalaJSProjects := Seq(seabattleClient),
Compile / unmanagedSourceDirectories := Seq(scalaSource.in(Compile).value),
Test / unmanagedSourceDirectories := Seq(scalaSource.in(Test).value),
scalacOptions --= Seq(
"-Ywarn-unused:imports" // Avoid lots of warnings when Twirl templates are compiled.
),
Compile / compile / wartremoverWarnings := Warts.unsafe.filterNot(Seq(Wart.DefaultArguments, Wart.Any).contains),
wartremoverExcluded += sourceDirectory.value / "conf" / "routes",
wartremoverExcluded ++= routes.in(Compile).value
)
.dependsOn(seabattleServer, seabattleClient, sharedJvm, sharedJs)
lazy val seabattleServer =
project
.in(file("seabattle/server"))
.enablePlugins(AutomateHeaderPlugin, GitVersioning, GitBranchPrompt)
.settings(settings)
.settings(
name := "seabattle-jvm",
libraryDependencies ++= Seq(
library.catsCore,
library.circeCore,
library.circeGeneric,
library.circeParser,
library.scalaCheck % Test,
library.scalaTest % Test
),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value)
)
.dependsOn(sharedJvm)
lazy val seabattleClient =
project
.in(file("seabattle/client"))
.enablePlugins(AutomateHeaderPlugin, GitVersioning, GitBranchPrompt, ScalaJSPlugin, ScalaJSWeb)
.settings(settings)
.settings(
name := "seabattle-client",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.6"
),
scalaJSUseMainModuleInitializer := false,
scalaJSUseMainModuleInitializer in Test := false
)
.dependsOn(sharedJs)
lazy val seabattleShared =
crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("seabattle/shared"))
.settings(settings)
.settings(
name := "seabattle-shared",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "1.4.0",
"io.circe" %%% "circe-core" % "0.10.0",
"io.circe" %%% "circe-generic" % "0.10.0",
"io.circe" %%% "circe-parser" % "0.10.0",
"org.scalacheck" %%% "scalacheck" % "1.14.0" % Test,
"org.scalatest" %%% "scalatest" % "3.0.5" % Test
)
)
.jsConfigure(_ enablePlugins ScalaJSWeb)
lazy val sharedJvm = seabattleShared.jvm
lazy val sharedJs = seabattleShared.js
// *****************************************************************************
// Library dependencies
// *****************************************************************************
lazy val library =
new {
object Version {
val akka = "2.5.17"
val akkaQuartz = "1.6.1-akka-2.5.x"
val cats = "1.4.0"
val circe = "0.10.0"
val ficus = "1.4.2"
val guice = "4.1.0"
val playBootstrap = "1.2-P26-B3"
val playMailer = "6.0.1"
val playSil = "5.0.0"
val playSlick = "3.0.3"
val postgresql = "42.2.5"
val scalaCheck = "1.14.0"
val scalaJsScr = "1.1.2"
val scalaTest = "3.0.5"
val scalaTestPlus = "3.1.2"
val slickPg = "0.16.3"
val webjarsBoot = "3.3.7"
val webjarsPlay = "2.6.2"
}
val akka = "com.typesafe.akka" %% "akka-actor" % Version.akka
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % Version.akka
val akkaQuartz = "com.enragedginger" %% "akka-quartz-scheduler" % Version.akkaQuartz
val catsCore = "org.typelevel" %% "cats-core" % Version.cats
val circeCore = "io.circe" %% "circe-core" % Version.circe
val circeGeneric = "io.circe" %% "circe-generic" % Version.circe
val circeParser = "io.circe" %% "circe-parser" % Version.circe
val ficus = "com.iheart" %% "ficus" % Version.ficus
val guice = "net.codingwell" %% "scala-guice" % Version.guice
val playBootstrap = "com.adrianhurt" %% "play-bootstrap" % Version.playBootstrap
val playMailer = "com.typesafe.play" %% "play-mailer" % Version.playMailer
val playMailerGuice= "com.typesafe.play" %% "play-mailer-guice" % Version.playMailer
val playSil = "com.mohiva" %% "play-silhouette" % Version.playSil
val playSilBcrypt = "com.mohiva" %% "play-silhouette-password-bcrypt" % Version.playSil
val playSilPersist = "com.mohiva" %% "play-silhouette-persistence" % Version.playSil
val playSilJca = "com.mohiva" %% "play-silhouette-crypto-jca" % Version.playSil
val playSilTestkit = "com.mohiva" %% "play-silhouette-testkit" % Version.playSil % "test"
val playSlick = "com.typesafe.play" %% "play-slick" % Version.playSlick
val playSlickEvo = "com.typesafe.play" %% "play-slick-evolutions" % Version.playSlick
val postgresql = "org.postgresql" % "postgresql" % Version.postgresql
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
val scalaJsScripts = "com.vmunier" %% "scalajs-scripts" % Version.scalaJsScr
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
val scalaTestPlus = "org.scalatestplus.play" %% "scalatestplus-play" % Version.scalaTestPlus
val slickPg = "com.github.tminglei" %% "slick-pg" % Version.slickPg
val slickPgCirce = "com.github.tminglei" %% "slick-pg_circe-json" % Version.slickPg
val webjarsBoot = "org.webjars" % "bootstrap" % Version.webjarsBoot
val webjarsPlay = "org.webjars" %% "webjars-play" % Version.webjarsPlay
}
// *****************************************************************************
// Settings
// *****************************************************************************
lazy val settings =
commonSettings ++
gitSettings ++
headerSettings ++
resolverSettings ++
scalafmtSettings
lazy val commonSettings =
Seq(
scalaVersion in ThisBuild := "2.12.8",
organization := "de.hoshikuzu",
licenses += ("AGPLv3",
url("https://www.gnu.org/licenses/agpl.html")),
mappings.in(Compile, packageBin) += baseDirectory.in(ThisBuild).value / "LICENSE" -> "LICENSE",
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-explaintypes",
"-feature",
"-language:_",
"-target:jvm-1.8",
"-unchecked",
"-Xcheckinit",
"-Xfuture",
"-Xlint:adapted-args",
"-Xlint:by-name-right-associative",
"-Xlint:constant",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-override",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Xlint:unsound-match",
"-Ydelambdafy:method",
"-Yno-adapted-args",
"-Ypartial-unification",
"-Ywarn-dead-code",
"-Ywarn-extra-implicit",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit",
"-Ywarn-numeric-widen",
"-Ywarn-unused:implicits",
"-Ywarn-unused:imports",
"-Ywarn-unused:locals",
"-Ywarn-unused:params",
"-Ywarn-unused:patvars",
"-Ywarn-unused:privates",
"-Ywarn-value-discard"
),
javacOptions ++= Seq(
"-source", "1.8",
"-target", "1.8"
)
)
lazy val gitSettings =
Seq(
git.useGitDescribe := true
)
lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := true
)
lazy val headerSettings =
Seq(
headerLicense := Some(HeaderLicense.AGPLv3("2017", "Jens Grassel & André Schütz"))
)
lazy val jcenter = Resolver.jcenterRepo
lazy val sonatype = "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
lazy val resolverSettings =
Seq(
externalResolvers := List(jcenter, sonatype)
)