Subversion Repositories bacoAlunos

Rev

Rev 1607 | Rev 1703 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
291 jmachado 1
<?xml version="1.0" encoding="UTF-8"?>
1 fvelez 2
<project name="estgweb" basedir="." default="help">
3
 
4
 
5
    <!--
6
    ==========================================================================================
7
    ANT TASKS
8
    ==========================================================================================
9
    -->
10
    <target name="help">
11
        <echo>This is the availible Ant Tasks:</echo>
896 jmachado 12
        <echo message="${env.JAVA_HOME}"></echo>
168 fvelez 13
    </target>                  
1 fvelez 14
 
15
 
16
    <!--
17
    ==========================================================================================
18
    Path libs definitions and Properties files
19
    ==========================================================================================
20
    -->
21
 
22
 
104 jmachado 23
    <import file="libs.xml"/>
1381 jmachado 24
    <!--<import file="build-web-services.xml"/>-->
1 fvelez 25
 
26
    <!--
27
    ==========================================================================================
28
    General Task
29
    ==========================================================================================
30
    -->
31
    <!--caso queiramos apagar os pregen hbm delPreGenAppScripts-->
1312 jmachado 32
    <!--
33
    Use by hand only
215 jmachado 34
    <target name="all" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build,generateHibernateSql,build.war,dbInit"/>
291 jmachado 35
        <target name="allWebNode" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build.war"/>
36
        <target name="dataNode" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build,generateHibernateSql"/>
1312 jmachado 37
    -->
1 fvelez 38
 
39
    <!--
40
    ==========================================================================================
41
    CLEAN TASKS
42
    ==========================================================================================
43
    -->
1312 jmachado 44
    <!--
1 fvelez 45
    <target name="clean" description="clean *.class and build dir">
46
        <delete dir="${build.dir}"/>
165 jmachado 47
        <delete dir="${dist.dir}"/>
7 jmachado 48
        <delete>
49
            <fileset dir="${gen.dir.java}">
112 jmachado 50
                <exclude name="pt/ipportalegre/**/*.*"/>
1312 jmachado 51
                <exclude name="pt/estgp/estgweb/services/directories/**/*.*"/>
7 jmachado 52
                <include name="**/*.java"/>
53
            </fileset>
54
        </delete>
163 jmachado 55
        <sleep seconds="5"/>
1 fvelez 56
    </target>
1312 jmachado 57
    -->
1 fvelez 58
 
59
 
60
 
61
    <!--
62
     ==========================================================================================
63
     CREATE-DIRS
64
     ==========================================================================================
65
     -->
66
    <target name="initDirs">
67
        <mkdir dir="${log.dir}"/>
68
        <mkdir dir="${data.dir}"/>
69
        <mkdir dir="${build.dir}"/>
70
        <mkdir dir="${build.dir.classes}"/>
71
        <mkdir dir="${build.dir.war}"/>
99 jmachado 72
        <mkdir dir="${build.dir.ws}"/>
219 jmachado 73
        <mkdir dir="${build.dir.scripts}"/>
1 fvelez 74
        <delete dir="${dist.dir}"/>
75
        <mkdir dir="${dist.dir}"/>
76
        <mkdir dir="${gen.dir.java}"/>
77
    </target>
78
 
79
 
80
 
81
    <!--
82
    ==========================================================================================
83
    Tomcat Tasks
84
    ==========================================================================================
85
    -->
86
    <taskdef name="tomcat.reload" classname="org.apache.catalina.ant.ReloadTask" classpathref="pathToToolsLib"/>
1382 jmachado 87
    <!--<taskdef name="tomcat.remove" classname="org.apache.catalina.ant.RemoveTask" classpathref="pathToToolsLib"/>-->
1383 jmachado 88
    <!--<taskdef name="tomcat.roles" classname="org.apache.catalina.ant.RolesTask" classpathref="pathToToolsLib"/>-->
1 fvelez 89
    <taskdef name="tomcat.start" classname="org.apache.catalina.ant.StartTask" classpathref="pathToToolsLib"/>
90
    <taskdef name="tomcat.stop" classname="org.apache.catalina.ant.StopTask" classpathref="pathToToolsLib"/>
91
    <taskdef name="tomcat.undeploy" classname="org.apache.catalina.ant.UndeployTask" classpathref="pathToToolsLib"/>
92
    <taskdef name="tomcat.deploy" classname="org.apache.catalina.ant.DeployTask" classpathref="pathToToolsLib"/>
1630 jmachado 93
    <taskdef name="tomcat.install" classname="org.apache.catalina.ant.InstallTask" classpathref="pathToToolsLib"/>
1597 jmachado 94
    <taskdef name="tomcat.jasper" classname="org.apache.jasper.JspC">
95
        <classpath id="jspc.classpath">
96
            <pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
97
            <fileset dir="${tomcat.home}/bin">
98
                <include name="*.jar"/>
99
            </fileset>
100
            <fileset dir="${tomcat.home}/server/lib">
101
                <include name="*.jar"/>
102
            </fileset>
103
            <fileset dir="${tomcat.home}/common/lib">
104
                <include name="*.jar"/>
105
            </fileset>
106
        </classpath>
107
    </taskdef>
1 fvelez 108
 
109
 
110
    <!--
111
        TOMCAT Instalation Tasks
112
    -->
1630 jmachado 113
    <target name="tomcat.deployContext" depends="build.war">
1 fvelez 114
        <echo message="${tomcat.manager}"/>
115
        <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}"
290 jmachado 116
                        config="file://${basedir}/${dist.dir}/estgweb.xml"
1 fvelez 117
                        username="${tomcat.username}" password="${tomcat.password}" />
118
    </target>
1630 jmachado 119
    <!--
340 jmachado 120
    <target name="tomcat.deployContextOnly" depends="">
121
        <echo message="${tomcat.manager}"/>
