forked from scalatra/scalatra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
381 lines (354 loc) · 13.1 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
import com.typesafe.sbt.pgp.PgpKeys
import scala.xml._
import java.net.URL
import org.scalatra.sbt.ScalatraPlugin.scalatraWithWarOverlays
import com.typesafe.sbt.SbtScalariform.scalariformSettings
import Dependencies._
import UnidocKeys._
lazy val scalatraSettings = Seq(
organization := "org.scalatra",
crossScalaVersions := Seq("2.12.1", "2.11.8"),
scalaVersion := crossScalaVersions.value.head,
scalacOptions ++= Seq("-target:jvm-1.8", "-unchecked", "-deprecation", /*"-Yinline-warnings",*/ "-Xcheckinit", "-encoding", "utf8", "-feature", "-Ywarn-unused-import"),
scalacOptions ++= Seq("-language:higherKinds", "-language:postfixOps", "-language:implicitConversions", "-language:reflectiveCalls", "-language:existentials"),
manifestSetting,
resolvers ++= Seq(
Opts.resolver.sonatypeSnapshots,
Opts.resolver.sonatypeReleases,
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
),
dependencyOverrides := Set(
"org.scala-lang" % "scala-library" % scalaVersion.value,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang" % "scala-compiler" % scalaVersion.value
)
) ++ mavenCentralFrouFrou ++ scalariformSettings ++ Seq(Compile, Test).flatMap(c =>
scalacOptions in (c, console) --= Seq("-Ywarn-unused-import")
)
lazy val scalatraProject = Project(
id = "scalatra-project",
base = file("."),
settings = scalatraSettings ++ unidocSettings ++ doNotPublish ++ Seq(
description := "A tiny, Sinatra-like web framework for Scala",
unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(scalatraExample)
),
aggregate = Seq(scalatraCore, scalatraAuth, scalatraFileupload, scalatraCommands,
scalatraScalate, scalatraJson, scalatraSlf4j, scalatraAtmosphere,
scalatraTest, scalatraScalatest, scalatraSpecs2,
scalatraExample, scalatraSwagger, scalatraJetty,
scalatraCommon, scalatraSwaggerExt, scalatraSpring,
scalatraMetrics, scalatraCache, scalatraCacheGuava)
)
lazy val scalatraCommon = Project(
id = "scalatra-common",
base = file("common"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(servletApi % "provided,test")
)
)
lazy val scalatraCore = Project(
id = "scalatra",
base = file("core"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(
servletApi % "provided;test",
slf4jApi,
grizzledSlf4j,
jUniversalChardet,
mimeUtil,
commonsLang3,
parserCombinators,
xml,
akkaActor % "test"
),
libraryDependencies ++= Seq(akkaTestkit % "test"),
description := "The core Scalatra framework"
)
) dependsOn(
scalatraSpecs2 % "test->compile",
scalatraScalatest % "test->compile",
scalatraCommon % "compile;test->test"
)
lazy val scalatraAuth = Project(
id = "scalatra-auth",
base = file("auth"),
settings = scalatraSettings ++ Seq(
description := "Scalatra authentication module"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraFileupload = Project(
id = "scalatra-fileupload",
base = file("fileupload"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(commonsFileupload, commonsIo),
description := "Commons-Fileupload integration with Scalatra"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraAtmosphere = Project(
id = "scalatra-atmosphere",
base = file("atmosphere"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(akkaActor, akkaTestkit % "test"),
libraryDependencies ++= Seq(atmosphereRuntime, atmosphereRedis, atmosphereCompatJbossweb, atmosphereCompatTomcat, atmosphereCompatTomcat7, atmosphereClient % "test", jettyWebsocket % "test"),
description := "Atmosphere integration for scalatra"
)
) dependsOn(scalatraJson % "compile;test->test;provided->provided")
lazy val scalatraScalate = Project(
id = "scalatra-scalate",
base = file("scalate"),
settings = scalatraSettings ++ Seq(
libraryDependencies += scalate,
description := "Scalate integration with Scalatra"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraJson = Project(
id = "scalatra-json",
base = file("json"),
settings = scalatraSettings ++ Seq(
description := "JSON support for Scalatra",
libraryDependencies ++= Seq(json4sJackson % "provided", json4sNative % "provided", json4sCore)
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraCommands = Project(
id = "scalatra-commands",
base = file("commands"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(
"commons-validator" % "commons-validator" % "1.5.1"
),
libraryDependencies ++= Seq(scalaz, jodaTime, jodaConvert),
initialCommands :=
"""
|import scalaz._
|import Scalaz._
|import org.scalatra._
|import org.scalatra.util._
|import conversion._
|import commands._
|import BindingSyntax._
""".stripMargin,
description := "Data binding and validation with scalaz for Scalatra"
)
) dependsOn(
scalatraJson % "compile;test->test;provided->provided")
lazy val scalatraJetty = Project(
id = "scalatra-jetty",
base = file("jetty"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(
servletApi,
jettyServlet
),
description := "Embedded Jetty server for Scalatra apps"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraTest = Project(
id = "scalatra-test",
base = file("test"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(
grizzledSlf4j,
jettyWebapp,
servletApi,
mockitoAll,
commonsLang3,
httpclient,
httpmime,
jodaTime % "provided",
jodaConvert % "provided"
) ++ specs2.map(_ % "test"),
description := "The abstract Scalatra test framework"
)
) dependsOn(scalatraCommon % "compile;test->test;provided->provided")
lazy val scalatraScalatest = Project(
id = "scalatra-scalatest",
base = file("scalatest"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(scalatest, junit, testng % "optional", guice % "optional"),
description := "ScalaTest support for the Scalatra test framework"
)
) dependsOn(scalatraTest % "compile;test->test;provided->provided")
lazy val scalatraSpecs2 = Project(
id = "scalatra-specs2",
base = file("specs2"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= specs2,
description := "Specs2 support for the Scalatra test framework"
)
) dependsOn(scalatraTest % "compile;test->test;provided->provided")
lazy val scalatraSwagger = Project(
id = "scalatra-swagger",
base = file("swagger"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(json4sExt, parserCombinators, logbackClassic % "provided"),
description := "Scalatra integration with Swagger"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided", scalatraJson % "compile;test->test;provided->provided")
lazy val scalatraSwaggerExt = Project(
id = "scalatra-swagger-ext",
base = file("swagger-ext"),
settings = scalatraSettings ++ Seq(
description := "Deeper Swagger integration for scalatra"
)
) dependsOn(scalatraSwagger % "compile;test->test;provided->provided", scalatraCommands % "compile;test->test;provided->provided", scalatraAuth % "compile;test->test")
lazy val scalatraSlf4j = Project(
id = "scalatra-slf4j",
base = file("slf4j"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(grizzledSlf4j, logbackClassic % "provided"),
description := "Scalatra integration with SLF4J and Logback"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraSpring = Project(
id = "scalatra-spring",
base = file("spring"),
settings = scalatraSettings ++ Seq(
libraryDependencies += springWeb,
description := "Scalatra integration with Spring Framework"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraMetrics = Project(
id = "scalatra-metrics",
base = file("metrics"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(metricsScala, metricsServlets, metricsServlet),
description := "Scalatra integration with Metrics"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraCache = Project(
id = "scalatra-cache",
base = file("cache"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(jodaTime, jodaConvert),
description := "Scalatra Cache support"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided")
lazy val scalatraCacheGuava = Project(
id = "scalatra-cache-guava",
base = file("cache-guava"),
settings = scalatraSettings ++ Seq(
libraryDependencies ++= Seq(googleGuava, googleFindBugs),
description := "Scalatra Cache integration with Google Guava"
)
) dependsOn(scalatraCore % "compile;test->test;provided->provided", scalatraCache % "compile;test->test;provided->provided")
lazy val scalatraExample = Project(
id = "scalatra-example",
base = file("example"),
settings = scalatraSettings ++ doNotPublish ++ scalatraWithWarOverlays ++ Seq(
libraryDependencies += servletApi % "container;test;provided",
libraryDependencies += jettyWebsocket % "container;test;provided",
libraryDependencies += jettyServer % "container;test;provided",
libraryDependencies += jettyPlus % "container;test",
libraryDependencies ++= Seq(jettyWebapp % "container;test", slf4jSimple),
libraryDependencies += json4sJackson,
libraryDependencies += atmosphereJQuery,
description := "Scalatra example project"
)
) dependsOn(
scalatraCore % "compile;test->test;provided->provided", scalatraScalate,
scalatraAuth, scalatraFileupload, scalatraJetty, scalatraCommands, scalatraAtmosphere
)
lazy val manifestSetting = packageOptions += {
Package.ManifestAttributes(
"Created-By" -> "Simple Build Tool",
"Built-By" -> System.getProperty("user.name"),
"Build-Jdk" -> System.getProperty("java.version"),
"Specification-Title" -> name.value,
"Specification-Version" -> version.value,
"Specification-Vendor" -> organization.value,
"Implementation-Title" -> name.value,
"Implementation-Version" -> version.value,
"Implementation-Vendor-Id" -> organization.value,
"Implementation-Vendor" -> organization.value
)
}
// Things we care about primarily because Maven Central demands them
lazy val mavenCentralFrouFrou = Seq(
homepage := Some(new URL("http://www.scalatra.org/")),
startYear := Some(2009),
licenses := Seq(("BSD", new URL("http://github.com/scalatra/scalatra/raw/HEAD/LICENSE"))),
pomExtra := pomExtra.value ++ Group(
<scm>
<url>http://github.com/scalatra/scalatra</url>
<connection>scm:git:git://github.com/scalatra/scalatra.git</connection>
</scm>
<developers>
<developer>
<id>riffraff</id>
<name>Gabriele Renzi</name>
<url>http://www.riffraff.info</url>
</developer>
<developer>
<id>alandipert</id>
<name>Alan Dipert</name>
<url>http://alan.dipert.org</url>
</developer>
<developer>
<id>rossabaker</id>
<name>Ross A. Baker</name>
<url>http://www.rossabaker.com/</url>
</developer>
<developer>
<id>chirino</id>
<name>Hiram Chirino</name>
<url>http://hiramchirino.com/blog/</url>
</developer>
<developer>
<id>casualjim</id>
<name>Ivan Porto Carrero</name>
<url>http://flanders.co.nz/</url>
</developer>
<developer>
<id>jlarmstrong</id>
<name>Jared Armstrong</name>
<url>http://www.jaredarmstrong.name/</url>
</developer>
<developer>
<id>mnylen</id>
<name>Mikko Nylen</name>
<url>https://github.com/mnylen/</url>
</developer>
<developer>
<id>dozed</id>
<name>Stefan Ollinger</name>
<url>http://github.com/dozed/</url>
</developer>
<developer>
<id>sdb</id>
<name>Stefan De Boey</name>
<url>http://github.com/sdb/</url>
</developer>
<developer>
<id>ymasory</id>
<name>Yuvi Masory</name>
<url>http://github.com/ymasory/</url>
</developer>
<developer>
<id>jfarcand</id>
<name>Jean-François Arcand</name>
<url>http://github.com/jfarcand/</url>
</developer>
<developer>
<id>ceedubs</id>
<name>Cody Alen</name>
<url>http://github.com/ceedubs/</url>
</developer>
<developer>
<id>BowlingX</id>
<name>David Heidrich</name>
<url>http://github.com/BowlingX/</url>
</developer>
<developer>
<id>ayush</id>
<name>Ayush Gupta</name>
<url>hhttps://github.com/ayush</url>
</developer>
<developer>
<id>seratch</id>
<name>Kazuhiro Sera</name>
<url>hhttps://github.com/seratch</url>
</developer>
</developers>
)
)
lazy val doNotPublish = Seq(publish := {}, publishLocal := {}, PgpKeys.publishSigned := {}, PgpKeys.publishLocalSigned := {})