Rev 808 | Rev 896 | 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> |
||
168 | fvelez | 12 | </target> |
1 | fvelez | 13 | |
14 | |||
15 | <!-- |
||
16 | ========================================================================================== |
||
17 | Path libs definitions and Properties files |
||
18 | ========================================================================================== |
||
19 | --> |
||
20 | |||
21 | |||
104 | jmachado | 22 | <import file="libs.xml"/> |
99 | jmachado | 23 | <import file="build-web-services.xml"/> |
1 | fvelez | 24 | |
25 | <!-- |
||
26 | ========================================================================================== |
||
27 | General Task |
||
28 | ========================================================================================== |
||
29 | --> |
||
30 | <!--caso queiramos apagar os pregen hbm delPreGenAppScripts--> |
||
215 | jmachado | 31 | <target name="all" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build,generateHibernateSql,build.war,dbInit"/> |
291 | jmachado | 32 | <target name="allWebNode" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build.war"/> |
33 | <target name="dataNode" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build,generateHibernateSql"/> |
||
1 | fvelez | 34 | |
35 | |||
36 | <!-- |
||
37 | ========================================================================================== |
||
38 | CLEAN TASKS |
||
39 | ========================================================================================== |
||
40 | --> |
||
41 | <target name="clean" description="clean *.class and build dir"> |
||
42 | <delete dir="${build.dir}"/> |
||
165 | jmachado | 43 | <delete dir="${dist.dir}"/> |
7 | jmachado | 44 | <delete> |
45 | <fileset dir="${gen.dir.java}"> |
||
112 | jmachado | 46 | <exclude name="pt/ipportalegre/**/*.*"/> |
7 | jmachado | 47 | <include name="**/*.java"/> |
48 | </fileset> |
||
49 | </delete> |
||
163 | jmachado | 50 | <!--Give time to delete all files--> |
51 | <sleep seconds="5"/> |
||
1 | fvelez | 52 | </target> |
53 | |||
54 | |||
55 | |||
56 | <!-- |
||
57 | ========================================================================================== |
||
58 | CREATE-DIRS |
||
59 | ========================================================================================== |
||
60 | --> |
||
61 | <target name="initDirs"> |
||
62 | <mkdir dir="${log.dir}"/> |
||
63 | <mkdir dir="${data.dir}"/> |
||
64 | <mkdir dir="${build.dir}"/> |
||
65 | <mkdir dir="${build.dir.classes}"/> |
||
66 | <mkdir dir="${build.dir.war}"/> |
||
99 | jmachado | 67 | <mkdir dir="${build.dir.ws}"/> |
219 | jmachado | 68 | <mkdir dir="${build.dir.scripts}"/> |
1 | fvelez | 69 | <delete dir="${dist.dir}"/> |
70 | <mkdir dir="${dist.dir}"/> |
||
71 | <mkdir dir="${gen.dir.java}"/> |
||
72 | </target> |
||
73 | |||
74 | |||
75 | |||
76 | <!-- |
||
77 | ========================================================================================== |
||
78 | Tomcat Tasks |
||
79 | ========================================================================================== |
||
80 | --> |
||
81 | <taskdef name="tomcat.reload" classname="org.apache.catalina.ant.ReloadTask" classpathref="pathToToolsLib"/> |
||
82 | <taskdef name="tomcat.remove" classname="org.apache.catalina.ant.RemoveTask" classpathref="pathToToolsLib"/> |
||
83 | <taskdef name="tomcat.roles" classname="org.apache.catalina.ant.RolesTask" classpathref="pathToToolsLib"/> |
||
84 | <taskdef name="tomcat.start" classname="org.apache.catalina.ant.StartTask" classpathref="pathToToolsLib"/> |
||
85 | <taskdef name="tomcat.stop" classname="org.apache.catalina.ant.StopTask" classpathref="pathToToolsLib"/> |
||
86 | <taskdef name="tomcat.undeploy" classname="org.apache.catalina.ant.UndeployTask" classpathref="pathToToolsLib"/> |
||
87 | <taskdef name="tomcat.deploy" classname="org.apache.catalina.ant.DeployTask" classpathref="pathToToolsLib"/> |
||
88 | <taskdef name="tomcat.install" classname="org.apache.catalina.ant.InstallTask" classpathref="pathToToolsLib"/> |
||
385 | jmachado | 89 | <taskdef name="tomcat.jasper" classname="org.apache.jasper.JspC" classpathref="pathToToolsLib"/> |
1 | fvelez | 90 | |
91 | |||
92 | <!-- |
||
93 | TOMCAT Instalation Tasks |
||
94 | --> |
||
95 | <target name="tomcat.deployContext" depends="build.war"> |
||
96 | <echo message="${tomcat.manager}"/> |
||
97 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
290 | jmachado | 98 | config="file://${basedir}/${dist.dir}/estgweb.xml" |
1 | fvelez | 99 | username="${tomcat.username}" password="${tomcat.password}" /> |
100 | </target> |
||
340 | jmachado | 101 | <target name="tomcat.deployContextOnly" depends=""> |
102 | <echo message="${tomcat.manager}"/> |
||
103 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
104 | config="file://${basedir}/${dist.dir}/estgweb.xml" |
||
105 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
106 | </target> |
||
1 | fvelez | 107 | <target name="tomcat.redeployContext" depends="tomcat.undeploy,build.war" > |
108 | <echo message="${tomcat.manager}"/> |
||
109 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
287 | jmachado | 110 | config="file:${basedir}/${dist.dir}/estgweb.xml" |
1 | fvelez | 111 | username="${tomcat.username}" password="${tomcat.password}" /> |
112 | </target> |
||
281 | jmachado | 113 | <target name="tomcat.deploy" depends="war" > |
285 | jmachado | 114 | <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
283 | jmachado | 115 | <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
285 | jmachado | 116 | war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
1 | fvelez | 117 | username="${tomcat.username}" password="${tomcat.password}" /> |
118 | </target> |
||
281 | jmachado | 119 | <target name="tomcat.redeploy" depends="tomcat.undeploy,war"> |
285 | jmachado | 120 | <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
1 | fvelez | 121 | <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
285 | jmachado | 122 | war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
1 | fvelez | 123 | username="${tomcat.username}" password="${tomcat.password}" /> |
124 | </target> |
||
125 | <target name="tomcat.undeploy"> |
||
126 | <echo message="${tomcat.manager}"/> |
||
127 | <tomcat.undeploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
128 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
129 | </target> |
||
130 | <target name="tomcat.reload"> |
||
131 | <echo message="${tomcat.manager}"/> |
||
132 | <tomcat.reload url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
133 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
134 | </target> |
||
135 | <target name="tomcat.start"> |
||
136 | <echo message="${tomcat.manager}"/> |
||
137 | <tomcat.start url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
138 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
139 | </target> |
||
140 | <target name="tomcat.stop"> |
||
141 | <echo message="${tomcat.manager}"/> |
||
142 | <tomcat.stop url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
143 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
144 | </target> |
||
145 | |||
146 | <!-- |
||
147 | ========================================================================================== |
||
148 | BUILD TASKS, Have no effect now, no revengstrategy defined.... |
||
149 | ========================================================================================== |
||
150 | --> |
||
151 | <target name="build" depends="initDirs" description="Compile All and create conf files"> |
||
152 | <antcall target="compile"/> |
||
153 | <antcall target="createConfigurationFiles"/> |
||
154 | </target> |
||
385 | jmachado | 155 | |
1 | fvelez | 156 | <target name="compile" depends="initDirs" description="Compile All"> |
368 | jmachado | 157 | <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 | 158 | <src path="${src.dir}"/> |
159 | <src path="${gen.dir.java}"/> |
||
160 | <classpath refid="pathToToolsLib"/> |
||
161 | </javac> |
||
162 | </target> |
||
163 | <target name="compileToolFiles" description="Compile Mappings Builder"> |
||
164 | <javac destdir="${build.dir.classes}" srcdir="${src.dir}" debug="true" optimize="true" deprecation="true" verbose="true" failonerror="true"> |
||
165 | <include name="${mapping.buider.class.file}"/> |
||
219 | jmachado | 166 | <include name="${scripts.buider.class.file}"/> |
1 | fvelez | 167 | <classpath refid="pathToToolsLib"/> |
168 | </javac> |
||
169 | </target> |
||
170 | |||
171 | <!-- |
||
172 | Build distribution files |
||
173 | --> |
||
174 | <target name="dist" depends="build"> |
||
175 | <jar jarfile="${dist.dir}/estgweb.jar"> |
||
176 | <fileset dir="${build.dir.classes}" includes="**/*.class"/> |
||
177 | </jar> |
||
178 | <copy overwrite="true" todir="${dist.dir}"> |
||
179 | <fileset dir="${build.dir.classes}" includes="**/*.properties"/> |
||
180 | <fileset dir="${build.dir.classes}" includes="**/*.xml"/> |
||
730 | jmachado | 181 | <fileset dir="${build.dir.classes}" includes="**/*.gif"/> |
244 | jmachado | 182 | <fileset dir="${build.dir.classes}" includes="**/*.xsd"/> |
183 | <fileset dir="${build.dir.classes}" includes="**/*.xsl"/> |
||
1 | fvelez | 184 | </copy> |
185 | <copy overwrite="true" todir="${dist.dir}" file="${conf.dir}/tomcat/estgweb.xml"/> |
||
186 | <replace file="${dist.dir}/estgweb.xml" value=""> |
||
187 | <replacefilter token="@build.dir.war@" value="${basedir}${file.separator}build${file.separator}ant${file.separator}war${file.separator}"/> |
||
188 | <replacefilter token="@context.path@" value="${tomcat.context.path}"/> |
||
189 | </replace> |
||
190 | </target> |
||
191 | |||
7 | jmachado | 192 | <target name="copy.jsps.war" description="copy only jsps to war distribution"> |
1 | fvelez | 193 | <copy todir="${build.dir.war}" overwrite="false"> |
194 | <fileset dir="src/web"> |
||
195 | <include name="**/*"/> |
||
196 | </fileset> |
||
197 | </copy> |
||
165 | jmachado | 198 | <replace file="${build.dir.war}/css/style.css"> |
199 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
200 | </replace> |
||
201 | <replace file="${build.dir.war}/css/intranet.css"> |
||
202 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
203 | </replace> |
||
204 | <replace file="${build.dir.war}/js/ajax.js"> |
||
205 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
206 | </replace> |
||
1 | fvelez | 207 | </target> |
208 | |||
291 | jmachado | 209 | <target name="build.war" depends="dist" description="Make war distribution"> |
1 | fvelez | 210 | <mkdir dir="${build.dir.war}"/> |
211 | <mkdir dir="${build.dir.war}/WEB-INF"/> |
||
212 | <mkdir dir="${build.dir.war}/WEB-INF/lib"/> |
||
213 | <copy todir="${build.dir.war}/WEB-INF/lib"> |
||
214 | <fileset dir="${common.lib.dir}/log4j"> |
||
215 | <include name="*.jar"/> |
||
216 | </fileset> |
||
217 | <fileset dir="${common.lib.dir}/berserk"> |
||
218 | <include name="**/*.jar"/> |
||
219 | </fileset> |
||
220 | <fileset dir="${common.lib.dir}/hibernate"> |
||
221 | <include name="**/*.jar"/> |
||
222 | </fileset> |
||
223 | <fileset dir="${common.lib.dir}/log4j"> |
||
224 | <include name="**/*.jar"/> |
||
225 | </fileset> |
||
226 | <fileset dir="${common.lib.dir}/mysql"> |
||
227 | <include name="**/*.jar"/> |
||
228 | </fileset> |
||
229 | <fileset dir="${common.lib.dir}/commons"> |
||
230 | <include name="**/*.jar"/> |
||
231 | </fileset> |
||
232 | <fileset dir="${common.lib.dir}/struts"> |
||
233 | <include name="**/*.jar"/> |
||
234 | </fileset> |
||
10 | jmachado | 235 | <fileset dir="${common.lib.dir}/ldap"> |
236 | <include name="**/*.jar"/> |
||
237 | </fileset> |
||
29 | jmachado | 238 | <fileset dir="${common.lib.dir}/mail"> |
239 | <include name="**/*.jar"/> |
||
240 | </fileset> |
||
18 | jmachado | 241 | <fileset dir="${common.lib.dir}/jfreechart"> |
242 | <include name="**/*.jar"/> |
||
243 | </fileset> |
||
99 | jmachado | 244 | <fileset dir="${common.lib.dir}/lucene"> |
92 | jmachado | 245 | <include name="**/*.jar"/> |
246 | </fileset> |
||
186 | fvelez | 247 | <fileset dir="${common.lib.dir}/jaxrpc"> |
104 | jmachado | 248 | <include name="**/*.jar"/> |
186 | fvelez | 249 | </fileset> |
244 | jmachado | 250 | <fileset dir="${common.lib.dir}/saxon"> |
251 | <include name="**/*.jar"/> |
||
252 | </fileset> |
||
726 | jmachado | 253 | <fileset dir="${common.lib.dir}/fop"> |
254 | <include name="**/*.jar"/> |
||
255 | </fileset> |
||
808 | jmachado | 256 | <fileset dir="${common.lib.dir}/itextpdf"> |
257 | <include name="**/*.jar"/> |
||
258 | </fileset> |
||
1 | fvelez | 259 | </copy> |
260 | <copy file="${dist.dir}/estgweb.jar" todir="${build.dir.war}/WEB-INF/lib"/> |
||
261 | <copy todir="${build.dir.war}/WEB-INF" overwrite="true"> |
||
262 | <fileset dir="${conf.dir}/WEB-INF"> |
||
263 | <include name="**/*.*"/> |
||
264 | </fileset> |
||
265 | </copy> |
||
266 | <mkdir dir="${build.dir.war}/WEB-INF/classes"/> |
||
267 | <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="true"> |
||
268 | <fileset dir="${build.dir.classes}"> |
||
18 | jmachado | 269 | <include name="**/*.types"/> |
1 | fvelez | 270 | <include name="**/*.properties"/> |
29 | jmachado | 271 | <include name="**/*.txt"/> |
1 | fvelez | 272 | <include name="**/*.xml"/> |
730 | jmachado | 273 | <include name="**/*.gif"/> |
214 | jmachado | 274 | <include name="**/*.exe"/> |
248 | jmachado | 275 | <include name="**/*.xsl"/> |
276 | <include name="**/*.xsd"/> |
||
1 | fvelez | 277 | </fileset> |
278 | </copy> |
||
279 | <copy todir="${build.dir.war}" overwrite="true"> |
||
280 | <fileset dir="src/web"> |
||
281 | <include name="**/*"/> |
||
282 | </fileset> |
||
283 | </copy> |
||
48 | fvelez | 284 | <replace file="${build.dir.war}/js/ajax.js"> |
165 | jmachado | 285 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
48 | fvelez | 286 | </replace> |
165 | jmachado | 287 | <replace file="${build.dir.war}/css/style.css"> |
288 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
289 | </replace> |
||
290 | <replace file="${build.dir.war}/css/intranet.css"> |
||
291 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
292 | </replace> |
||
385 | jmachado | 293 | </target> |
165 | jmachado | 294 | |
385 | jmachado | 295 | <target name="jasper" depends="copy.jsps.war"> |
296 | <delete dir="${build.dir.jsp}"/> |
||
297 | <mkdir dir="${build.dir.jsp}"/> |
||
298 | <tomcat.jasper validateXml="false" uriroot="${build.dir.war}" webXmlFragment="${build.dir.war}/WEB-INF/generated_web.xml" addWebXmlMappings="true" outputDir="${build.dir.jsp}" /> |
||
299 | <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"> |
||
300 | <src path="${build.dir.jsp}"/> |
||
301 | <classpath path="${build.dir.classes}"/> |
||
302 | <classpath refid="pathToToolsLib"/> |
||
303 | </javac> |
||
304 | <delete> |
||
305 | <fileset dir="${build.dir.war}"> |
||
306 | <include name="**/*.jsp"/> |
||
307 | </fileset> |
||
308 | </delete> |
||
1 | fvelez | 309 | </target> |
310 | |||
311 | <target name="war" depends="build.war"> |
||
312 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
313 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
314 | <fileset dir="${build.dir.war}"> |
||
315 | <include name="**/*" /> |
||
316 | </fileset> |
||
317 | </jar> |
||
318 | </target> |
||
319 | |||
385 | jmachado | 320 | <target name="war.jasper" depends="build.war,jasper"> |
321 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
322 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
323 | <fileset dir="${build.dir.war}"> |
||
324 | <include name="**/*" /> |
||
325 | </fileset> |
||
326 | </jar> |
||
327 | </target> |
||
1 | fvelez | 328 | |
385 | jmachado | 329 | |
1 | fvelez | 330 | <!-- |
331 | ========================================================================================== |
||
332 | Generate Configuration Files TASKS |
||
333 | ========================================================================================== |
||
334 | --> |
||
229 | jmachado | 335 | <target name="createConfigurationFiles" depends="compileToolFiles,copyConfigurationFiles,replaceFiltersConfigurationFiles,generateHibernateCfgXml"/> |
1 | fvelez | 336 | |
337 | <target name="copyConfigurationFiles"> |
||
338 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
339 | <fileset dir="${hbm.dir}" includes="**/*.hbm.xml"/> |
||
340 | </copy> |
||
244 | jmachado | 341 | <mkdir dir="${build.dir.classes}/template/xsd"/> |
342 | <copy todir="${build.dir.classes}/template/xsd" overwrite="true"> |
||
343 | <fileset dir="${src.xsd}"> |
||
344 | <include name="**/*.xsl"/> |
||
345 | <include name="**/*.xsd"/> |
||
346 | </fileset> |
||
347 | </copy> |
||
1 | fvelez | 348 | <copy overwrite="true" todir="${build.dir.classes}"> |
349 | <fileset dir="${src.dir}" includes="**/*.xsl"/> |
||
350 | </copy> |
||
351 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
730 | jmachado | 352 | <fileset dir="${src.dir}" includes="**/*.gif"/> |
353 | </copy> |
||
354 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
381 | jmachado | 355 | <fileset dir="${src.dir}" includes="**/*.csv"/> |
356 | </copy> |
||
357 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
1 | fvelez | 358 | <fileset dir="${conf.dir}/berserk" includes="*.*"/> |
359 | </copy> |
||
29 | jmachado | 360 | <mkdir dir="${email.templates.dir.build}"/> |
361 | <copy overwrite="true" todir="${email.templates.dir.build}"> |
||
362 | <fileset dir="${email.templates.dir.conf}" includes="*.*"/> |
||
363 | </copy> |
||
227 | jmachado | 364 | <mkdir dir="${sms.templates.dir.build}"/> |
365 | <copy overwrite="true" todir="${sms.templates.dir.build}"> |
||
366 | <fileset dir="${sms.templates.dir.conf}" includes="*.*"/> |
||
367 | </copy> |
||
215 | jmachado | 368 | <mkdir dir="${assignement.templates.dir.build}"/> |
369 | <copy overwrite="true" todir="${assignement.templates.dir.build}"> |
||
370 | <fileset dir="${assignement.templates.dir.conf}" includes="*.*"/> |
||
371 | </copy> |
||
1 | fvelez | 372 | <copy overwrite="true" todir="${hibernate.cfg.xml.build}" file="${hibernate.cfg.xml}"/> |
18 | jmachado | 373 | <copy overwrite="true" todir="${mime.types.build}" file="${mime.types}"/> |
1 | fvelez | 374 | <copy overwrite="true" todir="${app.properties.build}" file="${app.properties}"/> |
375 | <copy overwrite="true" todir="${jdbc.properties.build}" file="${jdbc.properties}"/> |
||
376 | <copy overwrite="true" todir="${ldap.properties.build}" file="${ldap.properties}"/> |
||
377 | <copy overwrite="true" todir="${build.dir.classes}" file="${log4j.properties}"/> |
||
214 | jmachado | 378 | <mkdir dir="${build.dir.intranet.setup.folders.file}"/> |
379 | <copy overwrite="true" todir="${build.dir.intranet.setup.folders.file}" file="${intranet.setup.folders.file.src}"/> |
||
219 | jmachado | 380 | |
368 | jmachado | 381 | <mkdir dir="${build.dir.classes}/pt/estgp/estgweb/directories"/> |
382 | <copy overwrite="true" todir="${build.dir.classes}/pt/estgp/estgweb/directories"> |
||
383 | <fileset dir="${conf.dir}/directories" includes="*.*"/> |
||
384 | </copy> |
||
347 | jmachado | 385 | <!--<java classname="${scripts.buider.class}" classpath="${build.dir.classes}">--> |
386 | <!--<arg value="${basedir}${file.separator}..${file.separator}common"/>--> |
||
387 | <!--<arg value="${basedir}${file.separator}build${file.separator}ant${file.separator}classes"/>--> |
||
388 | <!--<arg value="${build.dir.scripts}"/>--> |
||
389 | <!--<arg value="${scripts.target.libs.file}"/>--> |
||
390 | <!--</java>--> |
||
391 | <!--<copy overwrite="true" todir="${build.dir.scripts}">--> |
||
392 | <!--<fileset dir="${src.scripts}" includes="*.*"/>--> |
||
393 | <!--</copy>--> |
||
244 | jmachado | 394 | |
1 | fvelez | 395 | </target> |
396 | |||
397 | <target name="replaceFiltersConfigurationFiles"> |
||
398 | <delete file="${build.dir.classes}/MessageResources.properties"/> |
||
399 | <concat encoding="ISO-8859-1" destfile="${build.dir.classes}/MessageResources.properties" append="true"> |
||
400 | <fileset dir="${conf.dir}/language"> |
||
401 | <include name="*.properties" /> |
||
402 | </fileset> |
||
403 | </concat> |
||
404 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
||
405 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
406 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
407 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
408 | </replace> |
||
409 | <replace file="${hibernate.cfg.xml.build}/${hibernate.cfg.xml.filename}"> |
||
410 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
411 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
412 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
413 | <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/> |
||
414 | </replace> |
||
415 | <replace file="${app.properties.build}/app.properties"> |
||
416 | <replacefilter token="@tmp.dir@" value="${tmp.dir}"/> |
||
187 | jmachado | 417 | <replacefilter token="@data.dir@" value="${data.dir}"/> |
1 | fvelez | 418 | <replacefilter token="@out.dir@" value="${out.dir}"/> |
29 | jmachado | 419 | <replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/> |
79 | jmachado | 420 | <replacefilter token="@use.ldap@" value="${use.ldap}"/> |
146 | jmachado | 421 | <replacefilter token="@site.url@" value="${site.url}"/> |
163 | jmachado | 422 | <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/> |
423 | <replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/> |
||
214 | jmachado | 424 | <replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/> |
425 | <replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/> |
||
1 | fvelez | 426 | </replace> |
427 | <replace file="${build.dir.classes}/${log4j.properties.filename}"> |
||
428 | <replacefilter token="@log.file@" value="${log.file}"/> |
||
299 | jmachado | 429 | <replacefilter token="@log.level@" value="${log.level}"/> |
1 | fvelez | 430 | </replace> |
352 | jmachado | 431 | <!--<replace file="${build.dir.scripts}/${scripts.setenv.file}"> |
219 | jmachado | 432 | <replacefilter token="@tomcat.home@" value="${tomcat.home}"/> |
352 | jmachado | 433 | </replace>--> |
1 | fvelez | 434 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
435 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
436 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
437 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
438 | </replace> |
||
439 | </target> |
||
440 | <target name="generateHibernateCfgXml" depends="compileToolFiles"> |
||
441 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
||
442 | <java classname="${mapping.buider.class}" classpath="${build.dir.classes}"> |
||
443 | <arg value="${hibernate.cfg.xml.build}"/> |
||
444 | <arg value="${hibernate.cfg.xml}"/> |
||
445 | <arg value="${package.dir}"/> |
||
446 | </java> |
||
447 | <antcall target="replaceFiltersConfigurationFiles"/> |
||
448 | </target> |
||
449 | <target name="dbInit"> |
||
7 | jmachado | 450 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
451 | <java classname="pt.estgp.estgweb.examples.DBInit" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
1 | fvelez | 452 | |
7 | jmachado | 453 | <antcall target="replaceFiltersConfigurationFiles"/> |
454 | </target> |
||
1 | fvelez | 455 | |
456 | |||
7 | jmachado | 457 | |
1 | fvelez | 458 | <!-- |
459 | Hibernate Tools Task |
||
460 | --> |
||
7 | jmachado | 461 | <taskdef name="hibernatetool" |
462 | classname="org.hibernate.tool.ant.HibernateToolTask" |
||
463 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
1 | fvelez | 464 | <!-- |
465 | ========================================================================================== |
||
466 | GENERATE SQL SCRIPTS |
||
467 | ========================================================================================== |
||
468 | --> |
||
469 | <taskdef name="schemaexport" |
||
470 | classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" |
||
471 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
472 | |||
473 | |||
215 | jmachado | 474 | <target name="generateHibernateSql" depends="build"> |
1 | fvelez | 475 | <schemaexport |
476 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
477 | quiet="no" |
||
478 | text="no" |
||
479 | drop="no" |
||
480 | delimiter=";" |
||
481 | output="${build.dir.classes}/app-scripts.sql"> |
||
482 | <fileset dir="${hbm.dir}"> |
||
483 | <include name="**/*.hbm.xml"/> |
||
484 | </fileset> |
||
485 | </schemaexport> |
||
486 | </target> |
||
487 | |||
852 | jmachado | 488 | <target name="generateUpdateHibernateSql" depends="build"> |
489 | <taskdef name="schemaupdate" |
||
490 | classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask" |
||
491 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
492 | |||
493 | <schemaupdate |
||
494 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
495 | quiet="no" |
||
496 | text="no"> |
||
497 | <fileset dir="${hbm.dir}"> |
||
498 | <include name="**/*.hbm.xml"/> |
||
499 | </fileset> |
||
500 | </schemaupdate> |
||
501 | </target> |
||
502 | |||
1 | fvelez | 503 | <target name="generateHibernateDomainObjects"> |
691 | jmachado | 504 | <replace dir="${hbm.dir}" value=""> |
505 | <include name="**/*.hbm.xml"/> |
||
506 | <replacefilter token='<timestamp source="db"' value="<timestamp"/> |
||
507 | </replace> |
||
1 | fvelez | 508 | <hibernatetool> |
509 | <configuration> |
||
510 | <fileset dir="${hbm.dir}"> |
||
511 | <include name="**/*.hbm.xml"/> |
||
512 | </fileset> |
||
513 | </configuration> |
||
514 | <hbm2java |
||
515 | jdk5="true" |
||
516 | ejb3="false" |
||
517 | destdir="${gen.dir.java}"/> |
||
518 | </hibernatetool> |
||
519 | <delete> |
||
520 | <fileset dir="${gen.dir.java}"> |
||
521 | <include name="**/*Impl.java"/> |
||
522 | </fileset> |
||
523 | </delete> |
||
691 | jmachado | 524 | <replace dir="${hbm.dir}" value=""> |
525 | <include name="**/*.hbm.xml"/> |
||
526 | <replacefilter token='<timestamp' value='<timestamp source="db"'/> |
||
527 | </replace> |
||
1 | fvelez | 528 | </target> |
529 | |||
530 | |||
531 | <!-- |
||
532 | ========================================================================================== |
||
533 | GENERATE DAO IMPLEMENTATION |
||
534 | ========================================================================================== |
||
535 | --> |
||
536 | <target name="generateHibernateDaoClasses"> |
||
537 | <hibernatetool destdir="${gen.dir.java}" > |
||
538 | <configuration> |
||
539 | <fileset dir="${hbm.dir}"> |
||
540 | <include name="**/*.hbm.xml"/> |
||
541 | </fileset> |
||
542 | </configuration> |
||
543 | <hbmtemplate |
||
544 | filepattern="{class-name}${dao.file.pattern}.java" |
||
545 | templatepath="${dao.template.dir}" |
||
546 | template="${dao.impl.template}" |
||
547 | destdir="${dao.impl.package.dir}"> |
||
548 | <property key="jdk5" value="true"/> |
||
549 | <property key="ejb3" value="false"/> |
||
550 | <property key="dao" value="${dao.file.pattern}"/> |
||
551 | <property key="daoDomainPackage" value="${domain.package}"/> |
||
552 | <property key="daoInterfacesPackage" value="${dao.interfaces.package}"/> |
||
553 | <property key="daoImplPackage" value="${dao.impl.package}"/> |
||
554 | </hbmtemplate> |
||
555 | </hibernatetool> |
||
556 | <delete> |
||
557 | <fileset dir="${gen.dir.java}"> |
||
558 | <include name="**/*ImplDao.java"/> |
||
559 | </fileset> |
||
560 | </delete> |
||
561 | </target> |
||
562 | |||
563 | |||
564 | |||
565 | <!-- |
||
566 | Run Deamon |
||
567 | --> |
||
568 | |||
569 | <!--<target name="run">--> |
||
570 | <!--<java classname="mitra.oaiharvest.harvest.HarvestEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
571 | <!--<java classname="mitra.oaiharvest.index.IndexEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
572 | <!--</target>--> |
||
336 | jmachado | 573 | <target name="util.task.createRepositoryXML"> |
574 | <java classname="pt.estgp.estgweb.services.data.CreateDescriptionsXML" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
575 | </target> |
||
359 | jmachado | 576 | <target name="util.task.reset.urlsstats"> |
577 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
578 | </target> |
||
438 | jmachado | 579 | <target name="util.task.reset.urlsstats.digests"> |
580 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsServiceDigests" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
581 | </target> |
||
1 | fvelez | 582 | |
336 | jmachado | 583 | |
273 | jmachado | 584 | </project> |