122
        <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}"
123
                        config="file://${basedir}/${dist.dir}/estgweb.xml"
124
                        username="${tomcat.username}" password="${tomcat.password}" />
125
    </target>
1 fvelez 126
    <target name="tomcat.redeployContext" depends="tomcat.undeploy,build.war" >
127
        <echo message="${tomcat.manager}"/>
128
        <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}"
287 jmachado 129
                        config="file:${basedir}/${dist.dir}/estgweb.xml"
1 fvelez 130
                        username="${tomcat.username}" password="${tomcat.password}" />
1384 jmachado 131
    </target>-->
281 jmachado 132
    <target name="tomcat.deploy" depends="war" >
285 jmachado 133
        <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/>
283 jmachado 134
        <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}"
285 jmachado 135
                       war="file:${basedir}/${dist.dir}/${tomcat.war.file}"
1 fvelez 136
                       username="${tomcat.username}" password="${tomcat.password}" />
137
    </target>
281 jmachado 138
    <target name="tomcat.redeploy" depends="tomcat.undeploy,war">
285 jmachado 139
        <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/>
1 fvelez 140
        <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}"
285 jmachado 141
                       war="file:${basedir}/${dist.dir}/${tomcat.war.file}"
1 fvelez 142
                       username="${tomcat.username}" password="${tomcat.password}" />
143
    </target>
144
    <target name="tomcat.undeploy">
145
        <echo message="${tomcat.manager}"/>
146
        <tomcat.undeploy url="${tomcat.manager}" path="${tomcat.context.path.install}"
147
                         username="${tomcat.username}" password="${tomcat.password}" />
148
    </target>
149
    <target name="tomcat.reload">
150
        <echo message="${tomcat.manager}"/>
151
        <tomcat.reload url="${tomcat.manager}" path="${tomcat.context.path.install}"
152
                       username="${tomcat.username}" password="${tomcat.password}" />
153
    </target>
154
    <target name="tomcat.start">
155
        <echo message="${tomcat.manager}"/>
156
        <tomcat.start url="${tomcat.manager}" path="${tomcat.context.path.install}"
157
                      username="${tomcat.username}" password="${tomcat.password}" />
158
    </target>
159
    <target name="tomcat.stop">
160
        <echo message="${tomcat.manager}"/>
161
        <tomcat.stop url="${tomcat.manager}" path="${tomcat.context.path.install}"
162
                     username="${tomcat.username}" password="${tomcat.password}" />
163
    </target>
164
 
165
    <!--
166
    ==========================================================================================
167
    BUILD TASKS, Have no effect now, no revengstrategy defined....
168
    ==========================================================================================
169
    -->
170
    <target name="build" depends="initDirs" description="Compile All and create conf files">
171
        <antcall target="compile"/>
172
        <antcall target="createConfigurationFiles"/>
173
    </target>
385 jmachado 174
 
1 fvelez 175
    <target name="compile" depends="initDirs" description="Compile All">
1593 jmachado 176
        <javac encoding="UTF-8" source="1.6" target="1.6" destdir="${build.dir.classes}" debug="true" optimize="true" fork="true" failonerror="true" nowarn="true">
1 fvelez 177
            <src path="${src.dir}"/>
178
            <src path="${gen.dir.java}"/>
179
            <classpath refid="pathToToolsLib"/>
180
        </javac>
181
    </target>
182
    <target name="compileToolFiles" description="Compile Mappings Builder">
183
        <javac destdir="${build.dir.classes}" srcdir="${src.dir}" debug="true" optimize="true"  deprecation="true" verbose="true" failonerror="true">
184
            <include name="${mapping.buider.class.file}"/>
219 jmachado 185
            <include name="${scripts.buider.class.file}"/>
1 fvelez 186
            <classpath refid="pathToToolsLib"/>
187
        </javac>
188
    </target>
189
 
190
    <!--
191
        Build distribution files
192
    -->
193
    <target name="dist" depends="build">
194
        <jar jarfile="${dist.dir}/estgweb.jar">
195
            <fileset dir="${build.dir.classes}" includes="**/*.class"/>
196
        </jar>
197
        <copy overwrite="true" todir="${dist.dir}">
198
            <fileset dir="${build.dir.classes}" includes="**/*.properties"/>
199
            <fileset dir="${build.dir.classes}" includes="**/*.xml"/>
730 jmachado 200
            <fileset dir="${build.dir.classes}" includes="**/*.gif"/>
244 jmachado 201
            <fileset dir="${build.dir.classes}" includes="**/*.xsd"/>
202
            <fileset dir="${build.dir.classes}" includes="**/*.xsl"/>
1 fvelez 203
        </copy>
204
        <copy overwrite="true" todir="${dist.dir}" file="${conf.dir}/tomcat/estgweb.xml"/>
205
        <replace file="${dist.dir}/estgweb.xml" value="">
206
            <replacefilter token="@build.dir.war@" value="${basedir}${file.separator}build${file.separator}ant${file.separator}war${file.separator}"/>
207
            <replacefilter token="@context.path@" value="${tomcat.context.path}"/>
208
        </replace>
209
    </target>
210
 
1315 jmachado 211
    <target name="copy.jsps.war" depends="createConfigurationFiles" description="copy only jsps to war distribution">
1 fvelez 212
        <copy todir="${build.dir.war}" overwrite="false">
213
            <fileset dir="src/web">
214
                <include name="**/*"/>
215
            </fileset>
216
        </copy>
1581 jmachado 217
 
218
        <copy todir="${build.dir.war}/WEB-INF/tags" overwrite="false">
219
            <fileset dir="${conf.dir}/WEB-INF/tags">
220
                <include name="**/*"/>
221
            </fileset>
222
        </copy>
1312 jmachado 223
        <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="false">
224
            <fileset dir="${build.dir.classes}">
