forked from pentaho/pdi-agile-bi-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
512 lines (437 loc) · 19.8 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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<!--===========================================================================
This is the build file for the Pentaho Agile BI Project
This build file will use the subfloor.xml file as the default build
process and should only override the tasks that need to differ from
the common build file.
See subfloor.xml for more details
============================================================================-->
<project name="Agile BI" basedir="." default="dist"
xmlns:ivy="antlib:org.apache.ivy.ant" >
<description>
This build file is used to create the Agile BI project
and works with the subfloor.xml file.
</description>
<!-- Import the common_build.xml file which contains all the default tasks -->
<import file="build-res/subfloor-pkg.xml"/>
<property name="platform.dist.dir"
value="."
description="Location of platform assembly zip" />
<property name="report-designer-assembly.dir"
value="../report-designer-assembly"
description="Location of report designer assembly zip" />
<property name="monetdb-plugin-assembly.dir"
value="../monetdb-bulk-loader/dist"
description="Location of MonetDB assembly zip" />
<property name="insta-plugin-assembly.dir"
value="../pentaho-insta-tmp/dist"
description="Location of insta wizard assembly zip" />
<property name="platform.unzip.dir"
value="${bin.dir}/platform-unzip"
description="Location of platform assembly zip" />
<property name="report-designer.unzip.dir"
value="${bin.dir}/report-designer-unzip"
description="Location of expanded report designer assembly zip" />
<property name="insta.unzip.dir"
value="${bin.dir}/insta-unzip"
description="Location of expanded report designer assembly zip" />
<property name="kettle.dist.dir"
value="../kettle"
description="Location of kettle spoon zip" />
<property name="analyzer.dist.dir"
value="."
description="Location of Analyzer Agile BI plugin" />
<property name="geo.dist.dir"
value="."
description="Location of the Geo Agile BI plugin" />
<property name="pdiwithagilebi"
value="pdi-ce-agile-bi"
description="Name of the pdi distribution with agile bi"/>
<property name="server.assembly.filename" value="server-assembly.properties" />
<target name="resolve"
depends="resolve-default, resolve-test, ivy.check-releasable"
description="Retrieves all the dependent libraries" />
<target name="dist-noresolve" depends="jar,package" description="Builds and packages the application" />
<target name="dist" depends="resolve,jar,package" description="Builds and packages the application" />
<target name="clean-dist">
<delete dir="${dist.dir}" />
<delete dir="${stage.dir}" />
<delete dir="${platform.unzip.dir}" />
<delete dir="${report-designer.unzip.dir}" />
</target>
<!--
AS STATED ABOVE, THE ONLY TASKS THAT SHOULD EXIST IN THIS BUILD FILE ARE
THE TASKS THAT NEED TO DIFFER FROM THE DEFAULT IMPLEMENTATION OF THE TASKS
FOUND IN subfloor.xml.
-->
<target name="cobertura-no-install"
description="Runs tests in an instrumented environment and produces Cobertura test coverage reports"
depends="clean-cobertura,compile,compile-tests,cobertura.instrument-classes,cobertura.test-instrumented,cobertura.xml-report,cobertura.html-report" />
<target name="assemble.init">
<mkdir dir="${stage.dir}" />
</target>
<target name="assemble-report-wizard">
<!-- Step 1: Unzip a PRD zip into staging dir -->
<mkdir dir="${report-designer.unzip.dir}"/>
<unzip dest="${report-designer.unzip.dir}">
<fileset dir="${report-designer-assembly.dir}">
<include name="prd-ce-*.zip"/>
</fileset>
</unzip>
<!-- Step 2: Copy wizard templates into agile-bi plugin -->
<copy todir="${approot.stage.dir}/templates" overwrite="true">
<fileset dir="${report-designer.unzip.dir}/report-designer/templates"/>
</copy>
</target>
<target name="assemble-insta">
<!-- Step 1: Unzip an insta zip into staging dir -->
<mkdir dir="${insta.unzip.dir}"/>
<unzip dest="${insta.unzip.dir}">
<fileset dir="${insta-plugin-assembly.dir}">
<include name="instanal-*.zip"/>
</fileset>
</unzip>
<!-- Step 2: Copy wizard templates into agile-bi plugin -->
<copy todir="${approot.stage.dir}/platform/pentaho-solutions/system" overwrite="true">
<fileset dir="${insta.unzip.dir}"/>
</copy>
</target>
<!--
<target name="assemble" depends="assemble.init,assemble.copy-libs,assemble-embedded-server,assemble-report-wizard">
-->
<target name="assemble" depends="assemble.init,assemble.copy-libs,assemble-embedded-server,assemble-report-wizard">
<copy todir="${approot.stage.dir}" overwrite="true">
<fileset dir="${package.resdir}" />
</copy>
<delete>
<fileset dir="${approot.stage.dir}/lib">
<!-- first remove duplicate jars -->
<include name="pentaho-metadata-*.jar"/>
<!-- swt jars -->
<include name="x86-*.jar"/>
<include name="org.eclipse.swt.*.jar"/>
<include name="runtime-*.jar"/>
<include name="common-*.jar"/>
<include name="jface-*.jar"/>
<include name="commands-*.jar"/>
<include name="swt*.jar"/>
<!-- servlet api -->
<include name="servlet-api-*.jar"/>
<!-- xul jars -->
<include name="pentaho-xul-*.jar"/>
<!-- kettle jars -->
<include name="kettle-*.jar"/>
<!-- jetty jars -->
<include name="jetty-*.jar"/>
<!-- jettison jars -->
<include name="jettison-*.jar"/>
<!-- reporting libcore and libformula -->
<!-- spring core -->
<include name="spring-core*.jar"/>
<!-- spring ldap -->
<include name="spring-ldap-*.jar"/>
<!-- spring mock -->
<include name="spring-mock-*.jar"/>
<!-- mondrian -->
<include name="mondrian-*.jar"/>
<include name="eigenbase-*.jar"/>
<include name="commons-math-*.jar"/>
<include name="javacup-*.jar"/>
<include name="olap4j-*.jar"/>
<!-- kettle -->
<include name="xmlbeans-*.jar"/>
<include name="gwt-dev-*.jar"/>
<include name="gwt-user-*.jar"/>
<include name="slf4j-*.jar"/>
<!-- batik -->
<include name="batik-*.jar"/>
<!-- Jaxb -->
<include name="jaxb-api*.jar"/>
<include name="jaxb-impl*.jar"/>
<!-- jackrabbit -->
<include name="jackrabbit-*"/>
<!-- jasperreports -->
<include name="jasperreports-*.jar"/>
<!-- chartbeans -->
<include name="pentaho-chartbeans-*.jar"/>
<!-- hibernate -->
<include name="hibernate-*.jar"/>
<exclude name="hibernate-ehcache*.jar"/>
<!-- castor -->
<include name="castor-*.jar"/>
<!-- derby -->
<include name="derby-*.jar"/>
<!-- oracle driver -->
<include name="orai18n-*.jar"/>
<include name="ojdbc-*.jar"/>
<!-- mysql driver -->
<include name="mysql-connector-*.jar"/>
<!-- hsqldb driver -->
<include name="hsqldb-*.jar"/>
<!-- pentaho cwm -->
<include name="pentaho-cwm-*.jar"/>
<!-- quartz -->
<include name="quartz-*.jar"/>
<!-- jpivot -->
<include name="jpivot-*.jar"/>
<!-- Move Jersey to pdi-ee\lib-->
<include name="jersey-multipart*.jar"/>
<include name="mimepull*.jar"/>
<include name="jersey-apache-client*.jar"/>
<include name="jersey-client*.jar"/>
<include name="jersey-servlet*.jar"/>
<include name="jersey-server*.jar"/>
<include name="jersey-core*.jar"/>
<include name="jersey-json*.jar"/>
<include name="jersey-bundle*.jar"/>
<include name="encoder-1.2.jar"/>
<include name="jackson*.jar"/>
<!-- Webservices -->
<include name="webservices-api*.jar"/>
<include name="webservices-rt*.jar"/>
<include name="jsr311-api*.jar"/>
<!-- third - remove reporting jars that will already be in kettle -->
<!-- but not the reporting wizard, that should remain -->
<include name="lib*.jar"/>
<include name="pentaho-reporting-engine-*.jar"/>
<exclude name="pentaho-reporting-engine-wizard-xul-*.jar"/>
<!-- generated by test-src/FindDuplicateJars.java -->
<include name="activation-*.jar"/>
<include name="commons-beanutils-*.jar"/>
<include name="commons-codec-*.jar"/>
<include name="commons-collections-*.jar"/>
<include name="commons-dbcp-*.jar"/>
<include name="commons-digester-*.jar"/>
<include name="commons-fileupload-*.jar"/>
<include name="commons-lang-*.jar"/>
<include name="commons-logging-*.jar"/>
<include name="commons-net-*.jar"/>
<include name="commons-pool-*.jar"/>
<include name="commons-vfs-*.jar"/>
<include name="dom4j-*.jar"/>
<include name="feed4j-*.jar"/>
<include name="georss-rome-*.jar"/>
<include name="janino-*.jar"/>
<include name="jaxen-*.jar"/>
<include name="jcommon-*.jar"/>
<include name="jfreechart-*.jar"/>
<include name="js-*.jar"/>
<include name="jug-lgpl-*.jar"/>
<include name="junit-*.jar"/>
<include name="jxl-*.jar"/>
<include name="log4j-*.jar"/>
<include name="mail-*.jar"/>
<include name="nekohtml-*.jar"/>
<include name="ognl-*.jar"/>
<include name="pentaho-database-*.jar"/>
<include name="rome-*.jar"/>
<include name="salesforce-*.jar"/>
<include name="simple-jndi-*.jar"/>
<include name="spring-beans-*.jar"/>
<include name="spring-context-*.jar"/>
<include name="spring-context-support-*.jar"/>
<!-- Moved Spring JARS to libext/spring -->
<include name="spring-2.5.6.jar"/>
<include name="wsdl4j-*.jar"/>
<include name="wstx-asl-*.jar"/>
<include name="xercesImpl-*.jar"/>
<include name="jmiutils-*.jar"/>
<include name="xml-apis-*.jar"/>
<exclude name="pentaho-database-model-*.jar"/>
<include name="openide-util-*.jar"/>
<include name="xmlParserAPIs-*.jar"/>
<include name="geronimo-stax-api*.jar"/>
<include name="stax-*.jar"/>
<include name="jtidy*.jar"/>
<include name="commons-vfs*.jar"/>
</fileset>
</delete>
<copy file="res/version.xml" todir="${stage.dir}/${ivy.artifact.id}" />
<replace file="${stage.dir}/${ivy.artifact.id}/version.xml" token="@TRUNK@" value="${project.revision}" />
</target>
<!--
ehcache.xml needs to be in the classpath for geo plugin to work properly. Kettle's plugin class loading system
only server jars so just including it in the distribution's lib folder doesn't work. It needs to be in the jar so it
will be picked up.
-->
<target name="embed-ehcache-xml-in-jar">
<jar destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" update="true">
<fileset dir="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/classes">
<include name="ehcache.xml" />
</fileset>
</jar>
<jar destfile="${approot.stage.dir}/${ivy.artifact.id}-${project.revision}.jar" update="true">
<fileset dir="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/classes">
<include name="ehcache.xml" />
</fileset>
</jar>
</target>
<target name="package-zip" depends="embed-ehcache-xml-in-jar, subfloor-pkg.package-zip"/>
<target name="resolve-upstream" depends="install-ivy">
<ivy:resolve file="${ivyfile}" conf="upstream" />
<ivy:retrieve conf="upstream" pattern="${analyzer.dist.dir}/[module]-[revision]([classifier]).[ext]" />
</target>
<target name="assemble-embedded-server" depends="install-antcontrib, resolve-upstream">
<!-- Step 1: Unzip a platform zip into staging dir -->
<mkdir dir="${platform.unzip.dir}"/>
<unzip dest="${platform.unzip.dir}">
<fileset dir="${platform.dist.dir}">
<include name="pentaho-server-ce-*.zip"/>
</fileset>
</unzip>
<!-- Step 2: Move / Remove platform as necessary -->
<mkdir dir="${approot.stage.dir}/platform/webapps"/>
<move file="${platform.unzip.dir}/pentaho-server/tomcat/webapps/pentaho" todir="${approot.stage.dir}/platform/webapps"/>
<move file="${platform.unzip.dir}/pentaho-server/pentaho-solutions" todir="${approot.stage.dir}/platform"/>
<!-- copy overwrite="true" todir="${approot.stage.dir}/platform/webapps">
<fileset dir="${platform.unzip.dir}/biserver-ce/tomcat/webapps/pentaho">
</fileset>
</copy>
<copy overwrite="true" todir="${approot.stage.dir}/platform">
<fileset dir="${platform.unzip.dir}/biserver-ce/pentaho-solutions">
</fileset>
</copy -->
<!-- remove all the platform jar files, these are now part of the kettle classpath
and are brought over via ivy -->
<delete>
<fileset dir="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
</delete>
<!-- remove karaf -->
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/karaf" />
<!-- remove all the JPivot files -->
<delete dir="${approot.stage.dir}/platform/webapps/pentaho/jpivot" />
<delete dir="approot.stage.dir}/platform/webapps/pentaho/WEB-INF/jpivot" />
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/pentaho-jpivot-plugin" />
<!-- remove solution folders that aren't necessary -->
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/plugin-samples" />
<!--<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/data-access"/>-->
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/BIRT"/>
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/reporting"/>
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/pentaho-cdf-dd"/>
<!-- Remove kettle plugins -->
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/kettle/plugins"/>
<!-- Remove PDI platform plugin -->
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/pentaho-pdi-platform-plugin"/>
<!-- CDF is needed for the new analyzer visualizations -->
<!--<delete dir="${approot.stage.dir}/platform/pentaho-solutions/system/pentaho-cdf"/>-->
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/admin"/>
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/bi-developers"/>
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/cdf"/>
<delete dir="${approot.stage.dir}/platform/pentaho-solutions/steel-wheels"/>
<!-- remove webapp code that is not necessary -->
<delete dir="${approot.stage.dir}/platform/webapps/pentaho/docs"/>
<delete dir="${approot.stage.dir}/platform/webapps/pentaho/mantle"/>
<delete dir="${approot.stage.dir}/platform/webapps/pentaho/mantleLogin"/>
<!-- Add the server-assembly.properties files -->
<mkdir dir="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/classes"/>
<echo file="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/classes/${server.assembly.filename}" append="false">assembly.title=${agbi.server.product.title} </echo>
<echo file="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/classes/${server.assembly.filename}" append="true">assembly.productid=${agbi.server.product.id} </echo>
<echo file="${approot.stage.dir}/platform/webapps/pentaho/WEB-INF/classes/${server.assembly.filename}" append="true">assembly.version=${project.revision} </echo>
<!-- Step 3: Unzip the analyzer dist if available -->
<fail message="Pentaho Analyzer CE plugin zip file not found in directory ${analyzer.dist.dir}">
<condition>
<not>
<resourcecount count="1">
<fileset id="agilebiplugin" dir="${analyzer.dist.dir}" includes="paz-plugin-ce-*.zip" />
</resourcecount>
</not>
</condition>
</fail>
<if>
<available file="${analyzer.dist.dir}" />
<then>
<unzip dest="${approot.stage.dir}/platform/pentaho-solutions/system">
<fileset dir="${analyzer.dist.dir}">
<include name="paz-plugin-ce-*.zip"/>
</fileset>
</unzip>
</then>
</if>
<!-- Step 4: Unzip the geo dist if available -->
<fail message="Pentaho Geo agilebi plugin zip file is not available.">
<condition>
<not>
<resourcecount count="1">
<fileset id="agilebiplugin" dir="${geo.dist.dir}" includes="pentaho-geo-ce-*.zip" />
</resourcecount>
</not>
</condition>
</fail>
<if>
<available file="${geo.dist.dir}" />
<then>
<unzip dest="${approot.stage.dir}/platform/pentaho-solutions/system">
<fileset dir="${geo.dist.dir}">
<include name="pentaho-geo-ce-*.zip"/>
</fileset>
</unzip>
</then>
</if>
</target>
<target name="assemble.copy-libs">
<copy todir="${approot.stage.dir}/lib">
<fileset dir="${lib.dir}" />
</copy>
<copy todir="${approot.stage.dir}">
<fileset file="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" />
</copy>
</target>
<!-- this target builds a kettle release that includes the agile bi plugin -->
<target name="kettle-w-plugin-dist">
<delete dir="${bin.dir}/kettle-dist"/>
<delete file="${dist.dir}/${pdiwithagilebi}.zip"/>
<delete file="${dist.dir}/${pdiwithagilebi}.tgz"/>
<unzip dest="${bin.dir}/kettle-dist">
<fileset dir="${kettle.dist.dir}">
<include name="pdi-ce-${dependency.kettle.revision}.zip"/>
</fileset>
</unzip>
<!-- copy in the start-up items
<copy todir="${bin.dir}/kettle-dist/data-integration">
<fileset file="pdi-res/**"/>
</copy>-->
<!-- patchup permissions -->
<chmod dir="${bin.dir}/kettle-dist/data-integration" perm="755" excludes="docs/api/** docs/api-core/** **/Thumbs.db" verbose="true">
<include name="**/*.sh" />
<include name="**/JavaApplicationStub" />
</chmod>
<unzip dest="${bin.dir}/kettle-dist/data-integration/plugins/spoon">
<fileset dir="${dist.dir}">
<include name="${package.basename}.zip"/>
</fileset>
</unzip>
<!-- copy in the monetdb Agile Mart plugin -->
<!--
<unzip dest="${bin.dir}/kettle-dist/data-integration/plugins/steps">
<fileset dir="${monetdb-plugin-assembly.dir}">
<include name="MonetDBAgileMartPlugin-*.zip"/>
</fileset>
</unzip>
<zip destfile="${dist.dir}/${pdiwithagilebi}.zip">
<zipfileset dir="${bin.dir}/kettle-dist" filemode="755" excludes="docs/api/** docs/api-core/** **/Thumbs.db">
<include name="**/*.sh" />
<include name="**/JavaApplicationStub" />
</zipfileset>
<zipfileset dir="${bin.dir}/kettle-dist" excludes="docs/api/** docs/api-core/** **/Thumbs.db">
<exclude name="**/*.sh" />
<exclude name="**/JavaApplicationStub" />
</zipfileset>
</zip>
-->
</target>
<target name="install-plugin">
<delete dir="${kettle.dist.dir}/plugins/spoon/agile-bi"/>
<unzip dest="${kettle.dist.dir}/plugins/spoon">
<fileset file="${dist.dir}/${package.basename}.zip"/>
</unzip>
</target>
<target name="publish-nojar" depends="install-antcontrib,create-pom,ivy.deliver">
<antcall target="maven-publish-artifact">
<param name="publish.pomFile" value="${ivy.artifact.pomfile}" />
<param name="publish.file" value="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar" />
</antcall>
</target>
<target name="publish" depends="dist-source, publish-nojar">
</target>
</project>