-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
272 lines (249 loc) · 13.2 KB
/
build.gradle
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
/*
* This software is in the public domain under CC0 1.0 Universal plus a
* Grant of Patent License.
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to the
* public domain worldwide. This software is distributed without any
* warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication
* along with this software (see the LICENSE.md file). If not, see
* <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
apply plugin: 'groovy'
// sourceCompatibility = '1.8'
// targetCompatibility = '1.8'
def componentNode = parseComponent(project)
version = componentNode.'@version'
def jarBaseName = componentNode.'@name'
def moquiDir = projectDir.parentFile.parentFile.parentFile
def frameworkDir = file(moquiDir.absolutePath + '/framework')
// to run use "gradle dependencyUpdates"
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.47.0' }
}
dependencyUpdates.resolutionStrategy = { componentSelection { rules -> rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier -> selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ }
if (rejected) selection.reject('Release candidate')
} } }
repositories {
flatDir name: 'localLib', dirs: frameworkDir.absolutePath + '/lib'
flatDir name: 'librepo', dirs: projectDir.absolutePath + '/librepo'
mavenCentral()
}
// Log4J has annotation processors, disable to avoid warning
tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }
dependencies {
implementation project(':framework')
// Apache PDFBox
implementation ('org.apache.pdfbox:pdfbox:3.0.0') // Apache 2.0
// Apache FOP - Apache 2.0
// NOTE: in Apache FOP 2.6 the dependencies are really messed up, includes redundant fop-core, fop-events, fop-url
implementation ('org.apache.xmlgraphics:fop-events:2.9') {
exclude group: 'org.apache.ant'
}
implementation ('org.apache.xmlgraphics:fop-util:2.9')
implementation ('org.apache.xmlgraphics:fop-core:2.9') {
exclude group: 'xalan'
exclude group: 'xml-apis' // can't exclude batik-ext but has some same classes as xml-apis so exclude that
exclude group: 'org.apache.ant'
exclude group: 'javax.servlet'
exclude group: 'javax.media'
exclude group: 'com.sun.media'
}
implementation ('org.apache.xmlgraphics:batik-transcoder:1.17') {
exclude group: 'xalan'
exclude group: 'org.mozilla'
exclude group: 'org.python'
}
implementation ('org.apache.xmlgraphics:batik-constants:1.17') {
exclude group: 'org.mozilla'
exclude group: 'org.python'
}
implementation ('org.apache.xmlgraphics:batik-i18n:1.17') {
exclude group: 'org.mozilla'
exclude group: 'org.python'
}
// NOTE: in theory Apache Avalon is not required for FOP 2.6, but getting runtime errors without it
implementation group: 'org.apache.avalon.framework', name: 'avalon-framework-api', version: '4.3.1'
implementation group: 'org.apache.avalon.framework', name: 'avalon-framework-impl', version: '4.3.1'
implementation 'xerces:xercesImpl:2.12.2'
// barcode4j as a module to avoid required dependency on ant
implementation module('net.sf.barcode4j:barcode4j:2.1')
implementation module('net.sf.barcode4j:barcode4j-fop-ext:2.1')
// CSSBox (HTML/CSS to SVG, etc)
implementation ('net.sf.cssbox:cssbox:4.17') { // LGPL <== NOTE!
exclude group: 'xalan'
exclude group: 'xml-apis' // can't exclude batik-ext but has some same classes as xml-apis so exclude that
}
// NOTE: this comes from a custom build, see: https://github.com/jonesde/CSSBoxPdf
implementation name: 'cssbox-pdf', version: '1.0-SNAPSHOT' // LGPL <== NOTE!
}
// by default the Java plugin runs test on build, change to not do that (only run test if explicit task)
// no longer workds as of gradle 4.8 or possibly earlier, use clear() instead: check.dependsOn.remove(test)
check.dependsOn.clear()
task cleanLib(type: Delete) { delete fileTree(dir: projectDir.absolutePath+'/lib', include: '*') }
clean.dependsOn cleanLib
jar {
destinationDirectory = file(projectDir.absolutePath + '/lib')
archiveBaseName = jarBaseName
}
task copyDependencies { doLast {
// logger.lifecycle("configurations.runtimeClasspath: ${configurations.runtimeClasspath.files({true}).join('\n')}\n\n")
// logger.lifecycle("project(':framework').configurations.runtimeClasspath: ${project(':framework').configurations.runtimeClasspath.files({true}).join('\n')}")
copy { from (configurations.runtimeClasspath - project(':framework').configurations.runtimeClasspath - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib') }
} }
copyDependencies.dependsOn cleanLib
jar.dependsOn copyDependencies
/*
For convenience since FOP dependencies are always so messed up:
gradle runtime:component:moqui-fop:dependencies
FOP 2.5:
+--- org.apache.xmlgraphics:fop-core:2.5
| +--- org.apache.xmlgraphics:batik-anim:1.13
| | +--- org.apache.xmlgraphics:batik-awt-util:1.13
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | +--- org.apache.xmlgraphics:batik-util:1.13
| | | | +--- org.apache.xmlgraphics:batik-constants:1.13
| | | | | \--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | | +--- org.apache.xmlgraphics:batik-i18n:1.13
| | | | | \--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | | \--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | \--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| | +--- org.apache.xmlgraphics:batik-css:1.13
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| | | \--- xml-apis:xml-apis-ext:1.3.04
| | +--- org.apache.xmlgraphics:batik-dom:1.13
| | | +--- org.apache.xmlgraphics:batik-css:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-ext:1.13
| | | | \--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-xml:1.13
| | | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | | \--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | | +--- xml-apis:xml-apis:1.4.01
| | | \--- xml-apis:xml-apis-ext:1.3.04
| | +--- org.apache.xmlgraphics:batik-ext:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-parser:1.13
| | | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-xml:1.13 (*)
| | | \--- xml-apis:xml-apis-ext:1.3.04
| | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | +--- org.apache.xmlgraphics:batik-svg-dom:1.13
| | | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-css:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-dom:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-ext:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-parser:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | | \--- xml-apis:xml-apis-ext:1.3.04
| | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | \--- xml-apis:xml-apis-ext:1.3.04
| +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| +--- org.apache.xmlgraphics:batik-bridge:1.13
| | +--- org.apache.xmlgraphics:batik-anim:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-css:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-dom:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-gvt:1.13
| | | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | \--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-parser:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-script:1.13
| | | +--- org.apache.xmlgraphics:batik-anim:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | \--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | +--- org.apache.xmlgraphics:batik-svg-dom:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-xml:1.13 (*)
| | +--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| | \--- xml-apis:xml-apis-ext:1.3.04
| +--- org.apache.xmlgraphics:batik-extension:1.13
| | +--- org.apache.xmlgraphics:batik-anim:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-bridge:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-css:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-dom:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-ext:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-gvt:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-parser:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | +--- org.apache.xmlgraphics:batik-svg-dom:1.13 (*)
| | \--- org.apache.xmlgraphics:batik-util:1.13 (*)
| +--- org.apache.xmlgraphics:batik-gvt:1.13 (*)
| +--- org.apache.xmlgraphics:batik-transcoder:1.13
| | +--- org.apache.xmlgraphics:batik-anim:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-bridge:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-dom:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-gvt:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | +--- org.apache.xmlgraphics:batik-svggen:1.13
| | | +--- org.apache.xmlgraphics:batik-awt-util:1.13 (*)
| | | +--- org.apache.xmlgraphics:batik-shared-resources:1.13
| | | \--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-util:1.13 (*)
| | +--- org.apache.xmlgraphics:batik-xml:1.13 (*)
| | \--- xml-apis:xml-apis-ext:1.3.04
| +--- org.apache.xmlgraphics:fop-events:2.5 (*)
| +--- org.apache.xmlgraphics:fop-util:2.5 (*)
| +--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| +--- commons-io:commons-io:1.3.1 -> 2.7
| +--- commons-logging:commons-logging:1.0.4 -> 1.2
| \--- org.apache.pdfbox:fontbox:2.0.16 -> 2.0.20 (*)
FOP 2.4:
+--- org.apache.xmlgraphics:fop:2.4
| +--- org.apache.xmlgraphics:fop-util:2.4
| | \--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| +--- org.apache.xmlgraphics:fop-events:2.4
| | +--- org.apache.xmlgraphics:fop-util:2.4 (*)
| | +--- com.thoughtworks.qdox:qdox:1.12
| | +--- commons-io:commons-io:1.3.1 -> 2.6
| | +--- org.apache.ant:ant:1.8.2
| | | \--- org.apache.ant:ant-launcher:1.8.2
| | \--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| \--- org.apache.xmlgraphics:fop-core:2.4
| +--- org.apache.xmlgraphics:batik-anim:1.12 (*)
| +--- org.apache.xmlgraphics:batik-awt-util:1.12 (*)
| +--- org.apache.xmlgraphics:batik-bridge:1.12 (*)
| +--- org.apache.xmlgraphics:batik-extension:1.12
| | +--- org.apache.xmlgraphics:batik-anim:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-awt-util:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-bridge:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-css:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-dom:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-ext:1.12
| | +--- org.apache.xmlgraphics:batik-gvt:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-parser:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-svg-dom:1.12 (*)
| | +--- org.apache.xmlgraphics:batik-util:1.12 (*)
| | \--- xml-apis:xml-apis-ext:1.3.04
| +--- org.apache.xmlgraphics:batik-gvt:1.12 (*)
| +--- org.apache.xmlgraphics:batik-transcoder:1.12 (*)
| +--- org.apache.xmlgraphics:fop-events:2.4 (*)
| +--- org.apache.xmlgraphics:fop-util:2.4 (*)
| +--- org.apache.xmlgraphics:xmlgraphics-commons:2.4 (*)
| +--- commons-io:commons-io:1.3.1 -> 2.6
| +--- commons-logging:commons-logging:1.0.4 -> 1.2
| +--- javax.servlet:servlet-api:2.2
| +--- org.apache.ant:ant:1.8.2 (*)
| +--- org.apache.pdfbox:fontbox:2.0.16 -> 2.0.17 (*)
| +--- javax.media:jai-core:1.1.3
| \--- com.sun.media:jai-codec:1.1.3 FAILED
*/