225
                <include name="**/*.xsl"/>
226
            </fileset>
227
        </copy>
1470 jmachado 228
 
165 jmachado 229
        <replace file="${build.dir.war}/css/style.css">
230
            <replacefilter token="@contextPath@" value="${tomcat.context.path}"/>
231
        </replace>
232
        <replace file="${build.dir.war}/css/intranet.css">
233
            <replacefilter token="@contextPath@" value="${tomcat.context.path}"/>
234
        </replace>
235
        <replace file="${build.dir.war}/js/ajax.js">
236
            <replacefilter token="@contextPath@" value="${tomcat.context.path}"/>
237
        </replace>
1 fvelez 238
    </target>
239
 
291 jmachado 240
    <target name="build.war" depends="dist" description="Make war distribution">
1 fvelez 241
        <mkdir dir="${build.dir.war}"/>
242
        <mkdir dir="${build.dir.war}/WEB-INF"/>
243
        <mkdir dir="${build.dir.war}/WEB-INF/lib"/>
244
        <copy todir="${build.dir.war}/WEB-INF/lib">
245
            <fileset dir="${common.lib.dir}/log4j">
246
                <include name="*.jar"/>
247
            </fileset>
248
            <fileset dir="${common.lib.dir}/berserk">
249
                <include name="**/*.jar"/>
250
            </fileset>
251
            <fileset dir="${common.lib.dir}/hibernate">
252
                <include name="**/*.jar"/>
995 jmachado 253
                <exclude name="xerces-2.6.2.jar"/>
1 fvelez 254
            </fileset>
255
            <fileset dir="${common.lib.dir}/log4j">
256
                <include name="**/*.jar"/>
257
            </fileset>
258
            <fileset dir="${common.lib.dir}/mysql">
259
                <include name="**/*.jar"/>
260
            </fileset>
1235 jmachado 261
            <fileset dir="${common.lib.dir}/oracle">
262
                <include name="**/*.jar"/>
263
            </fileset>
1 fvelez 264
            <fileset dir="${common.lib.dir}/commons">
265
                <include name="**/*.jar"/>
266
            </fileset>
267
            <fileset dir="${common.lib.dir}/struts">
268
                <include name="**/*.jar"/>
269
            </fileset>
10 jmachado 270
            <fileset dir="${common.lib.dir}/ldap">
271
                <include name="**/*.jar"/>
272
            </fileset>
29 jmachado 273
            <fileset dir="${common.lib.dir}/mail">
274
                <include name="**/*.jar"/>
275
            </fileset>
18 jmachado 276
            <fileset dir="${common.lib.dir}/jfreechart">
277
                <include name="**/*.jar"/>
278
            </fileset>
99 jmachado 279
            <fileset dir="${common.lib.dir}/lucene">
92 jmachado 280
                <include name="**/*.jar"/>
281
            </fileset>
995 jmachado 282
            <fileset dir="${common.lib.dir}/jaxrpc">
104 jmachado 283
                <include name="**/*.jar"/>
186 fvelez 284
            </fileset>
244 jmachado 285
            <fileset dir="${common.lib.dir}/saxon">
286
                <include name="**/*.jar"/>
287
            </fileset>
726 jmachado 288
            <fileset dir="${common.lib.dir}/fop">
289
                <include name="**/*.jar"/>
290
            </fileset>
808 jmachado 291
            <fileset dir="${common.lib.dir}/itextpdf">
292
                <include name="**/*.jar"/>
293
            </fileset>
995 jmachado 294
            <fileset dir="${common.lib.dir}/json">
295
                <include name="**/*.jar"/>
296
            </fileset>
1553 jmachado 297
            <fileset dir="${common.lib.dir}/simplexml">
298
                <include name="**/*.jar"/>
299
            </fileset>
1 fvelez 300
        </copy>
301
        <copy file="${dist.dir}/estgweb.jar" todir="${build.dir.war}/WEB-INF/lib"/>
302
        <copy todir="${build.dir.war}/WEB-INF" overwrite="true">
303
            <fileset dir="${conf.dir}/WEB-INF">
304
                <include name="**/*.*"/>
305
            </fileset>
306
        </copy>
307
        <mkdir dir="${build.dir.war}/WEB-INF/classes"/>
308
        <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="true">
309
            <fileset dir="${build.dir.classes}">
18 jmachado 310
                <include name="**/*.types"/>
1 fvelez 311
                <include name="**/*.properties"/>
29 jmachado 312
                <include name="**/*.txt"/>
1 fvelez 313
                <include name="**/*.xml"/>
730 jmachado 314
                <include name="**/*.gif"/>
1554 jmachado 315
                <include name="**/*.png"/>
214 jmachado 316
                <include name="**/*.exe"/>
248 jmachado 317
                <include name="**/*.xsl"/>
318
                <include name="**/*.xsd"/>
1 fvelez 319
            </fileset>
320
        </copy>
321
        <copy todir="${build.dir.war}" overwrite="true">
322
            <fileset dir="src/web">
323
                <include name="**/*"/>
324
            </fileset>
1395 jmachado 325
 
1 fvelez 326
        </copy>
1395 jmachado 327
        <mkdir dir="${build.dir.war}/docs"/>
1507 jmachado 328
 
329
        <!--DOCUMENTOS IMPORTANTES ARQUITETURA EMPRESARIAL TODO REVER LOCALIZAÇÃO DOS MESMOS-->
1395 jmachado 330
        <copy todir="${build.dir.war}/docs" overwrite="true" file="src/doc/siges/ModeloDeInformacaoPAE-EmVigor.docx"/>
1507 jmachado 331
        <copy todir="${build.dir.war}/docs" overwrite="false" file="src/doc/siges/Modelo_de_Dados_Siges11.zip"/>
