-
Notifications
You must be signed in to change notification settings - Fork 280
/
build.sbt
279 lines (244 loc) · 8.33 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
import Dependencies._
import LiftSbtHelpers._
ThisBuild / organization := "net.liftweb"
ThisBuild / version := "3.6.0-SNAPSHOT"
ThisBuild / homepage := Some(url("https://www.liftweb.net"))
ThisBuild / licenses += ("Apache License, Version 2.0", url("https://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / startYear := Some(2006)
ThisBuild / organizationName := "WorldWide Conferencing, LLC"
val scala211Version = "2.11.12"
val scala212Version = "2.12.15"
val scala213Version = "2.13.8"
val crossUpTo212 = Seq(scala212Version, scala211Version)
val crossUpTo213 = scala213Version +: crossUpTo212
ThisBuild / scalaVersion := scala212Version
ThisBuild / crossScalaVersions := crossUpTo212 // default everyone to 2.12 for now
ThisBuild / libraryDependencies ++= Seq(specs2, specs2Matchers, specs2Mock, scalacheck, scalactic, scalatest)
ThisBuild / scalacOptions ++= Seq("-deprecation")
// Settings for Sonatype compliance
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishTo := {
if (isSnapshot.value) {
Some(Opts.resolver.sonatypeSnapshots)
} else {
Some(Opts.resolver.sonatypeStaging)
}
}
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/lift/framework"), "scm:git:https://github.com/lift/framework.git"))
ThisBuild / pomExtra := Developers.toXml
ThisBuild / credentials += Credentials(BuildPaths.getGlobalSettingsDirectory(state.value, BuildPaths.getGlobalBase(state.value)) / ".credentials")
initialize := {
printLogo(name.value, version.value, scalaVersion.value)
}
ThisBuild / resolvers ++= Seq(
"snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
"releases" at "https://oss.sonatype.org/content/repositories/releases"
)
lazy val liftProjects = core ++ web ++ persistence
lazy val framework =
liftProject("lift-framework", file("."))
.aggregate(liftProjects: _*)
.enablePlugins(ScalaUnidocPlugin)
// Core Projects
// -------------
lazy val core: Seq[ProjectReference] =
Seq(common, actor, markdown, json, json_scalaz7, json_ext, util)
lazy val common =
coreProject("common")
.settings(
description := "Common Libraties and Utilities",
libraryDependencies ++= Seq(slf4j_api, logback, slf4j_log4j12, scala_xml, scala_parser)
)
.settings(crossScalaVersions := crossUpTo213)
lazy val actor =
coreProject("actor")
.dependsOn(common)
.settings(
description := "Simple Actor",
Test / parallelExecution := false
)
.settings(crossScalaVersions := crossUpTo213)
lazy val markdown =
coreProject("markdown")
.settings(
description := "Markdown Parser",
Test / parallelExecution := false,
libraryDependencies ++= Seq(scalatest, scalatest_junit, scala_xml, scala_parser)
)
.settings(crossScalaVersions := crossUpTo213)
lazy val json =
coreProject("json")
.settings(
description := "JSON Library",
Test / parallelExecution := false,
libraryDependencies ++= Seq(scalap(scalaVersion.value), paranamer, scala_xml)
)
.settings(crossScalaVersions := crossUpTo213)
lazy val documentationHelpers =
coreProject("documentation-helpers")
.settings(description := "Documentation Helpers")
.dependsOn(util)
.settings(crossScalaVersions := crossUpTo213)
lazy val json_scalaz7 =
coreProject("json-scalaz7")
.dependsOn(json)
.settings(
description := "JSON Library based on Scalaz 7",
libraryDependencies ++= Seq(scalaz7)
)
.settings(crossScalaVersions := crossUpTo213)
lazy val json_ext =
coreProject("json-ext")
.dependsOn(common, json)
.settings(
description := "Extentions to JSON Library",
libraryDependencies ++= Seq(commons_codec, joda_time, joda_convert)
)
.settings(crossScalaVersions := crossUpTo213)
lazy val util =
coreProject("util")
.dependsOn(actor, json, markdown)
.settings(
description := "Utilities Library",
Test / parallelExecution := false,
libraryDependencies ++= Seq(
scala_compiler(scalaVersion.value),
joda_time,
joda_convert,
commons_codec,
javamail,
log4j,
htmlparser,
xerces,
jbcrypt
)
)
.settings(crossScalaVersions := crossUpTo213)
// Web Projects
// ------------
lazy val web: Seq[ProjectReference] =
Seq(testkit, webkit)
lazy val testkit =
webProject("testkit")
.dependsOn(util)
.settings(
description := "Testkit for Webkit Library",
libraryDependencies ++= Seq(commons_httpclient, servlet_api)
)
.settings(crossScalaVersions := crossUpTo213)
lazy val webkit =
webProject("webkit")
.dependsOn(util, testkit % "provided")
.settings(
description := "Webkit Library",
Test / parallelExecution := false,
libraryDependencies ++= Seq(
commons_fileupload,
rhino,
servlet_api,
specs2Prov,
specs2MatchersProv,
jetty6,
jwebunit,
mockito_scalatest,
jquery,
jasmineCore,
jasmineAjax
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, scalaMajor)) if scalaMajor >= 13 => Seq(scala_parallel_collections)
case _ => Seq.empty
}
},
Test / initialize := {
System.setProperty(
"net.liftweb.webapptest.src.test.webapp",
((Test / sourceDirectory).value / "webapp").absString
)
},
Compile / unmanagedSourceDirectories += {
(Compile / sourceDirectory).value / ("scala_" + scalaBinaryVersion.value)
},
Test / unmanagedSourceDirectories += {
(Test / sourceDirectory).value / ("scala_" + scalaBinaryVersion.value)
},
Compile / compile := (Compile / compile).dependsOn(WebKeys.assets).value,
/**
* This is to ensure that the tests in net.liftweb.webapptest run last
* so that other tests (MenuSpec in particular) run before the SiteMap
* is set.
*/
Test / testGrouping := {
(Test / definedTests).map { tests =>
import Tests._
val (webapptests, others) = tests.partition { test =>
test.name.startsWith("net.liftweb.webapptest")
}
Seq(
new Group("others", others, InProcess),
new Group("webapptests", webapptests, InProcess)
)
}.value
},
)
.enablePlugins(SbtWeb)
.settings(crossScalaVersions := crossUpTo213)
// Persistence Projects
// --------------------
lazy val persistence: Seq[ProjectReference] =
Seq(db, proto, mapper, record, squeryl_record, mongodb, mongodb_record)
lazy val db =
persistenceProject("db")
.dependsOn(util, webkit)
.settings(libraryDependencies += mockito_scalatest)
.settings(crossScalaVersions := crossUpTo213)
lazy val proto =
persistenceProject("proto")
.dependsOn(webkit)
.settings(crossScalaVersions := crossUpTo213)
lazy val mapper =
persistenceProject("mapper")
.dependsOn(db, proto)
.settings(
description := "Mapper Library",
Test / parallelExecution := false,
libraryDependencies ++= Seq(h2, derby, jbcrypt),
Test / initialize := {
System.setProperty(
"derby.stream.error.file",
((Test / crossTarget).value / "derby.log").absolutePath
)
}
)
.settings(crossScalaVersions := crossUpTo213)
lazy val record =
persistenceProject("record")
.dependsOn(proto)
.settings(libraryDependencies ++= Seq(jbcrypt))
.settings(crossScalaVersions := crossUpTo213)
lazy val squeryl_record =
persistenceProject("squeryl-record")
.dependsOn(record, db)
.settings(libraryDependencies ++= Seq(h2, squeryl))
lazy val mongodb =
persistenceProject("mongodb")
.dependsOn(json_ext, util)
.settings(
crossScalaVersions := crossUpTo213,
Test / parallelExecution := false,
libraryDependencies ++= Seq(mongo_java_driver, mongo_java_driver_async),
Test / initialize := {
System.setProperty(
"java.util.logging.config.file",
((Test / resourceDirectory).value / "logging.properties").absolutePath
)
}
)
lazy val mongodb_record =
persistenceProject("mongodb-record")
.dependsOn(record, mongodb)
.settings(
crossScalaVersions := crossUpTo213,
Test / parallelExecution := false
)