Rev 1325 | Rev 1362 | 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"/> |
99 | 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"/> |
||
87 | <taskdef name="tomcat.remove" classname="org.apache.catalina.ant.RemoveTask" classpathref="pathToToolsLib"/> |
||
88 | <taskdef name="tomcat.roles" classname="org.apache.catalina.ant.RolesTask" classpathref="pathToToolsLib"/> |
||
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"/> |
||
93 | <taskdef name="tomcat.install" classname="org.apache.catalina.ant.InstallTask" classpathref="pathToToolsLib"/> |
||
385 | jmachado | 94 | <taskdef name="tomcat.jasper" classname="org.apache.jasper.JspC" classpathref="pathToToolsLib"/> |
1 | fvelez | 95 | |
96 | |||
97 | <!-- |
||
98 | TOMCAT Instalation Tasks |
||
99 | --> |
||
100 | <target name="tomcat.deployContext" depends="build.war"> |
||
101 | <echo message="${tomcat.manager}"/> |
||
102 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
290 | jmachado | 103 | config="file://${basedir}/${dist.dir}/estgweb.xml" |
1 | fvelez | 104 | username="${tomcat.username}" password="${tomcat.password}" /> |
105 | </target> |
||
340 | jmachado | 106 | <target name="tomcat.deployContextOnly" depends=""> |
107 | <echo message="${tomcat.manager}"/> |
||
108 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
109 | config="file://${basedir}/${dist.dir}/estgweb.xml" |
||
110 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
111 | </target> |
||
1 | fvelez | 112 | <target name="tomcat.redeployContext" depends="tomcat.undeploy,build.war" > |
113 | <echo message="${tomcat.manager}"/> |
||
114 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
287 | jmachado | 115 | config="file:${basedir}/${dist.dir}/estgweb.xml" |
1 | fvelez | 116 | username="${tomcat.username}" password="${tomcat.password}" /> |
117 | </target> |
||
281 | jmachado | 118 | <target name="tomcat.deploy" depends="war" > |
285 | jmachado | 119 | <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
283 | jmachado | 120 | <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
285 | jmachado | 121 | war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
1 | fvelez | 122 | username="${tomcat.username}" password="${tomcat.password}" /> |
123 | </target> |
||
281 | jmachado | 124 | <target name="tomcat.redeploy" depends="tomcat.undeploy,war"> |
285 | jmachado | 125 | <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
1 | fvelez | 126 | <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
285 | jmachado | 127 | war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
1 | fvelez | 128 | username="${tomcat.username}" password="${tomcat.password}" /> |
129 | </target> |
||
130 | <target name="tomcat.undeploy"> |
||
131 | <echo message="${tomcat.manager}"/> |
||
132 | <tomcat.undeploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
133 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
134 | </target> |
||
135 | <target name="tomcat.reload"> |
||
136 | <echo message="${tomcat.manager}"/> |
||
137 | <tomcat.reload url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
138 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
139 | </target> |
||
140 | <target name="tomcat.start"> |
||
141 | <echo message="${tomcat.manager}"/> |
||
142 | <tomcat.start url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
143 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
144 | </target> |
||
145 | <target name="tomcat.stop"> |
||
146 | <echo message="${tomcat.manager}"/> |
||
147 | <tomcat.stop url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
148 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
149 | </target> |
||
150 | |||
151 | <!-- |
||
152 | ========================================================================================== |
||
153 | BUILD TASKS, Have no effect now, no revengstrategy defined.... |
||
154 | ========================================================================================== |
||
155 | --> |
||
156 | <target name="build" depends="initDirs" description="Compile All and create conf files"> |
||
157 | <antcall target="compile"/> |
||
158 | <antcall target="createConfigurationFiles"/> |
||
159 | </target> |
||
385 | jmachado | 160 | |
1 | fvelez | 161 | <target name="compile" depends="initDirs" description="Compile All"> |
368 | jmachado | 162 | <javac encoding="UTF-8" source="1.5" target="1.5" destdir="${build.dir.classes}" debug="true" optimize="true" fork="true" failonerror="true" nowarn="true"> |
1 | fvelez | 163 | <src path="${src.dir}"/> |
164 | <src path="${gen.dir.java}"/> |
||
165 | <classpath refid="pathToToolsLib"/> |
||
166 | </javac> |
||
167 | </target> |
||
168 | <target name="compileToolFiles" description="Compile Mappings Builder"> |
||
169 | <javac destdir="${build.dir.classes}" srcdir="${src.dir}" debug="true" optimize="true" deprecation="true" verbose="true" failonerror="true"> |
||
170 | <include name="${mapping.buider.class.file}"/> |
||
219 | jmachado | 171 | <include name="${scripts.buider.class.file}"/> |
1 | fvelez | 172 | <classpath refid="pathToToolsLib"/> |
173 | </javac> |
||
174 | </target> |
||
175 | |||
176 | <!-- |
||
177 | Build distribution files |
||
178 | --> |
||
179 | <target name="dist" depends="build"> |
||
180 | <jar jarfile="${dist.dir}/estgweb.jar"> |
||
181 | <fileset dir="${build.dir.classes}" includes="**/*.class"/> |
||
182 | </jar> |
||
183 | <copy overwrite="true" todir="${dist.dir}"> |
||
184 | <fileset dir="${build.dir.classes}" includes="**/*.properties"/> |
||
185 | <fileset dir="${build.dir.classes}" includes="**/*.xml"/> |
||
730 | jmachado | 186 | <fileset dir="${build.dir.classes}" includes="**/*.gif"/> |
244 | jmachado | 187 | <fileset dir="${build.dir.classes}" includes="**/*.xsd"/> |
188 | <fileset dir="${build.dir.classes}" includes="**/*.xsl"/> |
||
1 | fvelez | 189 | </copy> |
190 | <copy overwrite="true" todir="${dist.dir}" file="${conf.dir}/tomcat/estgweb.xml"/> |
||
191 | <replace file="${dist.dir}/estgweb.xml" value=""> |
||
192 | <replacefilter token="@build.dir.war@" value="${basedir}${file.separator}build${file.separator}ant${file.separator}war${file.separator}"/> |
||
193 | <replacefilter token="@context.path@" value="${tomcat.context.path}"/> |
||
194 | </replace> |
||
195 | </target> |
||
196 | |||
1315 | jmachado | 197 | <target name="copy.jsps.war" depends="createConfigurationFiles" description="copy only jsps to war distribution"> |
1 | fvelez | 198 | <copy todir="${build.dir.war}" overwrite="false"> |
199 | <fileset dir="src/web"> |
||
200 | <include name="**/*"/> |
||
201 | </fileset> |
||
202 | </copy> |
||
1312 | jmachado | 203 | <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="false"> |
204 | <fileset dir="${build.dir.classes}"> |
||
205 | <include name="**/*.xsl"/> |
||
206 | </fileset> |
||
207 | </copy> |
||
165 | jmachado | 208 | <replace file="${build.dir.war}/css/style.css"> |
209 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
210 | </replace> |
||
211 | <replace file="${build.dir.war}/css/intranet.css"> |
||
212 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
213 | </replace> |
||
214 | <replace file="${build.dir.war}/js/ajax.js"> |
||
215 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
216 | </replace> |
||
1 | fvelez | 217 | </target> |
218 | |||
291 | jmachado | 219 | <target name="build.war" depends="dist" description="Make war distribution"> |
1 | fvelez | 220 | <mkdir dir="${build.dir.war}"/> |
221 | <mkdir dir="${build.dir.war}/WEB-INF"/> |
||
222 | <mkdir dir="${build.dir.war}/WEB-INF/lib"/> |
||
223 | <copy todir="${build.dir.war}/WEB-INF/lib"> |
||
224 | <fileset dir="${common.lib.dir}/log4j"> |
||
225 | <include name="*.jar"/> |
||
226 | </fileset> |
||
227 | <fileset dir="${common.lib.dir}/berserk"> |
||
228 | <include name="**/*.jar"/> |
||
229 | </fileset> |
||
230 | <fileset dir="${common.lib.dir}/hibernate"> |
||
231 | <include name="**/*.jar"/> |
||
995 | jmachado | 232 | <exclude name="xerces-2.6.2.jar"/> |
1 | fvelez | 233 | </fileset> |
234 | <fileset dir="${common.lib.dir}/log4j"> |
||
235 | <include name="**/*.jar"/> |
||
236 | </fileset> |
||
237 | <fileset dir="${common.lib.dir}/mysql"> |
||
238 | <include name="**/*.jar"/> |
||
239 | </fileset> |
||
1235 | jmachado | 240 | <fileset dir="${common.lib.dir}/oracle"> |
241 | <include name="**/*.jar"/> |
||
242 | </fileset> |
||
1 | fvelez | 243 | <fileset dir="${common.lib.dir}/commons"> |
244 | <include name="**/*.jar"/> |
||
245 | </fileset> |
||
246 | <fileset dir="${common.lib.dir}/struts"> |
||
247 | <include name="**/*.jar"/> |
||
248 | </fileset> |
||
10 | jmachado | 249 | <fileset dir="${common.lib.dir}/ldap"> |
250 | <include name="**/*.jar"/> |
||
251 | </fileset> |
||
29 | jmachado | 252 | <fileset dir="${common.lib.dir}/mail"> |
253 | <include name="**/*.jar"/> |
||
254 | </fileset> |
||
18 | jmachado | 255 | <fileset dir="${common.lib.dir}/jfreechart"> |
256 | <include name="**/*.jar"/> |
||
257 | </fileset> |
||
99 | jmachado | 258 | <fileset dir="${common.lib.dir}/lucene"> |
92 | jmachado | 259 | <include name="**/*.jar"/> |
260 | </fileset> |
||
995 | jmachado | 261 | <fileset dir="${common.lib.dir}/jaxrpc"> |
104 | jmachado | 262 | <include name="**/*.jar"/> |
186 | fvelez | 263 | </fileset> |
244 | jmachado | 264 | <fileset dir="${common.lib.dir}/saxon"> |
265 | <include name="**/*.jar"/> |
||
266 | </fileset> |
||
726 | jmachado | 267 | <fileset dir="${common.lib.dir}/fop"> |
268 | <include name="**/*.jar"/> |
||
269 | </fileset> |
||
808 | jmachado | 270 | <fileset dir="${common.lib.dir}/itextpdf"> |
271 | <include name="**/*.jar"/> |
||
272 | </fileset> |
||
995 | jmachado | 273 | <fileset dir="${common.lib.dir}/json"> |
274 | <include name="**/*.jar"/> |
||
275 | </fileset> |
||
1 | fvelez | 276 | </copy> |
277 | <copy file="${dist.dir}/estgweb.jar" todir="${build.dir.war}/WEB-INF/lib"/> |
||
278 | <copy todir="${build.dir.war}/WEB-INF" overwrite="true"> |
||
279 | <fileset dir="${conf.dir}/WEB-INF"> |
||
280 | <include name="**/*.*"/> |
||
281 | </fileset> |
||
282 | </copy> |
||
283 | <mkdir dir="${build.dir.war}/WEB-INF/classes"/> |
||
284 | <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="true"> |
||
285 | <fileset dir="${build.dir.classes}"> |
||
18 | jmachado | 286 | <include name="**/*.types"/> |
1 | fvelez | 287 | <include name="**/*.properties"/> |
29 | jmachado | 288 | <include name="**/*.txt"/> |
1 | fvelez | 289 | <include name="**/*.xml"/> |
730 | jmachado | 290 | <include name="**/*.gif"/> |
214 | jmachado | 291 | <include name="**/*.exe"/> |
248 | jmachado | 292 | <include name="**/*.xsl"/> |
293 | <include name="**/*.xsd"/> |
||
1 | fvelez | 294 | </fileset> |
295 | </copy> |
||
296 | <copy todir="${build.dir.war}" overwrite="true"> |
||
297 | <fileset dir="src/web"> |
||
298 | <include name="**/*"/> |
||
299 | </fileset> |
||
300 | </copy> |
||
48 | fvelez | 301 | <replace file="${build.dir.war}/js/ajax.js"> |
165 | jmachado | 302 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
48 | fvelez | 303 | </replace> |
165 | jmachado | 304 | <replace file="${build.dir.war}/css/style.css"> |
305 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
306 | </replace> |
||
307 | <replace file="${build.dir.war}/css/intranet.css"> |
||
308 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
309 | </replace> |
||
385 | jmachado | 310 | </target> |
165 | jmachado | 311 | |
385 | jmachado | 312 | <target name="jasper" depends="copy.jsps.war"> |
313 | <delete dir="${build.dir.jsp}"/> |
||
314 | <mkdir dir="${build.dir.jsp}"/> |
||
315 | <tomcat.jasper validateXml="false" uriroot="${build.dir.war}" webXmlFragment="${build.dir.war}/WEB-INF/generated_web.xml" addWebXmlMappings="true" outputDir="${build.dir.jsp}" /> |
||
316 | <javac encoding="UTF-8" source="1.5" target="1.5" destdir="${build.dir.war}/WEB-INF/classes" debug="true" optimize="true" fork="true" failonerror="true" nowarn="true"> |
||
317 | <src path="${build.dir.jsp}"/> |
||
318 | <classpath path="${build.dir.classes}"/> |
||
319 | <classpath refid="pathToToolsLib"/> |
||
320 | </javac> |
||
321 | <delete> |
||
322 | <fileset dir="${build.dir.war}"> |
||
323 | <include name="**/*.jsp"/> |
||
324 | </fileset> |
||
325 | </delete> |
||
1 | fvelez | 326 | </target> |
327 | |||
328 | <target name="war" depends="build.war"> |
||
329 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
330 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
331 | <fileset dir="${build.dir.war}"> |
||
332 | <include name="**/*" /> |
||
333 | </fileset> |
||
334 | </jar> |
||
335 | </target> |
||
336 | |||
385 | jmachado | 337 | <target name="war.jasper" depends="build.war,jasper"> |
338 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
339 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
340 | <fileset dir="${build.dir.war}"> |
||
341 | <include name="**/*" /> |
||
342 | </fileset> |
||
343 | </jar> |
||
344 | </target> |
||
1 | fvelez | 345 | |
385 | jmachado | 346 | |
1 | fvelez | 347 | <!-- |
348 | ========================================================================================== |
||
349 | Generate Configuration Files TASKS |
||
350 | ========================================================================================== |
||
351 | --> |
||
229 | jmachado | 352 | <target name="createConfigurationFiles" depends="compileToolFiles,copyConfigurationFiles,replaceFiltersConfigurationFiles,generateHibernateCfgXml"/> |
1 | fvelez | 353 | |
354 | <target name="copyConfigurationFiles"> |
||
355 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
356 | <fileset dir="${hbm.dir}" includes="**/*.hbm.xml"/> |
||
357 | </copy> |
||
244 | jmachado | 358 | <mkdir dir="${build.dir.classes}/template/xsd"/> |
359 | <copy todir="${build.dir.classes}/template/xsd" overwrite="true"> |
||
360 | <fileset dir="${src.xsd}"> |
||
361 | <include name="**/*.xsl"/> |
||
362 | <include name="**/*.xsd"/> |
||
363 | </fileset> |
||
364 | </copy> |
||
1 | fvelez | 365 | <copy overwrite="true" todir="${build.dir.classes}"> |
366 | <fileset dir="${src.dir}" includes="**/*.xsl"/> |
||
367 | </copy> |
||
368 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
730 | jmachado | 369 | <fileset dir="${src.dir}" includes="**/*.gif"/> |
370 | </copy> |
||
371 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
381 | jmachado | 372 | <fileset dir="${src.dir}" includes="**/*.csv"/> |
373 | </copy> |
||
374 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
1 | fvelez | 375 | <fileset dir="${conf.dir}/berserk" includes="*.*"/> |
376 | </copy> |
||
29 | jmachado | 377 | <mkdir dir="${email.templates.dir.build}"/> |
378 | <copy overwrite="true" todir="${email.templates.dir.build}"> |
||
379 | <fileset dir="${email.templates.dir.conf}" includes="*.*"/> |
||
380 | </copy> |
||
227 | jmachado | 381 | <mkdir dir="${sms.templates.dir.build}"/> |
382 | <copy overwrite="true" todir="${sms.templates.dir.build}"> |
||
383 | <fileset dir="${sms.templates.dir.conf}" includes="*.*"/> |
||
384 | </copy> |
||
215 | jmachado | 385 | <mkdir dir="${assignement.templates.dir.build}"/> |
386 | <copy overwrite="true" todir="${assignement.templates.dir.build}"> |
||
387 | <fileset dir="${assignement.templates.dir.conf}" includes="*.*"/> |
||
388 | </copy> |
||
1325 | jmachado | 389 | <!--<copy overwrite="true" todir="${olap.cfg.xml.build}" file="${olap.cfg.xml}"/>--> |
1 | fvelez | 390 | <copy overwrite="true" todir="${hibernate.cfg.xml.build}" file="${hibernate.cfg.xml}"/> |
18 | jmachado | 391 | <copy overwrite="true" todir="${mime.types.build}" file="${mime.types}"/> |
1 | fvelez | 392 | <copy overwrite="true" todir="${app.properties.build}" file="${app.properties}"/> |
393 | <copy overwrite="true" todir="${jdbc.properties.build}" file="${jdbc.properties}"/> |
||
1325 | jmachado | 394 | <copy overwrite="true" todir="${jdbc.olap.properties.build}" file="${jdbc.olap.properties}"/> |
1 | fvelez | 395 | <copy overwrite="true" todir="${ldap.properties.build}" file="${ldap.properties}"/> |
396 | <copy overwrite="true" todir="${build.dir.classes}" file="${log4j.properties}"/> |
||
214 | jmachado | 397 | <mkdir dir="${build.dir.intranet.setup.folders.file}"/> |
398 | <copy overwrite="true" todir="${build.dir.intranet.setup.folders.file}" file="${intranet.setup.folders.file.src}"/> |
||
219 | jmachado | 399 | |
368 | jmachado | 400 | <mkdir dir="${build.dir.classes}/pt/estgp/estgweb/directories"/> |
401 | <copy overwrite="true" todir="${build.dir.classes}/pt/estgp/estgweb/directories"> |
||
402 | <fileset dir="${conf.dir}/directories" includes="*.*"/> |
||
403 | </copy> |
||
347 | jmachado | 404 | <!--<java classname="${scripts.buider.class}" classpath="${build.dir.classes}">--> |
405 | <!--<arg value="${basedir}${file.separator}..${file.separator}common"/>--> |
||
406 | <!--<arg value="${basedir}${file.separator}build${file.separator}ant${file.separator}classes"/>--> |
||
407 | <!--<arg value="${build.dir.scripts}"/>--> |
||
408 | <!--<arg value="${scripts.target.libs.file}"/>--> |
||
409 | <!--</java>--> |
||
410 | <!--<copy overwrite="true" todir="${build.dir.scripts}">--> |
||
411 | <!--<fileset dir="${src.scripts}" includes="*.*"/>--> |
||
412 | <!--</copy>--> |
||
244 | jmachado | 413 | |
1 | fvelez | 414 | </target> |
415 | |||
416 | <target name="replaceFiltersConfigurationFiles"> |
||
417 | <delete file="${build.dir.classes}/MessageResources.properties"/> |
||
1320 | jmachado | 418 | <!--<concat encoding="ISO-8859-1" destfile="${build.dir.classes}/MessageResources.properties" append="true"> |
1 | fvelez | 419 | <fileset dir="${conf.dir}/language"> |
420 | <include name="*.properties" /> |
||
421 | </fileset> |
||
1320 | jmachado | 422 | </concat>--> |
423 | <copy todir="${build.dir.classes}"> |
||
424 | <fileset dir="${conf.dir}/language"> |
||
425 | <include name="*.properties" /> |
||
426 | </fileset> |
||
427 | </copy> |
||
1 | fvelez | 428 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
429 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
430 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
431 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
432 | </replace> |
||
1325 | jmachado | 433 | <replace file="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}"> |
434 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
435 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
436 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
437 | </replace> |
||
1 | fvelez | 438 | <replace file="${hibernate.cfg.xml.build}/${hibernate.cfg.xml.filename}"> |
439 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
440 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
441 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
442 | <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/> |
||
443 | </replace> |
||
1325 | jmachado | 444 | <!-- |
445 | <replace file="${olap.cfg.xml.build}/${olap.cfg.xml.filename}"> |
||
446 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
447 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
448 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
449 | <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/> |
||
450 | </replace>--> |
||
1 | fvelez | 451 | <replace file="${app.properties.build}/app.properties"> |
452 | <replacefilter token="@tmp.dir@" value="${tmp.dir}"/> |
||
187 | jmachado | 453 | <replacefilter token="@data.dir@" value="${data.dir}"/> |
1 | fvelez | 454 | <replacefilter token="@out.dir@" value="${out.dir}"/> |
29 | jmachado | 455 | <replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/> |
79 | jmachado | 456 | <replacefilter token="@use.ldap@" value="${use.ldap}"/> |
146 | jmachado | 457 | <replacefilter token="@site.url@" value="${site.url}"/> |
1017 | jmachado | 458 | <!-- DONT USE ANY MORE NOW IS IN CONFIGURATION DAO <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/>--> |
163 | jmachado | 459 | <replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/> |
214 | jmachado | 460 | <replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/> |
461 | <replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/> |
||
1235 | jmachado | 462 | |
463 | <replacefilter token="@oracle.siges.url@" value="${oracle.siges.url}"/> |
||
464 | <replacefilter token="@oracle.siges.username@" value="${oracle.siges.username}"/> |
||
465 | <replacefilter token="@oracle.siges.password@" value="${oracle.siges.password}"/> |
||
466 | |||
1312 | jmachado | 467 | <!--System instance type specifications--> |
1327 | jmachado | 468 | |
469 | <replacefilter token="@email.password@" value="${email.password}"/> |
||
470 | <replacefilter token="@test.control.var@" value="${test.control.var}"/> |
||
1312 | jmachado | 471 | <replacefilter token="@system.theme@" value="${system.theme}"/> |
472 | <replacefilter token="@authentication.policy.service@" value="${authentication.policy.service}"/> |
||
473 | <replacefilter token="@authentication.policy.username.msg.key@" value="${authentication.policy.username.msg.key}"/> |
||
474 | <replacefilter token="@authentication.policy.password.msg.key@" value="${authentication.policy.password.msg.key}"/> |
||
475 | <replacefilter token="@system.redirections.policy.index.welcome@" value="${system.redirections.policy.index.welcome}"/> |
||
476 | <replacefilter token="@system.redirections.policy.authentication.action@" value="${system.redirections.policy.authentication.action}"/> |
||
477 | |||
478 | <replacefilter token="@system.intranet.url@" value="${system.intranet.url}"/> |
||
479 | <replacefilter token="@system.public.url@" value="${system.public.url}"/> |
||
480 | |||
1324 | jmachado | 481 | <replacefilter token="@ionline.user@" value="${ionline.user}"/> |
482 | <replacefilter token="@ionline.pass@" value="${ionline.pass}"/> |
||
1 | fvelez | 483 | </replace> |
484 | <replace file="${build.dir.classes}/${log4j.properties.filename}"> |
||
485 | <replacefilter token="@log.file@" value="${log.file}"/> |
||
299 | jmachado | 486 | <replacefilter token="@log.level@" value="${log.level}"/> |
1 | fvelez | 487 | </replace> |
352 | jmachado | 488 | <!--<replace file="${build.dir.scripts}/${scripts.setenv.file}"> |
219 | jmachado | 489 | <replacefilter token="@tomcat.home@" value="${tomcat.home}"/> |
352 | jmachado | 490 | </replace>--> |
1 | fvelez | 491 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
492 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
493 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
494 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
495 | </replace> |
||
1325 | jmachado | 496 | <replace file="${jdbc.olap.properties.build}/${jdbc.olap.properties.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 | </replace> |
||
1 | fvelez | 501 | </target> |
502 | <target name="generateHibernateCfgXml" depends="compileToolFiles"> |
||
503 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
||
504 | <java classname="${mapping.buider.class}" classpath="${build.dir.classes}"> |
||
505 | <arg value="${hibernate.cfg.xml.build}"/> |
||
506 | <arg value="${hibernate.cfg.xml}"/> |
||
507 | <arg value="${package.dir}"/> |
||
1325 | jmachado | 508 | <!--<arg value="Olap"/> O Hibernate.cfg serve para tudo no entanto o schema update e feito |
509 | <arg value="false"/> com o jdbc.olap para que estas tabelas fiquem como MyISAM |
||
510 | --> |
||
1 | fvelez | 511 | </java> |
1325 | jmachado | 512 | <!--<echo message="Starting OLAP"/> |
513 | <java classname="${mapping.buider.class}" classpath="${build.dir.classes}"> |
||
514 | <arg value="${olap.cfg.xml.build}"/> |
||
515 | <arg value="${olap.cfg.xml}"/> |
||
516 | <arg value="${package.dir}"/> |
||
517 | <arg value="Olap"/> |
||
518 | <arg value="true"/> |
||
519 | </java>--> |
||
1 | fvelez | 520 | <antcall target="replaceFiltersConfigurationFiles"/> |
521 | </target> |
||
522 | <target name="dbInit"> |
||
1325 | jmachado | 523 | <!--<delete file="${build.dir.classes}/${olap.cfg.xml.filename}"/>--> |
7 | jmachado | 524 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
525 | <java classname="pt.estgp.estgweb.examples.DBInit" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
1 | fvelez | 526 | |
7 | jmachado | 527 | <antcall target="replaceFiltersConfigurationFiles"/> |
528 | </target> |
||
1 | fvelez | 529 | |
530 | |||
7 | jmachado | 531 | |
1 | fvelez | 532 | <!-- |
533 | Hibernate Tools Task |
||
534 | --> |
||
7 | jmachado | 535 | <taskdef name="hibernatetool" |
536 | classname="org.hibernate.tool.ant.HibernateToolTask" |
||
537 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
1 | fvelez | 538 | <!-- |
539 | ========================================================================================== |
||
540 | GENERATE SQL SCRIPTS |
||
541 | ========================================================================================== |
||
542 | --> |
||
543 | <taskdef name="schemaexport" |
||
544 | classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" |
||
545 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
546 | |||
547 | |||
1070 | jmachado | 548 | |
1312 | jmachado | 549 | <!-- |
215 | jmachado | 550 | <target name="generateHibernateSql" depends="build"> |
1 | fvelez | 551 | <schemaexport |
552 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
553 | quiet="no" |
||
554 | text="no" |
||
555 | drop="no" |
||
556 | delimiter=";" |
||
557 | output="${build.dir.classes}/app-scripts.sql"> |
||
558 | <fileset dir="${hbm.dir}"> |
||
559 | <include name="**/*.hbm.xml"/> |
||
1325 | jmachado | 560 | <exclude name="**/Olap*.hbm.xml"/> |
1 | fvelez | 561 | </fileset> |
562 | </schemaexport> |
||
1325 | jmachado | 563 | <schemaexport |
564 | properties="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}" |
||
565 | quiet="no" |
||
566 | text="no" |
||
567 | drop="no" |
||
568 | delimiter=";" |
||
569 | output="${build.dir.classes}/app-scripts.sql"> |
||
570 | <fileset dir="${hbm.dir}"> |
||
571 | <include name="**/Olap*.hbm.xml"/> |
||
572 | </fileset> |
||
573 | </schemaexport> |
||
1312 | jmachado | 574 | </target>--> |
1 | fvelez | 575 | |
852 | jmachado | 576 | <target name="generateUpdateHibernateSql" depends="build"> |
577 | <taskdef name="schemaupdate" |
||
578 | classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask" |
||
579 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
580 | |||
581 | <schemaupdate |
||
582 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
583 | quiet="no" |
||
584 | text="no"> |
||
585 | <fileset dir="${hbm.dir}"> |
||
586 | <include name="**/*.hbm.xml"/> |
||
1325 | jmachado | 587 | <exclude name="**/Olap*.hbm.xml"/> |
852 | jmachado | 588 | </fileset> |
589 | </schemaupdate> |
||
1325 | jmachado | 590 | |
591 | <schemaupdate |
||
592 | properties="${jdbc.olap.properties.build}/${jdbc.olap.properties.filename}" |
||
593 | quiet="no" |
||
594 | text="no"> |
||
595 | <fileset dir="${hbm.dir}"> |
||
596 | <include name="**/Olap*.hbm.xml"/> |
||
597 | </fileset> |
||
598 | </schemaupdate> |
||
852 | jmachado | 599 | </target> |
600 | |||
1 | fvelez | 601 | <target name="generateHibernateDomainObjects"> |
691 | jmachado | 602 | <replace dir="${hbm.dir}" value=""> |
603 | <include name="**/*.hbm.xml"/> |
||
604 | <replacefilter token='<timestamp source="db"' value="<timestamp"/> |
||
605 | </replace> |
||
1 | fvelez | 606 | <hibernatetool> |
607 | <configuration> |
||
608 | <fileset dir="${hbm.dir}"> |
||
609 | <include name="**/*.hbm.xml"/> |
||
610 | </fileset> |
||
611 | </configuration> |
||
612 | <hbm2java |
||
613 | jdk5="true" |
||
614 | ejb3="false" |
||
615 | destdir="${gen.dir.java}"/> |
||
616 | </hibernatetool> |
||
617 | <delete> |
||
618 | <fileset dir="${gen.dir.java}"> |
||
619 | <include name="**/*Impl.java"/> |
||
620 | </fileset> |
||
621 | </delete> |
||
691 | jmachado | 622 | <replace dir="${hbm.dir}" value=""> |
623 | <include name="**/*.hbm.xml"/> |
||
624 | <replacefilter token='<timestamp' value='<timestamp source="db"'/> |
||
625 | </replace> |
||
1 | fvelez | 626 | </target> |
627 | |||
628 | |||
629 | <!-- |
||
630 | ========================================================================================== |
||
631 | GENERATE DAO IMPLEMENTATION |
||
632 | ========================================================================================== |
||
633 | --> |
||
634 | <target name="generateHibernateDaoClasses"> |
||
635 | <hibernatetool destdir="${gen.dir.java}" > |
||
636 | <configuration> |
||
637 | <fileset dir="${hbm.dir}"> |
||
638 | <include name="**/*.hbm.xml"/> |
||
639 | </fileset> |
||
640 | </configuration> |
||
641 | <hbmtemplate |
||
642 | filepattern="{class-name}${dao.file.pattern}.java" |
||
643 | templatepath="${dao.template.dir}" |
||
644 | template="${dao.impl.template}" |
||
645 | destdir="${dao.impl.package.dir}"> |
||
646 | <property key="jdk5" value="true"/> |
||
647 | <property key="ejb3" value="false"/> |
||
648 | <property key="dao" value="${dao.file.pattern}"/> |
||
649 | <property key="daoDomainPackage" value="${domain.package}"/> |
||
650 | <property key="daoInterfacesPackage" value="${dao.interfaces.package}"/> |
||
651 | <property key="daoImplPackage" value="${dao.impl.package}"/> |
||
652 | </hbmtemplate> |
||
653 | </hibernatetool> |
||
654 | <delete> |
||
655 | <fileset dir="${gen.dir.java}"> |
||
656 | <include name="**/*ImplDao.java"/> |
||
657 | </fileset> |
||
658 | </delete> |
||
659 | </target> |
||
660 | |||
1235 | jmachado | 661 | <!-- |
662 | ========================================================================================== |
||
663 | Generate Hibernate UML Diagrams |
||
664 | ========================================================================================== |
||
1 | fvelez | 665 | |
1235 | jmachado | 666 | |
667 | <property name="doc" location="build/ant/diagrams"/> |
||
668 | |||
669 | <property name="dot.exe" location="/usr/local/bin/dot" /> |
||
670 | |||
671 | <taskdef |
||
672 | name="hbm2gif" |
||
673 | classname="com.oy.shared.lm.ant.HBMtoGIFTask" |
||
674 | classpathref="pathToToolsLib" |
||
675 | /> |
||
676 | |||
677 | <target name="generateHibernateUmlDiagram" depends="initDirs"> |
||
678 | <mkdir dir="${doc}"/> |
||
679 | <hbm2gif |
||
680 | caption="XML file for launching Catalina 5.0.25 applications using Apache Ant." |
||
681 | colors="cyan, lightcyan, orange, black, black" |
||
682 | inFile="${hbm.dir}/pt/estgp/estgweb/domain/CourseUnit.hbm.xml" |
||
683 | dotFile="${doc}/CourseUnit.dot" |
||
684 | outFile="${doc}/CourseUnit.gif" |
||
685 | exeFile="${dot.exe}" |
||
686 | /> |
||
687 | </target> |
||
688 | --> |
||
995 | jmachado | 689 | <!-- |
690 | ========================================================================================== |
||
691 | GENERATE WEBSERVICES JAXWS |
||
692 | ========================================================================================== |
||
693 | --> |
||
1 | fvelez | 694 | |
995 | jmachado | 695 | |
696 | <target name="ws.generate-siges-client" depends="initDirs"> |
||
697 | <taskdef name="wsimport2" classname="com.sun.tools.ws.ant.WsImport" |
||
698 | classpathref="pathToToolsLib"> |
||
699 | </taskdef> |
||
700 | <copy file="${ws.client.binding.dir}/${ws.siges.binding.file}" todir="${build.dir.ws}" overwrite="true"/> |
||
701 | <replace file="${build.dir.ws}/${ws.siges.binding.file}" encoding="UTF-8"> |
||
702 | <replacefilter token="@wsdl.client@" value="${ws.siges.wsdl}"/> |
||
703 | <replacefilter token="@target.namespace@" value="${ws.siges.target.namespace}"/> |
||
704 | <replacefilter token="@ws.package@" value="${ws.siges.package}"/> |
||
705 | </replace> |
||
706 | <!--xendorsed="true"--> |
||
707 | <wsimport2 |
||
708 | |||
709 | debug="${ws.debug}" |
||
710 | verbose="${ws.verbose}" |
||
711 | keep="${ws.keep}" |
||
712 | extension="${ws.extension}" |
||
713 | destdir="${gen.dir.java}" |
||
714 | wsdl="${ws.siges.wsdl}"> |
||
715 | <binding dir="${build.dir.ws}" includes="${ws.client.binding.file}"/> |
||
716 | </wsimport2> |
||
717 | <delete> |
||
718 | <fileset dir="${gen.dir.java}"> |
||
719 | <include name="**/*.class"/> |
||
720 | </fileset> |
||
721 | </delete> |
||
722 | </target> |
||
723 | |||
724 | |||
1 | fvelez | 725 | <!-- |
995 | jmachado | 726 | ========================================================================================== |
1067 | jmachado | 727 | DIRECTORIES XSD JAXB |
728 | ========================================================================================== |
||
729 | --> |
||
730 | |||
731 | <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="pathToToolsLib"> |
||
732 | </taskdef> |
||
733 | |||
734 | <target name="directories-gen-jaxb" depends="initDirs"> |
||
735 | <xjc destdir="${gen.dir.java}" package="pt.estgp.estgweb.services.directories.xsd"> |
||
736 | <schema dir="${conf.dir}/directories" includes="directory.xsd"/> |
||
737 | </xjc> |
||
738 | <replace dir="${gen.dir.java}/pt/estgp/estgweb/services/directories/xsd" value=""> |
||
739 | <include name="*.java"/> |
||
740 | <replacefilter token="public Boolean is" value="public Boolean get"/> |
||
741 | </replace> |
||
742 | </target> |
||
743 | |||
744 | |||
745 | |||
746 | <!-- |
||
747 | ========================================================================================== |
||
995 | jmachado | 748 | DEAMONS |
749 | ========================================================================================== |
||
1 | fvelez | 750 | --> |
751 | |||
752 | <!--<target name="run">--> |
||
753 | <!--<java classname="mitra.oaiharvest.harvest.HarvestEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
754 | <!--<java classname="mitra.oaiharvest.index.IndexEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
755 | <!--</target>--> |
||
336 | jmachado | 756 | <target name="util.task.createRepositoryXML"> |
757 | <java classname="pt.estgp.estgweb.services.data.CreateDescriptionsXML" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
758 | </target> |
||
359 | jmachado | 759 | <target name="util.task.reset.urlsstats"> |
760 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
761 | </target> |
||
438 | jmachado | 762 | <target name="util.task.reset.urlsstats.digests"> |
763 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsServiceDigests" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
764 | </target> |
||
1 | fvelez | 765 | |
336 | jmachado | 766 | |
1235 | jmachado | 767 | |
273 | jmachado | 768 | </project> |