1395 jmachado 332
        <copy todir="${build.dir.war}/docs" overwrite="true" file="src/doc/BacoV32016/processos/DocumentacaoProcessos.doc"/>
333
 
48 fvelez 334
        <replace file="${build.dir.war}/js/ajax.js">
165 jmachado 335
            <replacefilter token="@contextPath@" value="${tomcat.context.path}"/>
48 fvelez 336
        </replace>
165 jmachado 337
        <replace file="${build.dir.war}/css/style.css">
338
            <replacefilter token="@contextPath@" value="${tomcat.context.path}"/>
339
        </replace>
340
        <replace file="${build.dir.war}/css/intranet.css">
341
            <replacefilter token="@contextPath@" value="${tomcat.context.path}"/>
342
        </replace>
385 jmachado 343
    </target>
165 jmachado 344
 
385 jmachado 345
    <target name="jasper" depends="copy.jsps.war">
346
        <delete dir="${build.dir.jsp}"/>
347
        <mkdir dir="${build.dir.jsp}"/>
1605 jmachado 348
        <tomcat.jasper compilersourcevm="1.6" compilertargetvm="1.6" validateXml="false" uriroot="${build.dir.war}" webXmlFragment="${build.dir.war}/WEB-INF/generated_web.xml" addWebXmlMappings="true" outputDir="${build.dir.jsp}" />
1593 jmachado 349
        <javac encoding="UTF-8" source="1.6" target="1.6" destdir="${build.dir.war}/WEB-INF/classes" debug="true" optimize="true" fork="true" failonerror="true" nowarn="true">
385 jmachado 350
            <src path="${build.dir.jsp}"/>
1597 jmachado 351
            <src path="${build.dir}/"/>
385 jmachado 352
            <classpath path="${build.dir.classes}"/>
353
            <classpath refid="pathToToolsLib"/>
354
        </javac>
355
        <delete>
356
            <fileset dir="${build.dir.war}">
357
                <include name="**/*.jsp"/>
358
            </fileset>
359
        </delete>
1598 jmachado 360
        <delete>
361
            <fileset dir="${build.dir.war}/WEB-INF/tags">
362
                <include name="**/*.jsp"/>
363
            </fileset>
364
        </delete>
1 fvelez 365
    </target>
366
 
367
    <target name="war" depends="build.war">
368
        <delete file="${dist.dir}/${tomcat.war.file}"/>
369
        <jar destfile="${dist.dir}/${tomcat.war.file}">
370
            <fileset dir="${build.dir.war}">
371
                <include name="**/*" />
372
            </fileset>
373
        </jar>
374
    </target>
375
 
385 jmachado 376
    <target name="war.jasper" depends="build.war,jasper">
377
        <delete file="${dist.dir}/${tomcat.war.file}"/>
378
        <jar destfile="${dist.dir}/${tomcat.war.file}">
379
            <fileset dir="${build.dir.war}">
380
                <include name="**/*" />
381
            </fileset>
382
        </jar>
383
    </target>
1 fvelez 384
 
385 jmachado 385
 
1 fvelez 386
    <!--
387
    ==========================================================================================
388
    Generate Configuration Files TASKS
389
    ==========================================================================================
390
    -->
229 jmachado 391
    <target name="createConfigurationFiles" depends="compileToolFiles,copyConfigurationFiles,replaceFiltersConfigurationFiles,generateHibernateCfgXml"/>
1 fvelez 392
 
393
    <target name="copyConfigurationFiles">
394
        <copy overwrite="true" todir="${build.dir.classes}">
395
            <fileset dir="${hbm.dir}" includes="**/*.hbm.xml"/>
396
        </copy>
244 jmachado 397
        <mkdir dir="${build.dir.classes}/template/xsd"/>
398
        <copy todir="${build.dir.classes}/template/xsd" overwrite="true">
399
            <fileset dir="${src.xsd}">
400
                <include name="**/*.xsl"/>
401
                <include name="**/*.xsd"/>
402
            </fileset>
403
        </copy>
1 fvelez 404
        <copy overwrite="true" todir="${build.dir.classes}">
405
            <fileset dir="${src.dir}" includes="**/*.xsl"/>
406
        </copy>
407
        <copy overwrite="true" todir="${build.dir.classes}">
730 jmachado 408
            <fileset dir="${src.dir}" includes="**/*.gif"/>
409
        </copy>
410
        <copy overwrite="true" todir="${build.dir.classes}">
1554 jmachado 411
            <fileset dir="${src.dir}" includes="**/*.png"/>
412
        </copy>
413
        <copy overwrite="true" todir="${build.dir.classes}">
381 jmachado 414
            <fileset dir="${src.dir}" includes="**/*.csv"/>
415
        </copy>
416
        <copy overwrite="true" todir="${build.dir.classes}">
1 fvelez 417
            <fileset dir="${conf.dir}/berserk" includes="*.*"/>
418
        </copy>
29 jmachado 419
        <mkdir dir="${email.templates.dir.build}"/>
420
        <copy overwrite="true" todir="${email.templates.dir.build}">
421
            <fileset dir="${email.templates.dir.conf}" includes="*.*"/>
422
        </copy>
227 jmachado 423
        <mkdir dir="${sms.templates.dir.build}"/>
424
        <copy overwrite="true" todir="${sms.templates.dir.build}">
425
            <fileset dir="${sms.templates.dir.conf}" includes="*.*"/>
426
        </copy>
215 jmachado 427
        <mkdir dir="${assignement.templates.dir.build}"/>
428
        <copy overwrite="true" todir="${assignement.templates.dir.build}">
429
            <fileset dir="${assignement.templates.dir.conf}" includes="*.*"/>
430
        </copy>
1325 jmachado 431
        <!--<copy overwrite="true" todir="${olap.cfg.xml.build}" file="${olap.cfg.xml}"/>-->
