-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
358 lines (303 loc) · 15.6 KB
/
build.xml
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
<project name="Repackager" default="repackage">
<property name="build.dir" value="build" />
<property name="build.classes" value="${build.dir}/classes" />
<property name="src.dir" value="src" />
<property name="dotcms.home" value="${basedir}/../dotCMS"/>
<property name="dotcms.dir" value="${dotcms.home}/dotCMS"/>
<property name="lib.app" value="${dotcms.dir}/WEB-INF/lib"/>
<property name="web-inf.dir" value="${dotcms.dir}/WEB-INF"/>
<property name="src-conf.dir" value="${dotcms.home}/src-conf"/>
<property file="${dotcms.home}/src/com/liferay/portal/util/build.properties"/>
<property name="build.log" location="${basedir}/build.log"/>
<path id="files-classpath">
<fileset dir="${basedir}">
<include name="jarjar_1.4.1.jar" />
<include name="myspell_ukv.jar" />
</fileset>
<fileset dir="${basedir}/buildlibs">
<include name="commons-io-2.0.1.jar"/>
</fileset>
<pathelement path="${build.classes}" />
</path>
<target name="clean">
<delete dir="${basedir}/build" failonerror="false"/>
<mkdir dir="${basedir}/build"/>
</target>
<target name="repackage" depends="clean, compile">
<!--Records the output to a file-->
<record action="start" name="${build.log}" loglevel="verbose"/>
<taskdef classname="com.tonicsystems.jarjar.PackagerTask" name="packagerTask">
<classpath>
<path refid="files-classpath"/>
</classpath>
</taskdef>
<packagerTask dotcmshome="${dotcms.home}"
outputFolder="${basedir}/build"
renameservices="true"
prefix="dot."
versionSeparator="_"
multiplejars="true"
verbose="false"
skipdependenciesreplacement="false"
skipjpsfiles="false"
skipJarsGeneration="false"
skipdependenciesjars="false">
<fileset dir="${basedir}">
<include name="*.jar"/>
<!--dotcms jars-->
<exclude name="jarjar_*"/>
<!--dotcms jars-->
<!--We CAN repackage them but applying special rules-->
<exclude name="daisydiff_*"/>
<exclude name="myspell_*"/>
<exclude name="xpp3-min_*"/>
<exclude name="jaxen_*"/>
<exclude name="jasperreports_*"/>
<exclude name="felix_*"/>
<exclude name="lesscss_*"/>
<exclude name="rhino_*"/>
<exclude name="compass-gems_*"/>
<!--We CAN repackage them but applying special rules-->
<!--FIXME-->
<exclude name="cactus.integration.ant_*"/><!--Ant build files complains if we repackage this jar-->
<exclude name="cargo-ant_*"/><!--Ant build files complains if we repackage this jar-->
<exclude name="quartz-all_*"/>
<!--FIXME-->
</fileset>
<!--++++++++++++++++++++++++++++++++++++++-->
<!--++++++++++++Special cases+++++++++++++-->
<!--We can repackage them but not rename their services files-->
<dependency path="${basedir}/xpp3-min_" generate="true"/>
<dependency path="${basedir}/jaxen_" generate="true">
<ignore parentpackage="org.w3c"/><!--Contains just ONE class and it is a common package, using it as a rule breaks the code-->
</dependency>
<dependency path="${basedir}/daisydiff_" generate="true">
<ignore parentpackage="org.w3c"/>
</dependency>
<!--We can repackage them but not rename their services files-->
<!--We have to exclude some packages in here, Ant build files complains-->
<dependency path="${basedir}/myspell_" generate="true">
<ignore parentpackage="org.apache.tools"/>
</dependency>
<dependency path="${basedir}/aws-java-sdk-core_" generate="true">
<ignore parentpackage="org.apache.http"/>
<ignore parentpackage="com.fasterxml.jackson"/>
</dependency>
<dependency path="${basedir}/aws-java-sdk-kms_" generate="true">
<ignore parentpackage="org.apache.http"/>
<ignore parentpackage="com.fasterxml.jackson"/>
</dependency>
<dependency path="${basedir}/aws-java-sdk-s3_" generate="true">
<ignore parentpackage="org.apache.http"/>
<ignore parentpackage="com.fasterxml.jackson"/>
</dependency>
<dependency path="${basedir}/jmespath-java_" generate="true">
<ignore parentpackage="org.apache.http"/>
<ignore parentpackage="com.fasterxml.jackson"/>
</dependency>
<dependency path="${basedir}/log4j-api_" generate="true">
<ignore parentpackage="org.w3c.dom"/>
</dependency>
<dependency path="${basedir}/log4j-core_" generate="true">
<ignore parentpackage="org.w3c.dom"/>
</dependency>
<dependency path="${basedir}/log4j-jcl_" generate="true">
<ignore parentpackage="org.w3c.dom"/>
</dependency>
<dependency path="${basedir}/log4j-web_" generate="true">
<ignore parentpackage="org.w3c.dom"/>
</dependency>
<!--We have to exclude some packages in here in order to be able to import report designs, that excluded package must be visible-->
<dependency path="${basedir}/jasperreports_" generate="true" renameservices="true">
<ignore parentpackage="net.sf.jasperreports"/>
</dependency>
<!--OSGI-->
<dependency path="${basedir}/felix_" generate="true" renameservices="false"/>
<!--Less and sass jars-->
<dependency path="${basedir}/lesscss_" generate="true">
<ignore parentpackage="bsh"/>
</dependency>
<dependency path="${basedir}/rhino_" generate="true">
<prefix name="Packages." strict="false"/>
</dependency>
<!-- We need it to use elastic outside dotCMS -->
<dependency path="${basedir}/elasticsearch_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
<ignore parentpackage="org.elasticsearch"/>
</dependency>
<dependency path="${basedir}/lucene-analyzers-common_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-core_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-highlighter_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-expressions_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-join_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-memory_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-queries_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-queryparser_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-sandbox_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/lucene-suggest_" generate="true" renameservices="true">
<ignore parentpackage="org.apache.lucene"/>
</dependency>
<dependency path="${basedir}/bsh_" generate="true">
<extraRule pattern="bsh.args" result="bsh.args"/>
<extraRule pattern="bsh.system" result="bsh.system"/>
<extraRule pattern="bsh.shared" result="bsh.shared"/>
<extraRule pattern="bsh.evalOnly" result="bsh.evalOnly"/>
<extraRule pattern="bsh.console" result="bsh.console"/>
<extraRule pattern="bsh.help" result="bsh.help"/>
<extraRule pattern="bsh.cwd" result="bsh.cwd"/>
<extraRule pattern="bsh.interactive" result="bsh.interactive"/>
</dependency>
<!--++++++++++++++++++++++++++++++++++++++-->
<!--List of dependencies to check if there are dependencies to old packages -->
<dependency path="${basedir}/cactus.integration.ant_"/>
<dependency path="${basedir}/cargo-ant_"/>
<dependency path="${basedir}/quartz-all_"/>
<!--
Explicit naming rules for jars
How it works:
Example: all the jars that contains the word jersey (jersey-client_1.12.jar, jersey-core_1.12.jar, jersey-json_1.12.jar, etc)
will share the same repackaged name "jersey_X_YZ" resulting in com.dot.repackage.jersey_X_YZ.xxx.yyy
Required mostly when jars share the same packaging
-->
<!--<namingrule pattern="jersey" replacement="jersey"/>
<namingrule pattern="lucene" replacement="elasticsearch"/>
<namingrule pattern="elasticsearch" replacement="elasticsearch"/>
<namingrule pattern="milton" replacement="milton"/>
<namingrule pattern="json" replacement="json"/>
<namingrule pattern="commons-jci" replacement="commons_jci"/>-->
<!--++++++++++++++++++++++++++++++++++++++-->
<!--++++++++++++++Resources+++++++++++++++-->
<dependency path="${dotcms.home}/build.xml"/>
<dependency path="${web-inf.dir}/web.xml"/>
<dependency path="${web-inf.dir}/dwr.xml"/>
<dependency path="${web-inf.dir}/springmvc-servlet.xml"/>
<dependency path="${web-inf.dir}/struts-config.xml"/>
<dependency path="${web-inf.dir}/struts-config-ext.xml"/>
<dependency path="${web-inf.dir}/validator-rules.xml"/>
<dependency path="${web-inf.dir}/tld/liferay-portlet.tld"/>
<dependency path="${web-inf.dir}/tld/liferay-util.tld"/>
<dependency path="${web-inf.dir}/tld/struts-html.tld"/>
<dependency path="${web-inf.dir}/tld/struts-logic.tld"/>
<dependency path="${web-inf.dir}/tld/struts-nested.tld"/>
<dependency path="${web-inf.dir}/tld/struts-tiles.tld"/>
<dependency path="${web-inf.dir}/tld/old/struts-html.tld"/>
<dependency path="${web-inf.dir}/tld/old/struts-logic.tld"/>
<dependency path="${web-inf.dir}/tld/old/struts-nested.tld"/>
<dependency path="${web-inf.dir}/log4j/log4j.xml"/>
<dependency path="${src-conf.dir}/dotmarketing-config.properties"/>
<dependency path="${src-conf.dir}/commons-logging.properties"/>
<dependency path="${src-conf.dir}/system.properties"/>
<dependency path="${src-conf.dir}/stxx.properties"/>
<dependency path="${src-conf.dir}/quartz.properties"/>
<dependency path="${src-conf.dir}/quartz_sequential.properties"/>
</packagerTask>
<!--Records the output to a file-->
<record action="stop" name="${build.log}" loglevel="verbose"/>
</target>
<!--++++++++++++++++++++++++++++++++++++++++++-->
<!--PACKAGER-->
<path id="packager-classpath">
<fileset dir="${basedir}">
<include name="jarjar_1.4.1.jar"/>
<include name="myspell_ukv.jar"/>
</fileset>
<fileset dir="${basedir}/buildlibs">
<include name="commons-io-2.0.1.jar"/>
</fileset>
</path>
<target name="prepare-packager">
<delete dir="${build.classes}" failonerror="false"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
</target>
<target name="compile" depends="prepare-packager" description="Compiles packager source.">
<mkdir dir="${build.classes}"/>
<javac encoding="UTF-8" debug="true" debuglevel="lines,vars,source" fork="true" srcdir="${src.dir}"
destdir="${build.classes}"
source="1.7" target="1.7" compiler="javac1.7" nowarn="true" optimize="true"
memoryinitialsize="256m" memorymaximumsize="512m">
<classpath refid="files-classpath"/>
<include name="com/tonicsystems/jarjar/**"/>
</javac>
</target>
<!--PACKAGER-->
<!--++++++++++++++++++++++++++++++++++++++++++-->
<!--++++++++++++++++++++++++++++++++++++++++++-->
<path id="complete-classpath">
<fileset dir="${basedir}">
<include name="*.jar" />
</fileset>
<pathelement path="${build.classes}" />
</path>
<path id="complete-classpath-exclude">
<fileset dir="${basedir}">
<include name="*.jar" />
<exclude name="dotcms_2.6.jar" />
</fileset>
<pathelement path="${build.classes}" />
</path>
<target name="find-duplicated-classes">
<taskdef classname="com.tonicsystems.jarjar.InspectorTask" name="inspectorTask">
<classpath>
<path refid="files-classpath" />
</classpath>
</taskdef>
<!--<inspectorTask librarypath="${lib.app}"/>-->
<!--<inspectorTask librarypath="${basedir}"/>-->
<inspectorTask librarypath="${basedir}/build"/>
</target>
<target name="find-dependencies">
<property name="lib.classpath" refid="complete-classpath"/>
<java jar="jarjar_1.4.1.jar" fork="true">
<arg value="find"/>
<arg value="jar"/>
<arg value="${lib.classpath}"/>
</java>
</target>
<!--Dependencies that have the given jar-->
<target name="find-dependencies-for-jar">
<property name="lib.classpath" refid="complete-classpath-exclude"/>
<java jar="jarjar_1.4.1.jar" fork="true">
<arg value="find"/>
<arg value="jar"/>
<arg value="dotcms_2.6.jar"/>
<arg value="${lib.classpath}"/>
</java>
</target>
<!--Who depend on a given jar-->
<target name="find-dependencies-on-jar">
<property name="lib.classpath" refid="complete-classpath-exclude"/>
<java jar="jarjar_1.4.1.jar" fork="true">
<arg value="find"/>
<arg value="jar"/>
<!--<arg value="class"/>-->
<arg value="${lib.classpath}"/>
<arg value="dotcms_2.6.jar"/>
</java>
</target>
<target name="print-classpath" description="Print the application classpath">
<!-- Capture the path as a delimited property using the refid attribute -->
<property name="app-classpath" refid="complete-classpath"/>
<!-- Emit the property to the ant console -->
<echo message="${app-classpath}"/>
</target>
<!--++++++++++++++++++++++++++++++++++++++++++-->
</project>