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