1 fvelez 432
        <copy overwrite="true" todir="${hibernate.cfg.xml.build}" file="${hibernate.cfg.xml}"/>
18 jmachado 433
        <copy overwrite="true" todir="${mime.types.build}" file="${mime.types}"/>
1 fvelez 434
        <copy overwrite="true" todir="${app.properties.build}" file="${app.properties}"/>
435
        <copy overwrite="true" todir="${jdbc.properties.build}" file="${jdbc.properties}"/>
1325 jmachado 436
        <copy overwrite="true" todir="${jdbc.olap.properties.build}" file="${jdbc.olap.properties}"/>
1 fvelez 437
        <copy overwrite="true" todir="${ldap.properties.build}" file="${ldap.properties}"/>
438
        <copy overwrite="true" todir="${build.dir.classes}" file="${log4j.properties}"/>
214 jmachado 439
        <mkdir dir="${build.dir.intranet.setup.folders.file}"/>
440
        <copy overwrite="true" todir="${build.dir.intranet.setup.folders.file}" file="${intranet.setup.folders.file.src}"/>
219 jmachado 441
 
368 jmachado 442
        <mkdir dir="${build.dir.classes}/pt/estgp/estgweb/directories"/>
443
        <copy overwrite="true" todir="${build.dir.classes}/pt/estgp/estgweb/directories">
444
            <fileset dir="${conf.dir}/directories" includes="*.*"/>
445
        </copy>
347 jmachado 446
        <!--<java classname="${scripts.buider.class}" classpath="${build.dir.classes}">-->
447
            <!--<arg value="${basedir}${file.separator}..${file.separator}common"/>-->
448
            <!--<arg value="${basedir}${file.separator}build${file.separator}ant${file.separator}classes"/>-->
449
            <!--<arg value="${build.dir.scripts}"/>-->
450
            <!--<arg value="${scripts.target.libs.file}"/>-->
451
        <!--</java>-->
452
        <!--<copy overwrite="true" todir="${build.dir.scripts}">-->
453
            <!--<fileset dir="${src.scripts}" includes="*.*"/>-->
454
        <!--</copy>-->
244 jmachado 455
 
1 fvelez 456
    </target>
457
 
1549 jmachado 458
    <target name="copyXslFiles">
459
 
460
        <copy overwrite="true" todir="${build.dir.classes}">
461
            <fileset dir="${src.dir}" includes="**/*.xsl"/>
462
        </copy>
463
 
464
 
465
    </target>
466
 
1 fvelez 467
    <target name="replaceFiltersConfigurationFiles">
468
        <delete file="${build.dir.classes}/MessageResources.properties"/>
1320 jmachado 469
        <!--<concat encoding="ISO-8859-1" destfile="${build.dir.classes}/MessageResources.properties" append="true">
1 fvelez 470
            <fileset dir="${conf.dir}/language">
471
                <include name="*.properties" />
472
            </fileset>
1320 jmachado 473
        </concat>-->
474
        <copy todir="${build.dir.classes}">
475
            <fileset dir="${conf.dir}/language">
476
                <include name="*.properties" />
477
            </fileset>
478
        </copy>
1 fvelez 479
        <replace file="${jdbc.properties.build}/${jdbc.properties.filename}">
480
            <replacefilter token="@database.username@" value="${database.username}"/>
481
            <replacefilter token="@database.password@" value="${database.password}"/>
482
            <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
483
        </replace>
1325 jmachado 484
        <replace file="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}">
485
            <replacefilter token="@database.username@" value="${database.username}"/>
486
            <replacefilter token="@database.password@" value="${database.password}"/>
487
            <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
488
        </replace>
1 fvelez 489
        <replace file="${hibernate.cfg.xml.build}/${hibernate.cfg.xml.filename}">
490
            <replacefilter token="@database.username@" value="${database.username}"/>
491
            <replacefilter token="@database.password@" value="${database.password}"/>
492
            <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
493
            <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/>
494
        </replace>
1325 jmachado 495
        <!--
496
        <replace file="${olap.cfg.xml.build}/${olap.cfg.xml.filename}">
497
            <replacefilter token="@database.username@" value="${database.username}"/>
498
            <replacefilter token="@database.password@" value="${database.password}"/>
499
            <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
500
            <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/>
501
        </replace>-->
1 fvelez 502
        <replace file="${app.properties.build}/app.properties">
1525 jmachado 503
 
504
 
505
            <replacefilter token="@google.recaptcha.secret.key@" value="${google.recaptcha.secret.key}"/>
506
 
1426 jmachado 507
            <replacefilter token="@admin.email.1@" value="${admin.email.1}"/>
508
            <replacefilter token="@admin.email.2@" value="${admin.email.2}"/>
1 fvelez 509
            <replacefilter token="@tmp.dir@" value="${tmp.dir}"/>
187 jmachado 510
            <replacefilter token="@data.dir@" value="${data.dir}"/>
1 fvelez 511
            <replacefilter token="@out.dir@" value="${out.dir}"/>
29 jmachado 512
            <replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/>
79 jmachado 513
            <replacefilter token="@use.ldap@" value="${use.ldap}"/>
146 jmachado 514
            <replacefilter token="@site.url@" value="${site.url}"/>
1017 jmachado 515
            <!-- DONT USE ANY MORE NOW IS IN CONFIGURATION DAO <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/>-->
163 jmachado 516
            <replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/>
214 jmachado 517
            <replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/>
518
            <replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/>
1235 jmachado 519
 
520
            <replacefilter token="@oracle.siges.url@" value="${oracle.siges.url}"/>
521
            <replacefilter token="@oracle.siges.username@" value="${oracle.siges.username}"/>
522
            <replacefilter token="@oracle.siges.password@" value="${oracle.siges.password}"/>
523
 
1312 jmachado 524
            <!--System instance type specifications-->
1327 jmachado 525
 
