forked from GovernIB/sistra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
246 lines (210 loc) · 9.98 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="projecte-sistra" default="main">
<property file="${basedir}/config.properties"/>
<property name="projecte" value="${ant.project.name}"/>
<property name="output.dir" value="product"/>
<property name="etc.dir" value="etc"/>
<property name="lib" value="lib"/>
<target name="main" depends="clean,prepare,compileModuls"/>
<target name="clean" description="Destruye los directorios de trabajo">
<delete dir="${output.dir}" quiet="yes"/>
</target>
<target name="prepare" description="Prepara los directorios de trabajo">
<mkdir dir="${output.dir}"/>
<mkdir dir="${output.dir}/etc"/>
<mkdir dir="${output.dir}/etc/consola"/>
<mkdir dir="${output.dir}/ear"/>
<mkdir dir="${output.dir}/lib"/>
<mkdir dir="${output.dir}/client"/>
<mkdir dir="${output.dir}/client/ejb"/>
<mkdir dir="${output.dir}/client/wsdl"/>
<mkdir dir="${output.dir}/client/wsdl/sistra"/>
<mkdir dir="${output.dir}/client/wsdl/integracion"/>
<mkdir dir="${output.dir}/javadoc"/>
</target>
<target name="propagate">
<ant dir="moduls/llibreria-configuracionutil" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-dbutils" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-graficos" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-pdf" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-xml" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-plugins" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-util" target="${task}" inheritall="false"/>
<ant dir="moduls/llibreria-utilWs" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-mobtratel" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-audita" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-redose" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-zonaper" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-bantel" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-sistra" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-forms" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-regtel" target="${task}" inheritall="false"/>
<!-- <ant dir="moduls/modul-libs" target="${task}" inheritall="false"/>-->
<ant dir="moduls/llibreria-zk" target="${task}" inheritall="false"/>
<ant dir="moduls/modul-consola" target="${task}" inheritall="false"/>
</target>
<target name="checkJbossVersion">
<condition property="isJboss5">
<equals arg1="${jboss.version}" arg2="5.0"/>
</condition>
<condition property="isJboss3">
<equals arg1="${jboss.version}" arg2="3.2"/>
</condition>
</target>
<target name="compileModuls" description="Compila modulos" depends="checkJbossVersion">
<antcall target="propagate">
<param name="task" value="main"/>
</antcall>
<copy file="${etc.dir}/jboss-${jboss.version}/application.xml" todir="${output.dir}/etc" overwrite="true"/>
<replace file="${output.dir}/etc/application.xml">
<replacefilter token="@contextoRaiz@" value="${contextoRaiz}"/>
</replace>
<delete file="${output.dir}/ear/1-sistra.ear" quiet="yes"/>
<ear earfile="${output.dir}/ear/1-sistra.ear" appxml="${output.dir}/etc/application.xml">
<manifest>
<attribute name="Created-By" value="${indra}"/>
<attribute name="Specification-Title" value="${projecte}"/>
<attribute name="Specification-Version" value="${release.version} build${release.build} ${release.date}"/>
</manifest>
<metainf dir="${etc.dir}/jboss-${jboss.version}">
<include if="isJboss3" name="jboss-app.xml"/>
</metainf>
<metainf dir="${etc.dir}/jboss-${jboss.version}">
<include if="isJboss5" name="jboss-classloading.xml"/>
</metainf>
<metainf dir="${etc.dir}" includes="cxf/org.apache.cxf.Logger"/>
<fileset dir="moduls/modul-audita/output/moduls"/>
<fileset dir="moduls/modul-bantel/output/moduls"/>
<fileset dir="moduls/modul-forms/output/moduls"/>
<!--<fileset dir="moduls/modul-libs/out"/>-->
<fileset dir="moduls/modul-mobtratel/output/moduls"/>
<fileset dir="moduls/modul-redose/output/moduls"/>
<fileset dir="moduls/modul-regtel/output/moduls"/>
<fileset dir="moduls/modul-sistra/output/moduls"/>
<fileset dir="moduls/modul-zonaper/output/moduls">
<exclude name="3-zonaper-filter.jar" />
</fileset>
<zipfileset dir="${lib}" prefix="lib">
<exclude name="activation.jar"/>
<exclude name="struts.jar"/>
<exclude name="simplecaptcha-1.2.1.jar"/>
<exclude if="isJboss3" name="cglib-asm.jar"/>
<exclude name="commons-logging-1.0.4.jar"/>
<exclude name="ejb-2_0.jar"/>
<exclude if="isJboss3" name="hibernate2.jar"/>
<exclude if="isJboss5" name="stax-api-1.0.1.jar"/>
<exclude if="isJboss5" name="jaxp-api-1.3.jar"/>
<exclude if="isJboss5" name="jaxb-api-2.1.jar"/>
<exclude if="isJboss5" name="xmlbeans-qname.jar"/>
<exclude name="bouncy/**"/>
<exclude name="jms.jar"/>
<exclude name="mail.jar"/>
<exclude name="ojdbc14.jar"/>
<exclude name="mail.jar"/>
<exclude name="saaj-api.jar"/>
<exclude name="servlet.jar"/>
<exclude name="xercesImpl.jar"/>
<exclude name="jaxb-xjc-2.1.9.jar"/>
<exclude name="log4j-1.2.14.jar"/>
<exclude name="client*"/>
<exclude name="client/*"/>
<exclude name="cxf*"/>
<exclude name="cxf/*"/>
<exclude name="jboss*"/>
<exclude name="jboss/*"/>
</zipfileset>
<zipfileset dir="${output.dir}/lib" prefix="lib"/>
</ear>
<copy file="${etc.dir}/consola/jboss-${jboss.version}/application.xml" todir="${output.dir}/etc/consola" overwrite="true"/>
<replace file="${output.dir}/etc/consola/application.xml">
<replacefilter token="@contextoRaiz@" value="${contextoRaiz}"/>
</replace>
<ear earfile="${output.dir}/ear/2-sistra-consola.ear" appxml="${output.dir}/etc/consola/application.xml">
<manifest>
<attribute name="Created-By" value="${indra}"/>
<attribute name="Specification-Title" value="${projecte}"/>
<attribute name="Specification-Version" value="${release.version} build${release.build} ${release.date}"/>
</manifest>
<metainf dir="${etc.dir}/consola/jboss-${jboss.version}">
<include if="isJboss3" name="jboss-app.xml"/>
</metainf>
<metainf dir="${etc.dir}/consola">
<include if="isJboss5" name="jboss-classloading.xml"/>
</metainf>
<metainf dir="${etc.dir}/consola" includes="cxf/org.apache.cxf.Logger"/>
<fileset dir="moduls/modul-consola/output/moduls"/>
<!--
<zipfileset dir="${lib}/client" prefix="lib"/>
-->
<zipfileset dir="${lib}" prefix="lib">
<include name="commons-collections-*.jar"/>
<include name="commons-fileupload-*.jar"/>
<include name="commons-io-*.jar"/>
<include name="commons-lang-*.jar"/>
</zipfileset>
<zipfileset dir="${output.dir}/lib" prefix="lib"/>
</ear>
<antcall target="generateSAR"/>
</target>
<target name="cleanModuls" description="Destruye los directorios de trabajo de todos los modulos">
<antcall target="clean"/>
<antcall target="propagate">
<param name="task" value="clean"/>
</antcall>
</target>
<target name="cleanLibsLicencia" description="Borra las librerias afectadas por temas de licencia">
<delete>
<fileset dir="lib" includes="ojdbc14.jar"/>
</delete>
<!--
<delete>
<fileset dir="integracio/clienteFirma/firma/aFirma" includes="*"/>
</delete>
-->
</target>
<target name="generateScripts" depends="prepare" description="Genera los scripts de creación de base de datos">
<ant antfile="moduls/modul-bantel/build-db.xml" target="initdb" inheritall="false"/>
<copy file="moduls/modul-bantel/output/schema.sql" tofile="product/schema-bantel.sql"/>
<ant antfile="moduls/modul-forms/build-db.xml" target="initdb" inheritall="false"/>
<copy file="moduls/modul-forms/output/schema.sql" tofile="product/schema-forms.sql"/>
<ant antfile="moduls/modul-mobtratel/build-db.xml" target="initdb" inheritall="false"/>
<copy file="moduls/modul-mobtratel/output/schema.sql" tofile="product/schema-mobtratel.sql"/>
<ant antfile="moduls/modul-redose/build-db.xml" target="initdb" inheritall="false"/>
<copy file="moduls/modul-redose/output/schema.sql" tofile="product/schema-redose.sql"/>
<ant antfile="moduls/modul-sistra/build-db.xml" target="initdb" inheritall="false"/>
<copy file="moduls/modul-sistra/output/schema.sql" tofile="product/schema-sistra.sql"/>
<ant antfile="moduls/modul-zonaper/build-db.xml" target="initdb" inheritall="false"/>
<copy file="moduls/modul-zonaper/output/schema.sql" tofile="product/schema-zonaper.sql"/>
</target>
<target name="generateSAR">
<!-- Generacion del jboss-service.xml -->
<java classname="es.caib.sistra.configuracionutil.ConfiguracionSAR">
<classpath>
<fileset dir="${basedir}/lib">
<include name="commons-io*.jar"/>
<include name="commons-lang*.jar"/>
</fileset>
<fileset dir="${output.dir}/lib">
<include name="sistra-configuracion.jar"/>
</fileset>
</classpath>
<!-- Nombre del MBEAN del SAR -->
<arg value="sistra-config"/>
<!-- Directorio donde se generara el jboss-service.xml -->
<arg value="${output.dir}/etc"/>
<!-- Prefijo propiedades -->
<arg value="es.caib.sistra.configuracion.sistra."/>
<!-- Directorio donde estan los ficheros de configuracion -->
<arg value="${basedir}/doc/resources/config/sistra"/>
<!-- Nombre ficheros propiedades a tratar separados por coma -->
<arg value="global,sistra,zonaper,bantel,redose,regtel,mobtratel,forms,audita"/>
<!-- Nombre ficheros propiedades a tratar separados por coma (se incluye tal cual, sin prefijo) -->
<arg value="sar-config"/>
</java>
<!-- Generacion del SAR -->
<delete file="${output.dir}/ear/1-sistra.sar" quiet="yes"/>
<jar jarfile="${output.dir}/ear/1-sistra.sar">
<metainf dir="${output.dir}/etc" includes="*.xml"/>
</jar>
</target>
</project>