forked from UDA-EJIE/udaRUP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_v5.xml
413 lines (331 loc) · 17.8 KB
/
build_v5.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
<?xml version="1.0"?>
<project name="uda" default="buildVersion">
<property name="udaVersion" value="5.0.4"/>
<property name="previousUdaVersion" value="5.0.3"/>
<property name="udaLibVersion" value="5.0.4"/>
<property name="previousUdaLibVersion" value="5.0.3"/>
<property name="udaLibVersionName" value="${udaLibVersion}-RELEASE"/>
<property name="udaLibPreviousVersionName" value="${previousUdaLibVersion}-RELEASE"/>
<property name="baseDir" value="../"/>
<property name="destDir" value="${baseDir}/dist"/>
<property name="udaLibBaseDir" value="${baseDir}/udaLib/x38ShLibClasses"/>
<property name="udaLibBuildDir" value="${udaLibBaseDir}/target/classes"/>
<property name="udaLibDestDir" value="${destDir}/udaLib/${udaLibVersion}"/>
<property name="udaRupBaseDir" value="${baseDir}/udaRUP"/>
<property name="udaRupBuildDir" value="${udaRupBaseDir}/dist"/>
<property name="udaRupDestDir" value="${destDir}/udaRup/${udaVersion}"/>
<property name="udaRupFolder" value="rup"/>
<property name="udaRupZip" value="${udaRupDestDir}/rup-v${udaVersion}.zip"/>
<property name="udaTemplatesBaseDir" value="${baseDir}/udaTemplates"/>
<property name="udaTemplatesSrcDir" value="${udaTemplatesBaseDir}/templates"/>
<property name="udaTemplatesDestDir" value="${destDir}/udaTemplates/${udaVersion}"/>
<property name="udaTemplatesFolder" value="templates"/>
<property name="udaTemplatesRupFolder" value="templates/statics/rup"/>
<property name="udaTemplatesAppFolder" value="templates/statics/xxx"/>
<property name="udaTemplatesZip" value="${udaTemplatesDestDir}/templates-v${udaVersion}.zip"/>
<property name="udaDemoAppBaseDir" value="${baseDir}/udaDemoApp"/>
<property name="udaDemoAppStaticsDir" value="/x21aStatics"/>
<property name="udaDemoAppStaticsRupDir" value="${udaDemoAppStaticsDir}/WebContent/rup"/>
<!-- ***************************** -->
<!-- BUILD VERSION -->
<!-- ***************************** -->
<!-- Realiza el build y generación de distribuibles de :
- Build y generación de distribuibles de udaRup
- Build y generación de distribuibles de udaLib
- Actualización de udaDemoApp con los fuentes de udaRup y los números de versión
- Actualización de udaTemplates con los fuentes de udaRup y los números de versión
-->
<target name="buildVersion"
description="Genera los distribuibles para la versión de UDA"
depends="buildUdaLibVersion, buildUdaRupVersion, buildUdaDemoAppVersion, buildUdaTemplatesVersion" >
</target>
<!-- ***************************** -->
<!-- ******** udaLib ************* -->
<!-- ***************************** -->
<!-- Realiza el build de la versión de udaLib
- Actualiza los números de versión en los recursos correspondientes.
- Genera los jar correspondientes
-->
<target name="buildUdaLibVersion"
description="Actualiza los recursos a la versión correspondiente de udaLib y genera los distribuibles"
depends="udaLibRenameVersion, udaLibDist" >
</target>
<!-- Actualiza el numero de versión en los siguientes recursos:
- /pom.xml
- /build.xml
- /src/META-INF/MANIFEST.MF
-->
<target name="udaLibRenameVersion" description="Modifica los numeros de versión de los entregables">
<echo>Updating resources version...</echo>
<replace file="${udaLibBaseDir}/pom.xml">
<replacefilter
token="<version>${udaLibPreviousVersionName}</version>"
value="<version>${udaLibVersionName}</version>"/>
</replace>
<replace file="${udaLibBaseDir}/build.xml">
<replacefilter
token="<property name="version" value="${udaLibPreviousVersionName}"/>"
value="<property name="version" value="${udaLibVersionName}"/>"
/>
</replace>
<replace file="${udaLibBaseDir}/src/META-INF/MANIFEST.MF">
<replacefilter
token="Manifest-Version: ${previousUdaLibVersion}-RELEASE"
value="Manifest-Version: ${udaLibVersion}-RELEASE"
/>
</replace>
</target>
<!-- Genera los diferentes jar de la librería x38 -->
<target name="udaLibDist" description="Genera los diferentes jar de x38">
<echo>Creando distribuibles de udaLib...</echo>
<echo>Eliminando ficheros existentes ...</echo>
<delete file="${udaLibDestDir}/x38ShLibClasses-${udaLibVersionName}.jar" />
<delete file="${udaLibDestDir}/x38ShLibClasses-dav-${udaLibVersionName}.jar" />
<delete file="${udaLibDestDir}/x38ShLibClasses-pif-${udaLibVersionName}.jar" />
<delete file="${udaLibDestDir}/x38ShLibClasses-rup-${udaLibVersionName}.jar" />
<delete file="${udaLibDestDir}/x38ShLibClasses-cache-${udaLibVersionName}.jar" />
<delete file="${udaLibDestDir}/x38ShLibClasses-hdiv-${udaLibVersionName}.jar" />
<echo>Generando ${udaLibDestDir}/x38ShLibClasses-${udaLibVersionName}.jar ...</echo>
<jar destfile="${udaLibDestDir}/x38ShLibClasses-${udaLibVersionName}.jar">
<fileset dir="${udaLibBuildDir}" includes="com/ejie/x38/** LICENSE.txt NOTICE.txt" excludes="com/ejie/x38/webdav/**, com/ejie/x38/pif/**, com/ejie/x38/rup/**, com/ejie/x38/cache/**, com/ejie/x38/hdiv/**" />
<fileset dir="${udaLibBaseDir}" includes="build.xml pom.xml" />
<manifest>
<attribute name="Main-Class" value=""/>
<attribute name="Manifest-Version" value="${udaLibVersionName}"/>
<attribute name="Created-By" value="UDA"/>
</manifest>
</jar>
<echo>Generando ${udaLibDestDir}/x38ShLibClasses-dav-${udaLibVersionName}.jar ...</echo>
<jar destfile="${udaLibDestDir}/x38ShLibClasses-dav-${udaLibVersionName}.jar">
<fileset dir="${udaLibBuildDir}" includes="com/ejie/x38/webdav/** LICENSE.txt NOTICE.txt" />
<fileset dir="${udaLibBaseDir}" includes="build.xml pom.xml" />
<manifest>
<attribute name="Main-Class" value=""/>
<attribute name="Manifest-Version" value="${udaLibVersionName}"/>
<attribute name="Created-By" value="UDA"/>
</manifest>
</jar>
<echo>Generando ${udaLibDestDir}/x38ShLibClasses-pif-${udaLibVersionName}.jar ...</echo>
<jar destfile="${udaLibDestDir}/x38ShLibClasses-pif-${udaLibVersionName}.jar">
<fileset dir="${udaLibBuildDir}" includes="com/ejie/x38/pif/** LICENSE.txt NOTICE.txt" />
<fileset dir="${udaLibBaseDir}" includes="build.xml pom.xml" />
<manifest>
<attribute name="Main-Class" value=""/>
<attribute name="Manifest-Version" value="${udaLibVersionName}"/>
<attribute name="Created-By" value="UDA"/>
</manifest>
</jar>
<echo>Generando ${udaLibDestDir}/x38ShLibClasses-rup-${udaLibVersionName}.jar ...</echo>
<jar destfile="${udaLibDestDir}/x38ShLibClasses-rup-${udaLibVersionName}.jar">
<fileset dir="${udaLibBuildDir}" includes="com/ejie/x38/rup/** LICENSE.txt NOTICE.txt" />
<fileset dir="${udaLibBaseDir}" includes="build.xml pom.xml" />
<manifest>
<attribute name="Main-Class" value=""/>
<attribute name="Manifest-Version" value="${udaLibVersionName}"/>
<attribute name="Created-By" value="UDA"/>
</manifest>
</jar>
<echo>Generando ${udaLibDestDir}/x38ShLibClasses-cache-${udaLibVersionName}.jar ...</echo>
<jar destfile="${udaLibDestDir}/x38ShLibClasses-cache-${udaLibVersionName}.jar">
<fileset dir="${udaLibBuildDir}" includes="com/ejie/x38/cache/** LICENSE.txt NOTICE.txt" />
<fileset dir="${udaLibBaseDir}" includes="build.xml pom.xml" />
<manifest>
<attribute name="Main-Class" value=""/>
<attribute name="Manifest-Version" value="${udaLibVersionName}"/>
<attribute name="Created-By" value="UDA"/>
</manifest>
</jar>
<echo>Generando ${udaLibDestDir}/x38ShLibClasses-hdiv-${udaLibVersionName}.jar ...</echo>
<jar destfile="${udaLibDestDir}/x38ShLibClasses-hdiv-${udaLibVersionName}.jar">
<fileset dir="${udaLibBuildDir}" includes="com/ejie/x38/hdiv/** LICENSE.txt NOTICE.txt" />
<fileset dir="${udaLibBaseDir}" includes="build.xml pom.xml" />
<manifest>
<attribute name="Main-Class" value=""/>
<attribute name="Manifest-Version" value="${udaLibVersionName}"/>
<attribute name="Created-By" value="UDA"/>
</manifest>
</jar>
</target>
<!-- ***************************** -->
<!-- ******** udaRup ************* -->
<!-- ***************************** -->
<!-- Realiza el build y generación de distribuibles de udaRup:
- Actualiza los números de versión en los recursos de udaRup
- Realiza el build de udaRup ejecutando gulp dist
- Genera los distribuibles en la carpeta dist
-->
<target name="buildUdaRupVersion"
description="Actualiza los recursos a la versión correspondiente de udaDemoApp y genera los distribuibles"
depends="udaRupRenameVersion, udaRupBuild, udaRupDist" >
</target>
<!-- Actualiza los números de versión en los siguientes recursos:
- package.json
- src/**/*.js
- src/rup.base.js
-->
<target name="udaRupRenameVersion" description="Modifica los numeros de versión de los entregables">
<echo>Updating resources version...</echo>
<replace file="${udaRupBaseDir}/package.json">
<replacefilter
token=""version": "${previousUdaVersion}""
value=""version": "${udaVersion}""/>
</replace>
<replace dir="${udaRupBaseDir}/src">
<include name="**/*.js"/>
<replacefilter
token="@version ${previousUdaVersion}"
value="@version ${udaVersion}"/>
</replace>
<replace file="${udaRupBaseDir}/src/rup.base.js">
<replacefilter
token="var rup_version = '${previousUdaVersion}'"
value="var rup_version = '${udaVersion}'"/>
</replace>
</target>
<!-- Realiza el build del proyecto de UDA RUP -->
<!-- Ejecuta la tarea npm run all -->
<target name="udaRupBuild" description="Realiza el build de la versión actual de udaRUP">
<echo>Building udaRUP...</echo>
<exec dir="${udaRupBaseDir}" executable="npm.cmd" failonerror="true">
<arg value="run" />
<arg value="all:x21a" />
</exec>
</target>
<!-- Genera los distribuibles: Carpeta rup y zip -->
<target name="udaRupDist" description="Genera los distribuibles de RUP" depends="udaRupBuild">
<echo>Limpiando...</echo>
<delete dir="${udaRupDestDir}/${udaRupFolder}" />
<delete file="${udaRupZip}" />
<echo>Generando carpeta rup...</echo>
<copy todir="${udaRupDestDir}/${udaRupFolder}">
<fileset dir="${udaRupBuildDir}" />
</copy>
<echo>Generando comprimido ${udaRupZip}...</echo>
<zip destfile="${udaRupZip}"
basedir="${udaRupDestDir}"
includes="${udaRupFolder}/**"
/>
</target>
<!-- ***************************** -->
<!-- ******** udaDemoApp ************* -->
<!-- ***************************** -->
<!-- Realiza el build y generación de distribuibles de udaDemoApp:
- Actualiza los números de versión en los recursos de udaDemoApp
- Copia los distribuibles de la carpeta rup dentro la la aplicación udaDemoApp
- Genera los ditribuibles en la carpeta dist
-->
<target name="buildUdaDemoAppVersion"
description="Actualiza los recursos de udaDemoApp con los fuentes de udaRup y con la versión correspondiente"
depends="udaRupToUdaDemoApp, udaDemoAppRenameVersion" >
</target>
<!-- Copia los distribuibles de la carpeta rup dentro la la aplicación udaDemoApp -->
<target name="udaRupToUdaDemoApp" description="Copia los distribuibles de udaRup a la aplicación de ejemplo udaDemoApp">
<echo>Limpiando...</echo>
<delete dir="${udaDemoAppBaseDir}/${udaDemoAppStaticsRupDir}" />
<echo>Copiando fuentes...</echo>
<echo>Origen: ${udaRupDestDir}/${udaRupFolder}</echo>
<echo>Destino: ${udaDemoAppBaseDir}/${udaDemoAppStaticsRupDir}</echo>
<copy todir="${udaDemoAppBaseDir}/${udaDemoAppStaticsRupDir}">
<fileset dir="${udaRupDestDir}/${udaRupFolder}">
</fileset>
</copy>
</target>
<target name="udaDemoAppRenameVersion" description="Modifica los numeros de versión de los resources de udaDemoApp" depends="udaRupToUdaDemoApp">
<echo>Updating resources version...</echo>
<replace file="${udaDemoAppBaseDir}/x21aEAR/pom.xml">
<replacefilter
token="<com.ejie.x38.version>${previousUdaLibVersion}-RELEASE</com.ejie.x38.version>"
value="<com.ejie.x38.version>${udaLibVersion}-RELEASE</com.ejie.x38.version>"/>
</replace>
<replace file="${udaDemoAppBaseDir}/x21aAppWar/WebContent/WEB-INF/views/welcome.jsp">
<replacefilter
token="v${previousUdaVersion}"
value="v${udaVersion}"/>
</replace>
</target>
<!-- ***************************** -->
<!-- ******** udaTemplates ************* -->
<!-- ***************************** -->
<!-- Realiza el build y generación de distribuibles de udaTemplates:
- Actualiza los números de versión en los recursos de udaTemplates
- Copia los distribuibles de la carpeta rup dentro la la aplicación udaTemplates
- Actualiza los rup*.inc de udaDemoApp dentro la la aplicación udaTemplates
- Genera los ditribuibles en la carpeta dist
-->
<target name="buildUdaTemplatesVersion"
description="Actualiza los recursos de udaTemplates con los fuentes de udaRup recursos de udaDemoApp y con la versión correspondiente"
depends="udaRupToTemplates, udaTemplatesRenameVersion, udaTemplatesDist" >
</target>
<!-- Copia los distribuibles de la carpeta rup dentro de los templates -->
<target name="udaRupToTemplates" description="Copia los distribuibles de udaRup a los templates">
<echo>Limpiando...</echo>
<delete dir="${udaTemplatesBaseDir}/${udaTemplatesRupFolder}" />
<delete file="${udaTemplatesBaseDir}/${udaTemplatesAppFolder}/styles/main.css" />
<echo>Copiando fuentes...</echo>
<echo>Origen: ${udaRupDestDir}/${udaRupFolder}</echo>
<echo>Destino: ${udaTemplatesBaseDir}/${udaTemplatesRupFolder}</echo>
<copy todir="${udaTemplatesBaseDir}/${udaTemplatesRupFolder}">
<fileset dir="${udaRupDestDir}/${udaRupFolder}" />
</copy>
</target>
<!-- udaTemplates -->
<!-- Modifica los numeros de versión de los recursos
- pom.xml
-->
<target name="udaTemplatesRenameVersion" description="Modifica los numeros de versión de los resources de udaTemplates">
<echo>Updating resources version...</echo>
<replace file="${udaTemplatesSrcDir}/ear/pom.xml.ftl">
<replacefilter
token="<com.ejie.x38.version>${previousUdaLibVersion}-RELEASE</com.ejie.x38.version>"
value="<com.ejie.x38.version>${udaLibVersion}-RELEASE</com.ejie.x38.version>"/>
</replace>
</target>
<!-- udaTemplates -->
<!-- Genera los distribuibles: Carpeta templates y zip -->
<target name="udaTemplatesDist" description="Genera los distribuibles de los templates">
<echo>Limpiando...</echo>
<delete dir="${udaTemplatesDestDir}/${udaTemplatesFolder}" />
<delete file="${udaTemplatesZip}" />
<echo>Generando carpeta templates...</echo>
<copy todir="${udaTemplatesDestDir}/${udaTemplatesFolder}">
<fileset dir="${udaTemplatesSrcDir}"/>
</copy>
<echo>Generando comprimido ${udaRupZip}...</echo>
<zip destfile="${udaTemplatesZip}"
basedir="${udaTemplatesDestDir}"
includes="${udaTemplatesFolder}/**"
excludes="${udaTemplatesFolder}/.settings/, ${udaTemplatesFolder}/.project"
update="true"
/>
</target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${ant.home}/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- Se recorren todos los test para añadirlos al specRunner -->
<target name="copyTestToSpecRunner">
<echo message="${udaRupDestDir}/${udaRupFolder}"/>
<foreach target="copyToFolderHtml" param="theFile">
<fileset dir="${udaRupDestDir}/${udaRupFolder}" casesensitive="yes">
<include name="**/*.spec.js"/>
</fileset>
</foreach>
</target>
<!-- Se añade el include de todos los spec que existen -->
<target name="copyToFolderHtml">
<basename property="filename" file="${theFile}"/>
<replace file="${udaDemoAppBaseDir}/${udaDemoAppStaticsRupDir}/html/specRunner.html">
<replacefilter token="</head>" value=""/>
<replacefilter token="<body>" value=""/>
<replacefilter token="</body>" value=""/>
<replacefilter token="</html>" value=""/>
</replace>
<echo file="${udaDemoAppBaseDir}/${udaDemoAppStaticsRupDir}/html/specRunner.html" append="true">
<![CDATA[
<script type="text/javascript" src="${theFile}"></script>
</head><body></body></html>
]]>
</echo>
</target>
</project>