526
            <replacefilter token="@email.password@" value="${email.password}"/>
1426 jmachado 527
            <replacefilter token="@email.user.sufix@" value="${email.user.sufix}"/>
1459 jmachado 528
 
529
            <replacefilter token="@email.user.count@" value="${email.user.count}"/>
1431 jmachado 530
            <replacefilter token="@email.use.round.robin@" value="${email.use.round.robin}"/>
1459 jmachado 531
 
1431 jmachado 532
            <replacefilter token="@email.use.security@" value="${email.use.security}"/>
1426 jmachado 533
            <replacefilter token="@email.user.prefix@" value="${email.user.prefix}"/>
1431 jmachado 534
            <replacefilter token="@email.from@" value="${email.from}"/>
1432 jmachado 535
            <replacefilter token="@email.server@" value="${email.server}"/>
1327 jmachado 536
            <replacefilter token="@test.control.var@" value="${test.control.var}"/>
1394 jmachado 537
 
538
            <replacefilter token="@mode.pae.enabled@" value="${mode.pae.enabled}"/>
1312 jmachado 539
            <replacefilter token="@system.theme@" value="${system.theme}"/>
540
            <replacefilter token="@authentication.policy.service@" value="${authentication.policy.service}"/>
541
            <replacefilter token="@authentication.policy.username.msg.key@" value="${authentication.policy.username.msg.key}"/>
542
            <replacefilter token="@authentication.policy.password.msg.key@" value="${authentication.policy.password.msg.key}"/>
543
            <replacefilter token="@system.redirections.policy.index.welcome@" value="${system.redirections.policy.index.welcome}"/>
544
            <replacefilter token="@system.redirections.policy.authentication.action@" value="${system.redirections.policy.authentication.action}"/>
1387 jmachado 545
            <replacefilter token="@system.redirections.policy.authentication.logout.action@" value="${system.redirections.policy.authentication.logout.action}"/>
1455 jmachado 546
            <replacefilter token="@system.mail.standard.certificated.home.page@" value="${system.mail.standard.certificated.home.page}"/>
1312 jmachado 547
 
1455 jmachado 548
 
1312 jmachado 549
            <replacefilter token="@system.intranet.url@" value="${system.intranet.url}"/>
550
            <replacefilter token="@system.public.url@" value="${system.public.url}"/>
551
 
1324 jmachado 552
            <replacefilter token="@ionline.user@" value="${ionline.user}"/>
553
            <replacefilter token="@ionline.pass@" value="${ionline.pass}"/>
1 fvelez 554
        </replace>
555
        <replace file="${build.dir.classes}/${log4j.properties.filename}">
556
            <replacefilter token="@log.file@" value="${log.file}"/>
299 jmachado 557
            <replacefilter token="@log.level@" value="${log.level}"/>
1 fvelez 558
        </replace>
352 jmachado 559
        <!--<replace file="${build.dir.scripts}/${scripts.setenv.file}">
219 jmachado 560
            <replacefilter token="@tomcat.home@" value="${tomcat.home}"/>
352 jmachado 561
        </replace>-->
1 fvelez 562
        <replace file="${jdbc.properties.build}/${jdbc.properties.filename}">
563
            <replacefilter token="@database.username@" value="${database.username}"/>
564
            <replacefilter token="@database.password@" value="${database.password}"/>
565
            <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
566
        </replace>
1325 jmachado 567
        <replace file="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}">
568
            <replacefilter token="@database.username@" value="${database.username}"/>
569
            <replacefilter token="@database.password@" value="${database.password}"/>
570
            <replacefilter token="@database.connection.url@" value="${database.connection.url}"/>
571
        </replace>
1 fvelez 572
    </target>
573
    <target name="generateHibernateCfgXml" depends="compileToolFiles">
574
        <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>-->
575
        <java classname="${mapping.buider.class}" classpath="${build.dir.classes}">
576
            <arg value="${hibernate.cfg.xml.build}"/>
577
            <arg value="${hibernate.cfg.xml}"/>
578
            <arg value="${package.dir}"/>
1325 jmachado 579
            <!--<arg value="Olap"/> O Hibernate.cfg serve para tudo no entanto o schema update e feito
580
                <arg value="false"/> com o jdbc.olap para que estas tabelas fiquem como MyISAM
581
            -->
1 fvelez 582
        </java>
1325 jmachado 583
        <!--<echo message="Starting OLAP"/>
584
        <java classname="${mapping.buider.class}" classpath="${build.dir.classes}">
585
            <arg value="${olap.cfg.xml.build}"/>
586
            <arg value="${olap.cfg.xml}"/>
587
            <arg value="${package.dir}"/>
588
            <arg value="Olap"/>
589
            <arg value="true"/>
590
        </java>-->
1 fvelez 591
        <antcall target="replaceFiltersConfigurationFiles"/>
592
    </target>
593
    <target name="dbInit">
1325 jmachado 594
        <!--<delete file="${build.dir.classes}/${olap.cfg.xml.filename}"/>-->
7 jmachado 595
        <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>-->
596
        <java classname="pt.estgp.estgweb.examples.DBInit" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
1 fvelez 597
 
7 jmachado 598
        <antcall target="replaceFiltersConfigurationFiles"/>
599
    </target>
1 fvelez 600
 
601
 
7 jmachado 602
 
1 fvelez 603
    <!--
604
    Hibernate Tools Task
605
    -->
7 jmachado 606
    <taskdef name="hibernatetool"
607
             classname="org.hibernate.tool.ant.HibernateToolTask"
608
             classpathref="pathToToolsLib" classpath="${build.dir.classes}"/>
1 fvelez 609
    <!--
610
    ==========================================================================================
611
    GENERATE SQL SCRIPTS
612
    ==========================================================================================
613
    -->
614
    <taskdef name="schemaexport"
615
             classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
