This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.sbt
216 lines (186 loc) · 7.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
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
import sbt._
def lfService = lfService620
def lfPersistence = lfPersistence620
def hook = hookLf620
lazy val util = (project in file("valamis-util"))
.settings(Settings.common: _*)
.settings(name := "valamis-util")
.settings(libraryDependencies += Libraries.json4s)
lazy val lfService620 = (project in file("learn-liferay620-services"))
.settings(Settings.common: _*)
.settings(organization := "com.arcusys.learn")
.settings(name := "learn-liferay620-services")
.settings(libraryDependencies ++= Dependencies.liferay620)
.dependsOn(util)
lazy val questionbank = (project in file("valamis-questionbank"))
.settings(Settings.common: _*)
.settings(libraryDependencies += Libraries.subcut)
.settings(name := "valamis-questionbank")
lazy val lrssupport = (project in file("valamis-lrssupport"))
.settings(Settings.common: _*)
.settings(name := "valamis-lrssupport")
.settings(libraryDependencies ++= (Settings.liferay.dependencies
++ Dependencies.oauthClient
++ Dependencies.lrs))
.settings(libraryDependencies += Libraries.subcut)
.dependsOn(lfService)
lazy val core = (project in file("valamis-core"))
.settings(Settings.common: _*)
.settings(name := "valamis-core")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.settings(libraryDependencies += Libraries.subcut)
.dependsOn(lfService, util)
lazy val quiz = (project in file("valamis-quiz"))
.settings(Settings.common: _*)
.settings(name := "valamis-quiz")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.dependsOn(questionbank, core)
lazy val tincanLesson = (project in file("valamis-tincan-lesson"))
.settings(Settings.common: _*)
.settings(name := "valamis-tincan-lesson")
.dependsOn(core, util)
lazy val scormLesson = (project in file("valamis-scorm-lesson"))
.settings(Settings.common: _*)
.settings(name := "valamis-scorm-lesson")
.settings(libraryDependencies ++= Seq(Libraries.scalaMock, Libraries.junit).map(_ % Test))
.dependsOn(core, util)
lazy val lesson = (project in file("valamis-lesson"))
.settings(Settings.common: _*)
.settings(name := "valamis-lesson")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.dependsOn(core, tincanLesson, scormLesson, lrssupport)
lazy val gradebook = (project in file("valamis-gradebook"))
.settings(Settings.common: _*)
.settings(name := "valamis-gradebook")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.dependsOn(core, quiz, questionbank, scormLesson, lesson, lfService)
lazy val social = (project in file("valamis-social"))
.settings(Settings.common: _*)
.settings(name := "valamis-social")
.settings(libraryDependencies ++= (Settings.liferay.dependencies))
.dependsOn(lfService, gradebook, certificate, lesson)
lazy val slickPersistence = (project in file("valamis-slick-persistence"))
.settings(Settings.common: _*)
.settings(name := "valamis-slick-persistence")
.settings(libraryDependencies ++= Dependencies.slick)
.settings(libraryDependencies ++= Dependencies.javax)
.settings(libraryDependencies ++= Seq(Libraries.lrsApi, Libraries.valamisCore))
.settings(parallelExecution in test := false)
.dependsOn(core, certificate, social)
lazy val certificate = (project in file("valamis-certificate"))
.settings(Settings.common: _*)
.settings(name := "valamis-certificate")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.dependsOn(core, lrssupport, lesson, gradebook)
lazy val lessonGenerator = (project in file("valamis-lesson-generator"))
.settings(Settings.common: _*)
.settings(name := "valamis-lesson-generator")
.settings(libraryDependencies ++= (Settings.liferay.dependencies ++ Seq(Libraries.commonsLang, Libraries.poiOoxml)))
.dependsOn(core, questionbank, quiz, lesson)
lazy val slide = (project in file("valamis-slide"))
.settings(Settings.common: _*)
.settings(name := "valamis-slide")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.dependsOn(core, questionbank, lesson, lessonGenerator, lrssupport)
lazy val persistenceApi = (project in file("learn-persistence-api"))
.settings(Settings.common: _*)
.settings(organization := "com.arcusys.learn")
.settings(name := "learn-persistence-api")
.settings(libraryDependencies ++= Settings.liferay.dependencies)
.dependsOn(core, quiz, lesson, lrssupport)
lazy val lfPersistence620 = (project in file("learn-persistence-liferay620"))
.settings(Settings.common: _*)
.settings(organization := "com.arcusys.learn")
.settings(name := "learn-persistence-liferay620")
.settings(libraryDependencies ++= Settings.Liferay620.dependencies)
lazy val lfPersistenceImpl = (project in file("learn-persistence-liferay-wrapper"))
.settings(Settings.common: _*)
.settings(organization := "com.arcusys.learn")
.settings(name := "learn-persistence-liferay-wrapper")
.settings(libraryDependencies ++= Settings.liferay.dependencies :+ Libraries.antiXml)
.settings(parallelExecution in test := false)
.dependsOn(
persistenceApi,
lfPersistence,
questionbank,
lfService,
lrssupport,
core,
quiz,
tincanLesson,
scormLesson,
lesson,
lessonGenerator,
gradebook,
slide
)
lazy val hookLf620 = (project in file("valamis-hook"))
.settings(Settings.common: _*)
.settings(warSettings ++ webappSettings : _*)
.settings(artifactName in packageWar := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
"learn-liferay620-hook." + artifact.extension
})
.settings(libraryDependencies ++= Settings.Liferay620.dependencies)
lazy val portlet = (project in file("learn-portlet"))
.settings(Settings.common: _*)
.settings(organization := "com.arcusys.learn")
.settings(warSettings ++ webappSettings : _*)
.settings(artifactName in packageWar := { (sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
module.name + "." + artifact.extension
})
.settings(postProcess in webapp := { webappDir =>
IO.delete(webappDir / "WEB-INF/learn-persistence-sb")
IO.delete(webappDir / "WEB-INF/sql")
IO.delete(webappDir / "WEB-INF/liferay-plugin-package.properties")
IO.copyDirectory(
webappDir / "../../../" / Settings.liferay.lfPersistenceFolder / "src/main/resources/generated",
webappDir / "WEB-INF",
overwrite = true)
IO.copyDirectory(
webappDir / "../../../learn-portlet/src/main/resources/ext-libs",
webappDir / "WEB-INF/lib",
overwrite = true)
//todo: move it to prepare resource task
val propertiesContent = IO.read(webappDir / "../../../learn-portlet/src/main/resources/liferay-plugin-package.properties")
.replace("${supported.liferay.versions}", Settings.liferay.supportVersion)
IO.write(webappDir / "WEB-INF/liferay-plugin-package.properties", propertiesContent)
})
.settings(name := "learn-portlet")
.settings(libraryDependencies ++= (
Settings.liferay.dependencies
++ Dependencies.slick
++ Dependencies.guice
++ Dependencies.json4s
++ Dependencies.oauthClient
++ Seq(
Libraries.subcut,
Libraries.poiOoxml,
Libraries.httpClient,
Libraries.slf4j,
Libraries.slf4jSimple,
Libraries.slf4jLclOver,
Libraries.scalatra,
Libraries.scalatraAuth,
Libraries.scalatraJson,
Libraries.apacheXml
exclude("org.apache.avalon.framework", "avalon-framework-api")
exclude("org.apache.avalon.framework", "avalon-framework-impl"),
Libraries.apacheAvalonApi, Libraries.apacheAvalonImpl,
Libraries.commonsLang,
Libraries.commonsFileUpload,
Libraries.commonsIO,
Libraries.antiSamy,
Libraries.quartz,
Libraries.nimbusJose,
Libraries.scalatraScalatest % Test,
Libraries.prettyTime,
Libraries.valamisAuth
)
)
)
.dependsOn(
questionbank, lfService, lrssupport, core, quiz,
tincanLesson, scormLesson, lesson, lessonGenerator,
gradebook, certificate, slide, social,
persistenceApi, lfPersistenceImpl, slickPersistence
)