-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
333 lines (299 loc) · 11.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
<?xml version="1.0"?>
<!-- $Id: build.xml,v 1.13 2009/09/18 13:41:35 mihai Exp $ -->
<project name="setumerp" default="application">
<description>
Targets for building and deploying the setumerp application.
</description>
<!-- some properties are build from environment variables -->
<property environment="myenv"/>
<property name="jonas.root" value="${myenv.JONAS_ROOT}" />
<property name="build" value="classes"/>
<property name="source" value="java"/>
<property name="dist" value="apps"/>
<property name="docs" value="docs"/>
<property name="descriptors" value="dd"/>
<property name="reports" value="reports"/>
<property name="library" value="lib"/>
<property name="genic.destination" value="skels"/>
<property name="templates" value="templates"/>
<property name="src.formbean" value="${source}"/>
<property name="src.home" value="${source}"/>
<property name="src.remote" value="${source}"/>
<property name="src.sessionbean" value="${source}"/>
<property name="xul.src" value="xul"/>
<property name="xul.dist" value="distrib/setum"/>
<property name="xul.dist.content" value="${xul.dist}/chrome/xul"/>
<taskdef name="ejbjar"
classname="org.objectweb.jonas.ant.EjbJar"
classpath="${jonas.root}/lib/common/ow_jonas_ant.jar" />
<taskdef name="freemarker" classname="freemarker.ext.ant.FreemarkerXmlTask"
classpath="${library}/freemarker.jar"/>
<taskdef name="jrc"
classname="net.sf.jasperreports.ant.JRAntCompileTask">
<classpath>
<fileset dir="./lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<path id="compilation.classpath">
<pathelement location="${build}" />
<pathelement location="${jonas.root}/lib/commons/j2ee/ejb-2_1-api.jar" />
<pathelement location="${jonas.root}/lib/commons/j2ee/servlet-2_4.jar" />
<fileset dir="./lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jonas.root}/lib">
<include name="client.jar"/>
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<mkdir dir="${docs}" />
</target>
<target name="setum.war" depends="init,compile,reports"
description="The main web module">
<war destfile="${dist}/setum.war"
webxml="${descriptors}/setum/web.xml"
>
<classes dir="${build}">
<include name="ro/kds/erp/web/**/*.class" />
<include name="ro/kds/erp/reports/XSLRendererServlet.class" />
<include name="ro/kds/erp/reports/OfertaSistemeHTML.class" />
<include name="ro/kds/erp/reports/OfertaSistemePDF.class" />
<include name="ro/kds/erp/reports/PDFServlet.class" />
<include name="ro/kds/erp/reports/StandardOfferPDF.class" />
<include name="ro/kds/erp/reports/UsiOfferPDF.class" />
<include name="ro/kds/erp/reports/FOPFilter.class" />
<include name="ro/kds/erp/reports/XSLServletResponse.class" />
<include name="ro/kds/erp/utils/*.class"/>
</classes>
<webinf file="${descriptors}/setum/jonas-web.xml" />
<webinf dir=".">
<include name="reports/*.jasper" />
<include name="reports/*.png" />
</webinf>
<fileset dir="reports">
<include name="images/**/*"/>
</fileset>
<lib dir="${library}">
<include name="ant-1.5.1.jar"/>
<include name="commons-beanutils-1.5.jar"/>
<include name="commons-collections-2.1.jar"/>
<include name="commons-digester-1.3.jar"/>
<include name="commons-logging-1.0.4.jar"/>
<include name="commons-logging-api-1.0.2.jar"/>
<include name="hsqldb-1.61.jar"/>
<include name="itext-1.01.jar"/>
<include name="jdt-compiler.jar"/>
<include name="poi-2.0-final-20040126.jar"/>
<include name="xalan-2.7.0.jar"/>
<include name="xercesImpl-2.7.1.jar"/>
<include name="xmlParserAPIs.jar"/>
<include name="jasperreports-0.6.8.jar"/>
<include name="jasperreports-0.6.8.-applet.jar"/>
<include name="fop.jar"/>
<include name="avalon-framework-4.2.0.jar"/> <!-- for fop -->
<include name="batik-all-1.7.jar"/><!-- for fop -->
<include name="commons-io-1.3.1.jar"/><!-- for fop -->
<include name="serializer-2.7.0.jar"/><!-- for fop-->
<include name="xmlgraphics-commons-1.3.1.jar"/><!-- for fop -->
<include name="xml-apis-1.3.04.jar"/><!--for fop-->
<include name="xml-apis-ext-1.3.04.jar"/><!--for fop-->
</lib>
</war>
</target>
<!--
<target name="reports.war" depends="init,compile,reports"
description="The main web module">
<war destfile="${dist}/reports.war"
webxml="${descriptors}/reports/web.xml"
>
<classes dir="${build}">
<include name="ro/kds/erp/reports/**/*.class" />
</classes>
<webinf dir=".">
<include name="reports/**/*.jasper" />
</webinf>
<fileset dir="reports">
<include name="images/**/*"/>
</fileset>
<lib dir="${library}" />
<webinf file="${descriptors}/reports/jonas-web.xml" />
</war>
</target>
-->
<target name="compile" depends="init,generateFormClasses"
description="Compile the java classes">
<mkdir dir="${build}" />
<javac srcdir="${source}" destdir="${build}"
classpathref="compilation.classpath"
listfiles="yes"
debug="true" debuglevel="lines,vars,source"
/>
</target>
<target name="clean" description="deletes the build files">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<!-- Deploying ejbjars via ejbjar task -->
<target name="ejbjars"
description="Build ejb-jar files"
depends="compile" >
<property name="mappernames" value="rdb.mysql"/>
<ejbjar naming="directory"
srcdir="${build}"
classpath="${build}"
descriptordir="${descriptors}"
cmpversion="2.0"
flatdestdir="true"
dependency="full">
<jonas destdir="${dist}"
jonasroot="${jonas.root}"
keepgenerated="true"
verbose="false"
novalidation="false" />
<include name="**/*ejb-jar.xml"/>
<exclude name="**/jonas-*"/>
</ejbjar>
</target>
<target name="ejbjarsUpdate"
description="Adds to ejb jars the manifest file information and other needed files"
depends="ejbjars">
<!--
<jar destfile="${dist}/datalayer.jar" update="true" basedir="${build}">
<include name="ro/kds/erp/data//DataLayerException.class"/>
</jar>
-->
<jar destfile="${dist}/setumbiz.jar" update="true" basedir="${build}"
includes="ro/kds/erp/scripting/*.class">
<manifest>
<attribute name="Class-Path" value="jacl.jar tcljava.jar commons-lang-2.4.jar"/>
</manifest>
</jar>
<jar destfile="${dist}/reporting.jar" update="true" basedir="${build}"
excludes="**/*">
<manifest>
<attribute name="Class-Path" value="freemarker.jar"/>
</manifest>
</jar>
</target>
<target name="upload" depends="application"
description="deploys the application on the app server">
<!--
<copy file="${dist}/setum.war" toDir="${jonas.root}/webapps"
overwrite="true" />
<copy file="${dist}/reports.war" toDir="${jonas.root}/webapps"
overwrite="true" />
<copy file="${dist}/datalayer.jar" todir="${jonas.root}/ejbjars"
overwrite="true" />
-->
<copy file="${dist}/setum.ear" toDir="${jonas.root}/apps"
overwrite="true" />
</target>
<!-- deploying the ear on a linux machine -->
<target name="deploy">
<echo message="OS name: ${os.name}"/>
<exec os="Windows XP" executable="${jonas.root}/bin/nt/jonas.bat"
dir="${jonas.root}/apps">
<arg line="admin -a setum.ear"/>
</exec>
<exec os="Linux" executable="${jonas.root}/bin/unix/jonas"
dir="${jonas.root}/apps">
<arg line="admin -a setum.ear"/>
</exec>
<exec os="Mac OS X" executable="${jonas.root}/bin/unix/jonas"
dir="${jonas.root}/apps">
<arg line="admin -a setum.ear"/>
</exec>
</target>
<target name="undeploy">
<echo message="OS name: ${os.name}"/>
<exec os="Windows XP" executable="${jonas.root}/bin/nt/jonas.bat"
dir="${jonas.root}/apps">
<arg line="admin -r setum.ear"/>
</exec>
<exec os="Linux" executable="${jonas.root}/bin/unix/jonas"
dir="${jonas.root}/apps">
<arg line="admin -r setum.ear"/>
</exec>
<exec os="Mac OS X" executable="${jonas.root}/bin/unix/jonas"
dir="${jonas.root}/apps">
<arg line="admin -r setum.ear"/>
</exec>
</target>
<!-- Building the ear -->
<target name="application" depends="init,ejbjarsUpdate,setum.war,prefsadm"
description="builds the ear">
<ear earfile="${dist}/setum.ear" appxml="${descriptors}/setumapp/application.xml">
<fileset dir="${dist}" includes="datalayer.jar" />
<fileset dir="${dist}" includes="setum.war" />
<fileset dir="${dist}" includes="setumbiz.jar" />
<fileset dir="${dist}" includes="setumprefs.jar" />
<fileset dir="${dist}" includes="sequence.jar" />
<fileset dir="${dist}" includes="updatePrices.jar"/>
<fileset dir="${dist}" includes="reporting.jar"/>
<fileset dir="${dist}" includes="factory.jar"/>
<fileset dir="${dist}" includes="biz.jar"/>
<fileset dir="${dist}" includes="rules.jar"/>
<fileset dir="${library}">
<include name="jacl.jar"/>
<include name="tcljava.jar"/>
<include name="freemarker.jar"/>
<include name="commons-lang-2.4.jar"/>
</fileset>
</ear>
<ear earfile="${dist}/prefsadm.ear" appxml="${descriptors}/prefsadm/application.xml">
<fileset dir="${dist}" includes="setumprefs.jar prefsadm.jar"/>
<fileset dir="${library}" includes="commons-cli-1.0.jar"/>
</ear>
</target>
<target name="prefsadm" depends="compile"
description="Console application client to administrate the preferences for the deployed application.">
<jar destfile="${dist}/prefsadm.jar" basedir="${build}" includes="ro/kds/erp/biz/PreferencesConsole.class" >
<manifest>
<attribute name="Main-Class" value="ro.kds.erp.biz.PreferencesConsole"/>
<attribute name="Class-Path" value="commons-cli-1.0.jar"/>
</manifest>
<metainf dir="${descriptors}/prefsadm" includes="*client.xml"/>
</jar>
</target>
<target name="reports" depends="init">
<jrc srcdir="${reports}" includes="OfertaSisteme.xml OfertaUsiStandard.xml" />
</target>
<target name="generateFormClasses" depends="init"
description="Generation of java classes from xml templates">
<freemarker basedir="${templates}" destdir="${src.formbean}"
templatedir="${templates}"
includes="**/*.xml" excludes="**/schemas.xml" template="FormBean.ftl"
extension="Form.java" />
<freemarker basedir="${templates}" destdir="${src.remote}"
templatedir="${templates}"
includes="**/*.xml" excludes="**/schemas.xml" template="RemoteInterface.ftl"
extension=".java" />
<freemarker basedir="${templates}" destdir="${src.home}"
templatedir="${templates}"
includes="**/*.xml" excludes="**/schemas.xml" template="HomeInterface.ftl"
extension="Home.java" />
<freemarker basedir="${templates}" destdir="${src.sessionbean}"
templatedir="${templates}"
includes="**/*.xml" excludes="**/schemas.xml" template="SessionBean.ftl"
extension="Bean.java" />
</target>
<target name="docs" description="Runs javadoc and generate source code documentation">
<javadoc sourcepath="${source}" packagenames="ro.kds.erp.*"
destdir="${docs}" />
</target>
<target name="deployxul" description="Copiaza fisierele XUL pentru a fi rulate cu XULRunner">
<copy todir="${xul.dist.content}">
<fileset dir="${xul.src}"/>
</copy>
</target>
<target name="install-xul" description="Instaleaza aplicatia xul (doar pentru Mac OS X)" depends="deployxul">
<exec os="Mac OS X" executable="/Library/Frameworks/XUL.framework/xulrunner-bin">
<arg line="--install-app distrib/setum/"/>
</exec>
</target>
</project>