616
             classpathref="pathToToolsLib" classpath="${build.dir.classes}"/>
617
 
618
 
1070 jmachado 619
 
1312 jmachado 620
    <!--
215 jmachado 621
    <target name="generateHibernateSql" depends="build">
1 fvelez 622
        <schemaexport
623
                properties="${jdbc.properties.build}/${jdbc.properties.filename}"
624
                quiet="no"
625
                text="no"
626
                drop="no"
627
                delimiter=";"
628
                output="${build.dir.classes}/app-scripts.sql">
629
            <fileset dir="${hbm.dir}">
630
                <include name="**/*.hbm.xml"/>
1325 jmachado 631
                <exclude name="**/Olap*.hbm.xml"/>
1 fvelez 632
            </fileset>
633
        </schemaexport>
1325 jmachado 634
         <schemaexport
635
                properties="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}"
636
                quiet="no"
637
                text="no"
638
                drop="no"
639
                delimiter=";"
640
                output="${build.dir.classes}/app-scripts.sql">
641
            <fileset dir="${hbm.dir}">
642
                <include name="**/Olap*.hbm.xml"/>
643
            </fileset>
644
        </schemaexport>
1312 jmachado 645
    </target>-->
1 fvelez 646
 
852 jmachado 647
    <target name="generateUpdateHibernateSql" depends="build">
1547 jmachado 648
        <!--<taskdef name="schemaupdate"
649
                 classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask"
650
                 classpathref="pathToToolsLib" classpath="${build.dir.classes}"/>-->
852 jmachado 651
        <taskdef name="schemaupdate"
1547 jmachado 652
        classname="jomm.dao.utils.JommSchemaUpdateTask"
653
        classpathref="pathToToolsLib" classpath="${build.dir.classes}"/>
852 jmachado 654
        <schemaupdate
655
                properties="${jdbc.properties.build}/${jdbc.properties.filename}"
1547 jmachado 656
                quiet="false"
657
                text="false">
852 jmachado 658
            <fileset dir="${hbm.dir}">
659
                <include name="**/*.hbm.xml"/>
1386 jmachado 660
                <!--<exclude name="**/Olap*.hbm.xml"/>-->
852 jmachado 661
            </fileset>
662
        </schemaupdate>
1325 jmachado 663
 
1386 jmachado 664
        <!--
1325 jmachado 665
        <schemaupdate
666
                properties="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}"
667
                quiet="no"
668
                text="no">
669
            <fileset dir="${hbm.dir}">
670
                <include name="**/Olap*.hbm.xml"/>
671
            </fileset>
1386 jmachado 672
        </schemaupdate>-->
852 jmachado 673
    </target>
674
 
1 fvelez 675
    <target name="generateHibernateDomainObjects">
691 jmachado 676
        <replace dir="${hbm.dir}" value="">
677
            <include name="**/*.hbm.xml"/>
678
            <replacefilter token='&lt;timestamp source="db"' value="&lt;timestamp"/>
679
        </replace>
1 fvelez 680
        <hibernatetool>
681
            <configuration>
682
                <fileset dir="${hbm.dir}">
683
                    <include name="**/*.hbm.xml"/>
684
                </fileset>
685
            </configuration>
686
            <hbm2java
687
                    jdk5="true"
688
                    ejb3="false"
689
                    destdir="${gen.dir.java}"/>
690
        </hibernatetool>
691
        <delete>
692
            <fileset dir="${gen.dir.java}">
693
                <include name="**/*Impl.java"/>
694
            </fileset>
695
        </delete>
691 jmachado 696
        <replace dir="${hbm.dir}" value="">
697
            <include name="**/*.hbm.xml"/>
698
            <replacefilter token='&lt;timestamp' value='&lt;timestamp source="db"'/>
699
        </replace>
1 fvelez 700
    </target>
701
 
702
 
703
    <!--
704
        ==========================================================================================
705
        GENERATE DAO IMPLEMENTATION
706
        ==========================================================================================
707
        -->
708
    <target name="generateHibernateDaoClasses">
709
        <hibernatetool destdir="${gen.dir.java}" >
710
            <configuration>
711
                <fileset dir="${hbm.dir}">
712
                    <include name="**/*.hbm.xml"/>
713
                </fileset>
714
            </configuration>
715
            <hbmtemplate
716
                    filepattern="{class-name}${dao.file.pattern}.java"
717
                    templatepath="${dao.template.dir}"
718
                    template="${dao.impl.template}"
719
                    destdir="${dao.impl.package.dir}">
720
                <property key="jdk5" value="true"/>
721
                <property key="ejb3" value="false"/>
722
                <property key="dao" value="${dao.file.pattern}"/>
723
                <property key="daoDomainPackage" value="${domain.package}"/>
724
                <property key="daoInterfacesPackage" value="${dao.interfaces.package}"/>
725
                <property key="daoImplPackage" value="${dao.impl.package}"/>
726
            </hbmtemplate>
727
        </hibernatetool>
728
        <delete>
729
            <fileset dir="${gen.dir.java}">
730
                <include name="**/*ImplDao.java"/>
731
            </fileset>
732
        </delete>
733
    </target>
734
 
1235 jmachado 735
    <!--
736
    ==========================================================================================
737
    Generate Hibernate UML Diagrams
738
    ==========================================================================================
1 fvelez 739
 
1235 jmachado 740
 
741
    <property name="doc" location="build/ant/diagrams"/>
742
 
743
    <property name="dot.exe" location="/usr/local/bin/dot" />
744
 
745
    <taskdef
746
            name="hbm2gif"
747
            classname="com.oy.shared.lm.ant.HBMtoGIFTask"
748
            classpathref="pathToToolsLib"
749
            />
750
 
751
    <target name="generateHibernateUmlDiagram" depends="initDirs">
752
        <mkdir dir="${doc}"/>
