Rev 1310 | Rev 1315 | 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 | |||
1312 | jmachado | 197 | <target name="copy.jsps.war" depends="copyConfigurationFiles" 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> |
||
1 | fvelez | 389 | <copy overwrite="true" todir="${hibernate.cfg.xml.build}" file="${hibernate.cfg.xml}"/> |
18 | jmachado | 390 | <copy overwrite="true" todir="${mime.types.build}" file="${mime.types}"/> |
1 | fvelez | 391 | <copy overwrite="true" todir="${app.properties.build}" file="${app.properties}"/> |
392 | <copy overwrite="true" todir="${jdbc.properties.build}" file="${jdbc.properties}"/> |
||
393 | <copy overwrite="true" todir="${ldap.properties.build}" file="${ldap.properties}"/> |
||
394 | <copy overwrite="true" todir="${build.dir.classes}" file="${log4j.properties}"/> |
||
214 | jmachado | 395 | <mkdir dir="${build.dir.intranet.setup.folders.file}"/> |
396 | <copy overwrite="true" todir="${build.dir.intranet.setup.folders.file}" file="${intranet.setup.folders.file.src}"/> |
||
219 | jmachado | 397 | |
368 | jmachado | 398 | <mkdir dir="${build.dir.classes}/pt/estgp/estgweb/directories"/> |
399 | <copy overwrite="true" todir="${build.dir.classes}/pt/estgp/estgweb/directories"> |
||
400 | <fileset dir="${conf.dir}/directories" includes="*.*"/> |
||
401 | </copy> |
||
347 | jmachado | 402 | <!--<java classname="${scripts.buider.class}" classpath="${build.dir.classes}">--> |
403 | <!--<arg value="${basedir}${file.separator}..${file.separator}common"/>--> |
||
404 | <!--<arg value="${basedir}${file.separator}build${file.separator}ant${file.separator}classes"/>--> |
||
405 | <!--<arg value="${build.dir.scripts}"/>--> |
||
406 | <!--<arg value="${scripts.target.libs.file}"/>--> |
||
407 | <!--</java>--> |
||
408 | <!--<copy overwrite="true" todir="${build.dir.scripts}">--> |
||
409 | <!--<fileset dir="${src.scripts}" includes="*.*"/>--> |
||
410 | <!--</copy>--> |
||
244 | jmachado | 411 | |
1 | fvelez | 412 | </target> |
413 | |||
414 | <target name="replaceFiltersConfigurationFiles"> |
||
415 | <delete file="${build.dir.classes}/MessageResources.properties"/> |
||
416 | <concat encoding="ISO-8859-1" destfile="${build.dir.classes}/MessageResources.properties" append="true"> |
||
417 | <fileset dir="${conf.dir}/language"> |
||
418 | <include name="*.properties" /> |
||
419 | </fileset> |
||
420 | </concat> |
||
421 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
||
422 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
423 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
424 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
425 | </replace> |
||
426 | <replace file="${hibernate.cfg.xml.build}/${hibernate.cfg.xml.filename}"> |
||
427 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
428 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
429 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
430 | <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/> |
||
431 | </replace> |
||
432 | <replace file="${app.properties.build}/app.properties"> |
||
433 | <replacefilter token="@tmp.dir@" value="${tmp.dir}"/> |
||
187 | jmachado | 434 | <replacefilter token="@data.dir@" value="${data.dir}"/> |
1 | fvelez | 435 | <replacefilter token="@out.dir@" value="${out.dir}"/> |
29 | jmachado | 436 | <replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/> |
79 | jmachado | 437 | <replacefilter token="@use.ldap@" value="${use.ldap}"/> |
146 | jmachado | 438 | <replacefilter token="@site.url@" value="${site.url}"/> |
1017 | jmachado | 439 | <!-- DONT USE ANY MORE NOW IS IN CONFIGURATION DAO <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/>--> |
163 | jmachado | 440 | <replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/> |
214 | jmachado | 441 | <replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/> |
442 | <replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/> |
||
1235 | jmachado | 443 | |
444 | <replacefilter token="@oracle.siges.url@" value="${oracle.siges.url}"/> |
||
445 | <replacefilter token="@oracle.siges.username@" value="${oracle.siges.username}"/> |
||
446 | <replacefilter token="@oracle.siges.password@" value="${oracle.siges.password}"/> |
||
447 | |||
1312 | jmachado | 448 | <!--System instance type specifications--> |
449 | <replacefilter token="@system.theme@" value="${system.theme}"/> |
||
450 | <replacefilter token="@authentication.policy.service@" value="${authentication.policy.service}"/> |
||
451 | <replacefilter token="@authentication.policy.username.msg.key@" value="${authentication.policy.username.msg.key}"/> |
||
452 | <replacefilter token="@authentication.policy.password.msg.key@" value="${authentication.policy.password.msg.key}"/> |
||
453 | <replacefilter token="@system.redirections.policy.index.welcome@" value="${system.redirections.policy.index.welcome}"/> |
||
454 | <replacefilter token="@system.redirections.policy.authentication.action@" value="${system.redirections.policy.authentication.action}"/> |
||
455 | |||
456 | <replacefilter token="@system.intranet.url@" value="${system.intranet.url}"/> |
||
457 | <replacefilter token="@system.public.url@" value="${system.public.url}"/> |
||
458 | |||
459 | <replacefilter token="@test.control.var@" value="${test.control.var}"/> |
||
1 | fvelez | 460 | </replace> |
461 | <replace file="${build.dir.classes}/${log4j.properties.filename}"> |
||
462 | <replacefilter token="@log.file@" value="${log.file}"/> |
||
299 | jmachado | 463 | <replacefilter token="@log.level@" value="${log.level}"/> |
1 | fvelez | 464 | </replace> |
352 | jmachado | 465 | <!--<replace file="${build.dir.scripts}/${scripts.setenv.file}"> |
219 | jmachado | 466 | <replacefilter token="@tomcat.home@" value="${tomcat.home}"/> |
352 | jmachado | 467 | </replace>--> |
1 | fvelez | 468 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
469 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
470 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
471 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
472 | </replace> |
||
473 | </target> |
||
474 | <target name="generateHibernateCfgXml" depends="compileToolFiles"> |
||
475 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
||
476 | <java classname="${mapping.buider.class}" classpath="${build.dir.classes}"> |
||
477 | <arg value="${hibernate.cfg.xml.build}"/> |
||
478 | <arg value="${hibernate.cfg.xml}"/> |
||
479 | <arg value="${package.dir}"/> |
||
480 | </java> |
||
481 | <antcall target="replaceFiltersConfigurationFiles"/> |
||
482 | </target> |
||
483 | <target name="dbInit"> |
||
7 | jmachado | 484 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
485 | <java classname="pt.estgp.estgweb.examples.DBInit" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
1 | fvelez | 486 | |
7 | jmachado | 487 | <antcall target="replaceFiltersConfigurationFiles"/> |
488 | </target> |
||
1 | fvelez | 489 | |
490 | |||
7 | jmachado | 491 | |
1 | fvelez | 492 | <!-- |
493 | Hibernate Tools Task |
||
494 | --> |
||
7 | jmachado | 495 | <taskdef name="hibernatetool" |
496 | classname="org.hibernate.tool.ant.HibernateToolTask" |
||
497 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
1 | fvelez | 498 | <!-- |
499 | ========================================================================================== |
||
500 | GENERATE SQL SCRIPTS |
||
501 | ========================================================================================== |
||
502 | --> |
||
503 | <taskdef name="schemaexport" |
||
504 | classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" |
||
505 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
506 | |||
507 | |||
1070 | jmachado | 508 | |
1312 | jmachado | 509 | <!-- |
215 | jmachado | 510 | <target name="generateHibernateSql" depends="build"> |
1 | fvelez | 511 | <schemaexport |
512 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
513 | quiet="no" |
||
514 | text="no" |
||
515 | drop="no" |
||
516 | delimiter=";" |
||
517 | output="${build.dir.classes}/app-scripts.sql"> |
||
518 | <fileset dir="${hbm.dir}"> |
||
519 | <include name="**/*.hbm.xml"/> |
||
520 | </fileset> |
||
521 | </schemaexport> |
||
1312 | jmachado | 522 | </target>--> |
1 | fvelez | 523 | |
852 | jmachado | 524 | <target name="generateUpdateHibernateSql" depends="build"> |
525 | <taskdef name="schemaupdate" |
||
526 | classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask" |
||
527 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
528 | |||
529 | <schemaupdate |
||
530 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
531 | quiet="no" |
||
532 | text="no"> |
||
533 | <fileset dir="${hbm.dir}"> |
||
534 | <include name="**/*.hbm.xml"/> |
||
535 | </fileset> |
||
536 | </schemaupdate> |
||
537 | </target> |
||
538 | |||
1 | fvelez | 539 | <target name="generateHibernateDomainObjects"> |
691 | jmachado | 540 | <replace dir="${hbm.dir}" value=""> |
541 | <include name="**/*.hbm.xml"/> |
||
542 | <replacefilter token='<timestamp source="db"' value="<timestamp"/> |
||
543 | </replace> |
||
1 | fvelez | 544 | <hibernatetool> |
545 | <configuration> |
||
546 | <fileset dir="${hbm.dir}"> |
||
547 | <include name="**/*.hbm.xml"/> |
||
548 | </fileset> |
||
549 | </configuration> |
||
550 | <hbm2java |
||
551 | jdk5="true" |
||
552 | ejb3="false" |
||
553 | destdir="${gen.dir.java}"/> |
||
554 | </hibernatetool> |
||
555 | <delete> |
||
556 | <fileset dir="${gen.dir.java}"> |
||
557 | <include name="**/*Impl.java"/> |
||
558 | </fileset> |
||
559 | </delete> |
||
691 | jmachado | 560 | <replace dir="${hbm.dir}" value=""> |
561 | <include name="**/*.hbm.xml"/> |
||
562 | <replacefilter token='<timestamp' value='<timestamp source="db"'/> |
||
563 | </replace> |
||
1 | fvelez | 564 | </target> |
565 | |||
566 | |||
567 | <!-- |
||
568 | ========================================================================================== |
||
569 | GENERATE DAO IMPLEMENTATION |
||
570 | ========================================================================================== |
||
571 | --> |
||
572 | <target name="generateHibernateDaoClasses"> |
||
573 | <hibernatetool destdir="${gen.dir.java}" > |
||
574 | <configuration> |
||
575 | <fileset dir="${hbm.dir}"> |
||
576 | <include name="**/*.hbm.xml"/> |
||
577 | </fileset> |
||
578 | </configuration> |
||
579 | <hbmtemplate |
||
580 | filepattern="{class-name}${dao.file.pattern}.java" |
||
581 | templatepath="${dao.template.dir}" |
||
582 | template="${dao.impl.template}" |
||
583 | destdir="${dao.impl.package.dir}"> |
||
584 | <property key="jdk5" value="true"/> |
||
585 | <property key="ejb3" value="false"/> |
||
586 | <property key="dao" value="${dao.file.pattern}"/> |
||
587 | <property key="daoDomainPackage" value="${domain.package}"/> |
||
588 | <property key="daoInterfacesPackage" value="${dao.interfaces.package}"/> |
||
589 | <property key="daoImplPackage" value="${dao.impl.package}"/> |
||
590 | </hbmtemplate> |
||
591 | </hibernatetool> |
||
592 | <delete> |
||
593 | <fileset dir="${gen.dir.java}"> |
||
594 | <include name="**/*ImplDao.java"/> |
||
595 | </fileset> |
||
596 | </delete> |
||
597 | </target> |
||
598 | |||
1235 | jmachado | 599 | <!-- |
600 | ========================================================================================== |
||
601 | Generate Hibernate UML Diagrams |
||
602 | ========================================================================================== |
||
1 | fvelez | 603 | |
1235 | jmachado | 604 | |
605 | <property name="doc" location="build/ant/diagrams"/> |
||
606 | |||
607 | <property name="dot.exe" location="/usr/local/bin/dot" /> |
||
608 | |||
609 | <taskdef |
||
610 | name="hbm2gif" |
||
611 | classname="com.oy.shared.lm.ant.HBMtoGIFTask" |
||
612 | classpathref="pathToToolsLib" |
||
613 | /> |
||
614 | |||
615 | <target name="generateHibernateUmlDiagram" depends="initDirs"> |
||
616 | <mkdir dir="${doc}"/> |
||
617 | <hbm2gif |
||
618 | caption="XML file for launching Catalina 5.0.25 applications using Apache Ant." |
||
619 | colors="cyan, lightcyan, orange, black, black" |
||
620 | inFile="${hbm.dir}/pt/estgp/estgweb/domain/CourseUnit.hbm.xml" |
||
621 | dotFile="${doc}/CourseUnit.dot" |
||
622 | outFile="${doc}/CourseUnit.gif" |
||
623 | exeFile="${dot.exe}" |
||
624 | /> |
||
625 | </target> |
||
626 | --> |
||
995 | jmachado | 627 | <!-- |
628 | ========================================================================================== |
||
629 | GENERATE WEBSERVICES JAXWS |
||
630 | ========================================================================================== |
||
631 | --> |
||
1 | fvelez | 632 | |
995 | jmachado | 633 | |
634 | <target name="ws.generate-siges-client" depends="initDirs"> |
||
635 | <taskdef name="wsimport2" classname="com.sun.tools.ws.ant.WsImport" |
||
636 | classpathref="pathToToolsLib"> |
||
637 | </taskdef> |
||
638 | <copy file="${ws.client.binding.dir}/${ws.siges.binding.file}" todir="${build.dir.ws}" overwrite="true"/> |
||
639 | <replace file="${build.dir.ws}/${ws.siges.binding.file}" encoding="UTF-8"> |
||
640 | <replacefilter token="@wsdl.client@" value="${ws.siges.wsdl}"/> |
||
641 | <replacefilter token="@target.namespace@" value="${ws.siges.target.namespace}"/> |
||
642 | <replacefilter token="@ws.package@" value="${ws.siges.package}"/> |
||
643 | </replace> |
||
644 | <!--xendorsed="true"--> |
||
645 | <wsimport2 |
||
646 | |||
647 | debug="${ws.debug}" |
||
648 | verbose="${ws.verbose}" |
||
649 | keep="${ws.keep}" |
||
650 | extension="${ws.extension}" |
||
651 | destdir="${gen.dir.java}" |
||
652 | wsdl="${ws.siges.wsdl}"> |
||
653 | <binding dir="${build.dir.ws}" includes="${ws.client.binding.file}"/> |
||
654 | </wsimport2> |
||
655 | <delete> |
||
656 | <fileset dir="${gen.dir.java}"> |
||
657 | <include name="**/*.class"/> |
||
658 | </fileset> |
||
659 | </delete> |
||
660 | </target> |
||
661 | |||
662 | |||
1 | fvelez | 663 | <!-- |
995 | jmachado | 664 | ========================================================================================== |
1067 | jmachado | 665 | DIRECTORIES XSD JAXB |
666 | ========================================================================================== |
||
667 | --> |
||
668 | |||
669 | <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="pathToToolsLib"> |
||
670 | </taskdef> |
||
671 | |||
672 | <target name="directories-gen-jaxb" depends="initDirs"> |
||
673 | <xjc destdir="${gen.dir.java}" package="pt.estgp.estgweb.services.directories.xsd"> |
||
674 | <schema dir="${conf.dir}/directories" includes="directory.xsd"/> |
||
675 | </xjc> |
||
676 | <replace dir="${gen.dir.java}/pt/estgp/estgweb/services/directories/xsd" value=""> |
||
677 | <include name="*.java"/> |
||
678 | <replacefilter token="public Boolean is" value="public Boolean get"/> |
||
679 | </replace> |
||
680 | </target> |
||
681 | |||
682 | |||
683 | |||
684 | <!-- |
||
685 | ========================================================================================== |
||
995 | jmachado | 686 | DEAMONS |
687 | ========================================================================================== |
||
1 | fvelez | 688 | --> |
689 | |||
690 | <!--<target name="run">--> |
||
691 | <!--<java classname="mitra.oaiharvest.harvest.HarvestEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
692 | <!--<java classname="mitra.oaiharvest.index.IndexEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
693 | <!--</target>--> |
||
336 | jmachado | 694 | <target name="util.task.createRepositoryXML"> |
695 | <java classname="pt.estgp.estgweb.services.data.CreateDescriptionsXML" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
696 | </target> |
||
359 | jmachado | 697 | <target name="util.task.reset.urlsstats"> |
698 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
699 | </target> |
||
438 | jmachado | 700 | <target name="util.task.reset.urlsstats.digests"> |
701 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsServiceDigests" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
702 | </target> |
||
1 | fvelez | 703 | |
336 | jmachado | 704 | |
1235 | jmachado | 705 | |
273 | jmachado | 706 | </project> |