753
        <hbm2gif
754
                caption="XML file for launching Catalina 5.0.25 applications using Apache Ant."
755
                colors="cyan, lightcyan, orange, black, black"
756
                inFile="${hbm.dir}/pt/estgp/estgweb/domain/CourseUnit.hbm.xml"
757
                dotFile="${doc}/CourseUnit.dot"
758
                outFile="${doc}/CourseUnit.gif"
759
                exeFile="${dot.exe}"
760
                />
761
    </target>
762
    -->
995 jmachado 763
    <!--
764
    ==========================================================================================
765
    GENERATE WEBSERVICES JAXWS
766
    ==========================================================================================
767
    -->
1 fvelez 768
 
995 jmachado 769
 
770
    <target name="ws.generate-siges-client" depends="initDirs">
771
        <taskdef name="wsimport2" classname="com.sun.tools.ws.ant.WsImport"
772
                 classpathref="pathToToolsLib">
773
        </taskdef>
774
        <copy file="${ws.client.binding.dir}/${ws.siges.binding.file}" todir="${build.dir.ws}" overwrite="true"/>
775
        <replace file="${build.dir.ws}/${ws.siges.binding.file}" encoding="UTF-8">
776
            <replacefilter token="@wsdl.client@" value="${ws.siges.wsdl}"/>
777
            <replacefilter token="@target.namespace@" value="${ws.siges.target.namespace}"/>
778
            <replacefilter token="@ws.package@" value="${ws.siges.package}"/>
779
        </replace>
780
        <!--xendorsed="true"-->
781
        <wsimport2
782
 
783
                debug="${ws.debug}"
784
                verbose="${ws.verbose}"
785
                keep="${ws.keep}"
786
                extension="${ws.extension}"
787
                destdir="${gen.dir.java}"
788
                wsdl="${ws.siges.wsdl}">
789
            <binding dir="${build.dir.ws}" includes="${ws.client.binding.file}"/>
790
        </wsimport2>
791
        <delete>
792
            <fileset dir="${gen.dir.java}">
793
                <include name="**/*.class"/>
794
            </fileset>
795
        </delete>
796
    </target>
797
 
798
 
1 fvelez 799
    <!--
995 jmachado 800
    ==========================================================================================
1496 jmachado 801
    DIRECTORIES + STUDIES PLANS XSD JAXB
1067 jmachado 802
    ==========================================================================================
803
    -->
804
 
805
    <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="pathToToolsLib">
806
    </taskdef>
807
 
808
    <target name="directories-gen-jaxb" depends="initDirs">
809
        <xjc destdir="${gen.dir.java}" package="pt.estgp.estgweb.services.directories.xsd">
810
            <schema  dir="${conf.dir}/directories" includes="directory.xsd"/>
811
        </xjc>
812
        <replace dir="${gen.dir.java}/pt/estgp/estgweb/services/directories/xsd" value="">
813
            <include name="*.java"/>
814
            <replacefilter token="public Boolean is" value="public Boolean get"/>
815
        </replace>
816
    </target>
817
 
818
 
1496 jmachado 819
    <target name="studies-plan-gen-jaxb" depends="initDirs">
820
        <xjc destdir="${gen.dir.java}" package="pt.estgp.estgweb.services.courses.xsd">
821
            <schema  dir="src/xsd" includes="planoestudos.xsd"/>
822
        </xjc>
823
        <replace dir="${gen.dir.java}/pt/estgp/estgweb/services/courses/xsd" value="">
824
            <include name="*.java"/>
825
            <replacefilter token="public Boolean is" value="public Boolean get"/>
826
        </replace>
827
    </target>
1067 jmachado 828
 
829
    <!--
830
    ==========================================================================================
995 jmachado 831
    DEAMONS
832
    ==========================================================================================
1 fvelez 833
    -->
834
 
835
    <!--<target name="run">-->
836
    <!--<java classname="mitra.oaiharvest.harvest.HarvestEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>-->
837
    <!--<java classname="mitra.oaiharvest.index.IndexEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>-->
838
    <!--</target>-->
336 jmachado 839
    <target name="util.task.createRepositoryXML">
840
        <java classname="pt.estgp.estgweb.services.data.CreateDescriptionsXML" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
841
    </target>
359 jmachado 842
    <target name="util.task.reset.urlsstats">
843
        <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
844
    </target>
438 jmachado 845
    <target name="util.task.reset.urlsstats.digests">
846
        <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsServiceDigests" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
847
    </target>
1 fvelez 848
 
1362 jmachado 849
    <target name="CourseUnitsStatisticsJobService">
850
        <java classname="pt.estgp.estgweb.services.courses.CourseUnitsStatisticsJobService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
851
    </target>
336 jmachado 852
 
1235 jmachado 853
 
1553 jmachado 854
    <target name="RUNReportQuestionariosGeneratorTest" depends="compile,copyXslFiles">
1575 jmachado 855
        <java fork="true" jvmargs="-Dfile.encoding=UTF-8" classname="pt.estgp.estgweb.services.questionarios.pedagogico.reportprocessors.DocenteReportGenerator" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
1549 jmachado 856
    </target>
1362 jmachado 857
 
1607 jmachado 858
    <target name="RUNZipFolderAdHoc">
859
        <java fork="true" jvmargs="-Dfile.encoding=UTF-8" classname="pt.estgp.estgweb.services.questionarios.pedagogico.reportprocessors.utils.ZipFolderForReportDocente" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
860
    </target>
1362 jmachado 861
 
862
 
1549 jmachado 863
 
1607 jmachado 864
 
1603 jmachado 865
    <target name="print-version">
866
        <echo>Java/JVM version: ${ant.java.version}</echo>
867
        <echo>Java/JVM detail version: ${java.version}</echo>
868
    </target>
1549 jmachado 869
 
273 jmachado 870
</project>