Rev 347 | Rev 359 | 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"/> |
||
89 | |||
90 | |||
91 | <!-- |
||
92 | TOMCAT Instalation Tasks |
||
93 | --> |
||
94 | <target name="tomcat.deployContext" depends="build.war"> |
||
95 | <echo message="${tomcat.manager}"/> |
||
96 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
290 | jmachado | 97 | config="file://${basedir}/${dist.dir}/estgweb.xml" |
1 | fvelez | 98 | username="${tomcat.username}" password="${tomcat.password}" /> |
99 | </target> |
||
340 | jmachado | 100 | <target name="tomcat.deployContextOnly" depends=""> |
101 | <echo message="${tomcat.manager}"/> |
||
102 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
103 | config="file://${basedir}/${dist.dir}/estgweb.xml" |
||
104 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
105 | </target> |
||
1 | fvelez | 106 | <target name="tomcat.redeployContext" depends="tomcat.undeploy,build.war" > |
107 | <echo message="${tomcat.manager}"/> |
||
108 | <tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
287 | jmachado | 109 | config="file:${basedir}/${dist.dir}/estgweb.xml" |
1 | fvelez | 110 | username="${tomcat.username}" password="${tomcat.password}" /> |
111 | </target> |
||
281 | jmachado | 112 | <target name="tomcat.deploy" depends="war" > |
285 | jmachado | 113 | <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
283 | jmachado | 114 | <tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
285 | jmachado | 115 | war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
1 | fvelez | 116 | username="${tomcat.username}" password="${tomcat.password}" /> |
117 | </target> |
||
281 | jmachado | 118 | <target name="tomcat.redeploy" depends="tomcat.undeploy,war"> |
285 | jmachado | 119 | <echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
1 | fvelez | 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> |
||
124 | <target name="tomcat.undeploy"> |
||
125 | <echo message="${tomcat.manager}"/> |
||
126 | <tomcat.undeploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
127 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
128 | </target> |
||
129 | <target name="tomcat.reload"> |
||
130 | <echo message="${tomcat.manager}"/> |
||
131 | <tomcat.reload url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
132 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
133 | </target> |
||
134 | <target name="tomcat.start"> |
||
135 | <echo message="${tomcat.manager}"/> |
||
136 | <tomcat.start url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
137 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
138 | </target> |
||
139 | <target name="tomcat.stop"> |
||
140 | <echo message="${tomcat.manager}"/> |
||
141 | <tomcat.stop url="${tomcat.manager}" path="${tomcat.context.path.install}" |
||
142 | username="${tomcat.username}" password="${tomcat.password}" /> |
||
143 | </target> |
||
144 | |||
145 | <!-- |
||
146 | ========================================================================================== |
||
147 | BUILD TASKS, Have no effect now, no revengstrategy defined.... |
||
148 | ========================================================================================== |
||
149 | --> |
||
150 | <target name="build" depends="initDirs" description="Compile All and create conf files"> |
||
151 | <antcall target="compile"/> |
||
152 | <antcall target="createConfigurationFiles"/> |
||
153 | </target> |
||
154 | <target name="compile" depends="initDirs" description="Compile All"> |
||
352 | jmachado | 155 | <javac encoding="UTF-8" source="1.5" target="1.5" destdir="${build.dir.classes}" debug="true" optimize="true" fork="true" failonerror="true"> |
1 | fvelez | 156 | <src path="${src.dir}"/> |
157 | <src path="${gen.dir.java}"/> |
||
158 | <classpath refid="pathToToolsLib"/> |
||
159 | </javac> |
||
160 | </target> |
||
161 | <target name="compileToolFiles" description="Compile Mappings Builder"> |
||
162 | <javac destdir="${build.dir.classes}" srcdir="${src.dir}" debug="true" optimize="true" deprecation="true" verbose="true" failonerror="true"> |
||
163 | <include name="${mapping.buider.class.file}"/> |
||
219 | jmachado | 164 | <include name="${scripts.buider.class.file}"/> |
1 | fvelez | 165 | <classpath refid="pathToToolsLib"/> |
166 | </javac> |
||
167 | </target> |
||
168 | |||
169 | <!-- |
||
170 | Build distribution files |
||
171 | --> |
||
172 | <target name="dist" depends="build"> |
||
173 | <jar jarfile="${dist.dir}/estgweb.jar"> |
||
174 | <fileset dir="${build.dir.classes}" includes="**/*.class"/> |
||
175 | </jar> |
||
176 | <copy overwrite="true" todir="${dist.dir}"> |
||
177 | <fileset dir="${build.dir.classes}" includes="**/*.properties"/> |
||
178 | <fileset dir="${build.dir.classes}" includes="**/*.xml"/> |
||
244 | jmachado | 179 | <fileset dir="${build.dir.classes}" includes="**/*.xsd"/> |
180 | <fileset dir="${build.dir.classes}" includes="**/*.xsl"/> |
||
1 | fvelez | 181 | </copy> |
182 | <copy overwrite="true" todir="${dist.dir}" file="${conf.dir}/tomcat/estgweb.xml"/> |
||
183 | <replace file="${dist.dir}/estgweb.xml" value=""> |
||
184 | <replacefilter token="@build.dir.war@" value="${basedir}${file.separator}build${file.separator}ant${file.separator}war${file.separator}"/> |
||
185 | <replacefilter token="@context.path@" value="${tomcat.context.path}"/> |
||
186 | </replace> |
||
187 | </target> |
||
188 | |||
7 | jmachado | 189 | <target name="copy.jsps.war" description="copy only jsps to war distribution"> |
1 | fvelez | 190 | <copy todir="${build.dir.war}" overwrite="false"> |
191 | <fileset dir="src/web"> |
||
192 | <include name="**/*"/> |
||
193 | </fileset> |
||
194 | </copy> |
||
165 | jmachado | 195 | <replace file="${build.dir.war}/css/style.css"> |
196 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
197 | </replace> |
||
198 | <replace file="${build.dir.war}/css/intranet.css"> |
||
199 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
200 | </replace> |
||
201 | <replace file="${build.dir.war}/js/ajax.js"> |
||
202 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
203 | </replace> |
||
1 | fvelez | 204 | </target> |
205 | |||
291 | jmachado | 206 | <target name="build.war" depends="dist" description="Make war distribution"> |
1 | fvelez | 207 | <mkdir dir="${build.dir.war}"/> |
208 | <mkdir dir="${build.dir.war}/WEB-INF"/> |
||
209 | <mkdir dir="${build.dir.war}/WEB-INF/lib"/> |
||
210 | <copy todir="${build.dir.war}/WEB-INF/lib"> |
||
211 | <fileset dir="${common.lib.dir}/log4j"> |
||
212 | <include name="*.jar"/> |
||
213 | </fileset> |
||
214 | <fileset dir="${common.lib.dir}/berserk"> |
||
215 | <include name="**/*.jar"/> |
||
216 | </fileset> |
||
217 | <fileset dir="${common.lib.dir}/hibernate"> |
||
218 | <include name="**/*.jar"/> |
||
219 | </fileset> |
||
220 | <fileset dir="${common.lib.dir}/log4j"> |
||
221 | <include name="**/*.jar"/> |
||
222 | </fileset> |
||
223 | <fileset dir="${common.lib.dir}/mysql"> |
||
224 | <include name="**/*.jar"/> |
||
225 | </fileset> |
||
226 | <fileset dir="${common.lib.dir}/commons"> |
||
227 | <include name="**/*.jar"/> |
||
228 | </fileset> |
||
229 | <fileset dir="${common.lib.dir}/struts"> |
||
230 | <include name="**/*.jar"/> |
||
231 | </fileset> |
||
10 | jmachado | 232 | <fileset dir="${common.lib.dir}/ldap"> |
233 | <include name="**/*.jar"/> |
||
234 | </fileset> |
||
29 | jmachado | 235 | <fileset dir="${common.lib.dir}/mail"> |
236 | <include name="**/*.jar"/> |
||
237 | </fileset> |
||
18 | jmachado | 238 | <fileset dir="${common.lib.dir}/jfreechart"> |
239 | <include name="**/*.jar"/> |
||
240 | </fileset> |
||
99 | jmachado | 241 | <fileset dir="${common.lib.dir}/lucene"> |
92 | jmachado | 242 | <include name="**/*.jar"/> |
243 | </fileset> |
||
186 | fvelez | 244 | <fileset dir="${common.lib.dir}/jaxrpc"> |
104 | jmachado | 245 | <include name="**/*.jar"/> |
186 | fvelez | 246 | </fileset> |
244 | jmachado | 247 | <fileset dir="${common.lib.dir}/saxon"> |
248 | <include name="**/*.jar"/> |
||
249 | </fileset> |
||
1 | fvelez | 250 | </copy> |
251 | <copy file="${dist.dir}/estgweb.jar" todir="${build.dir.war}/WEB-INF/lib"/> |
||
252 | <copy todir="${build.dir.war}/WEB-INF" overwrite="true"> |
||
253 | <fileset dir="${conf.dir}/WEB-INF"> |
||
254 | <include name="**/*.*"/> |
||
255 | </fileset> |
||
256 | </copy> |
||
257 | <mkdir dir="${build.dir.war}/WEB-INF/classes"/> |
||
258 | <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="true"> |
||
259 | <fileset dir="${build.dir.classes}"> |
||
18 | jmachado | 260 | <include name="**/*.types"/> |
1 | fvelez | 261 | <include name="**/*.properties"/> |
29 | jmachado | 262 | <include name="**/*.txt"/> |
1 | fvelez | 263 | <include name="**/*.xml"/> |
214 | jmachado | 264 | <include name="**/*.exe"/> |
248 | jmachado | 265 | <include name="**/*.xsl"/> |
266 | <include name="**/*.xsd"/> |
||
1 | fvelez | 267 | </fileset> |
268 | </copy> |
||
269 | <copy todir="${build.dir.war}" overwrite="true"> |
||
270 | <fileset dir="src/web"> |
||
271 | <include name="**/*"/> |
||
272 | </fileset> |
||
273 | </copy> |
||
48 | fvelez | 274 | <replace file="${build.dir.war}/js/ajax.js"> |
165 | jmachado | 275 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
48 | fvelez | 276 | </replace> |
165 | jmachado | 277 | <replace file="${build.dir.war}/css/style.css"> |
278 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
279 | </replace> |
||
280 | <replace file="${build.dir.war}/css/intranet.css"> |
||
281 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
282 | </replace> |
||
283 | |||
1 | fvelez | 284 | </target> |
285 | |||
286 | <target name="war" depends="build.war"> |
||
287 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
288 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
289 | <fileset dir="${build.dir.war}"> |
||
290 | <include name="**/*" /> |
||
291 | </fileset> |
||
292 | </jar> |
||
293 | </target> |
||
294 | |||
295 | |||
296 | <!-- |
||
297 | ========================================================================================== |
||
298 | Generate Configuration Files TASKS |
||
299 | ========================================================================================== |
||
300 | --> |
||
229 | jmachado | 301 | <target name="createConfigurationFiles" depends="compileToolFiles,copyConfigurationFiles,replaceFiltersConfigurationFiles,generateHibernateCfgXml"/> |
1 | fvelez | 302 | |
303 | <target name="copyConfigurationFiles"> |
||
304 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
305 | <fileset dir="${hbm.dir}" includes="**/*.hbm.xml"/> |
||
306 | </copy> |
||
244 | jmachado | 307 | <mkdir dir="${build.dir.classes}/template/xsd"/> |
308 | <copy todir="${build.dir.classes}/template/xsd" overwrite="true"> |
||
309 | <fileset dir="${src.xsd}"> |
||
310 | <include name="**/*.xsl"/> |
||
311 | <include name="**/*.xsd"/> |
||
312 | </fileset> |
||
313 | </copy> |
||
1 | fvelez | 314 | <copy overwrite="true" todir="${build.dir.classes}"> |
315 | <fileset dir="${src.dir}" includes="**/*.xsl"/> |
||
316 | </copy> |
||
317 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
318 | <fileset dir="${conf.dir}/berserk" includes="*.*"/> |
||
319 | </copy> |
||
29 | jmachado | 320 | <mkdir dir="${email.templates.dir.build}"/> |
321 | <copy overwrite="true" todir="${email.templates.dir.build}"> |
||
322 | <fileset dir="${email.templates.dir.conf}" includes="*.*"/> |
||
323 | </copy> |
||
227 | jmachado | 324 | <mkdir dir="${sms.templates.dir.build}"/> |
325 | <copy overwrite="true" todir="${sms.templates.dir.build}"> |
||
326 | <fileset dir="${sms.templates.dir.conf}" includes="*.*"/> |
||
327 | </copy> |
||
215 | jmachado | 328 | <mkdir dir="${assignement.templates.dir.build}"/> |
329 | <copy overwrite="true" todir="${assignement.templates.dir.build}"> |
||
330 | <fileset dir="${assignement.templates.dir.conf}" includes="*.*"/> |
||
331 | </copy> |
||
1 | fvelez | 332 | <copy overwrite="true" todir="${hibernate.cfg.xml.build}" file="${hibernate.cfg.xml}"/> |
18 | jmachado | 333 | <copy overwrite="true" todir="${mime.types.build}" file="${mime.types}"/> |
1 | fvelez | 334 | <copy overwrite="true" todir="${app.properties.build}" file="${app.properties}"/> |
335 | <copy overwrite="true" todir="${jdbc.properties.build}" file="${jdbc.properties}"/> |
||
336 | <copy overwrite="true" todir="${ldap.properties.build}" file="${ldap.properties}"/> |
||
337 | <copy overwrite="true" todir="${build.dir.classes}" file="${log4j.properties}"/> |
||
214 | jmachado | 338 | <mkdir dir="${build.dir.intranet.setup.folders.file}"/> |
339 | <copy overwrite="true" todir="${build.dir.intranet.setup.folders.file}" file="${intranet.setup.folders.file.src}"/> |
||
219 | jmachado | 340 | |
347 | jmachado | 341 | <!--<java classname="${scripts.buider.class}" classpath="${build.dir.classes}">--> |
342 | <!--<arg value="${basedir}${file.separator}..${file.separator}common"/>--> |
||
343 | <!--<arg value="${basedir}${file.separator}build${file.separator}ant${file.separator}classes"/>--> |
||
344 | <!--<arg value="${build.dir.scripts}"/>--> |
||
345 | <!--<arg value="${scripts.target.libs.file}"/>--> |
||
346 | <!--</java>--> |
||
347 | <!--<copy overwrite="true" todir="${build.dir.scripts}">--> |
||
348 | <!--<fileset dir="${src.scripts}" includes="*.*"/>--> |
||
349 | <!--</copy>--> |
||
244 | jmachado | 350 | |
1 | fvelez | 351 | </target> |
352 | |||
353 | <target name="replaceFiltersConfigurationFiles"> |
||
354 | <delete file="${build.dir.classes}/MessageResources.properties"/> |
||
355 | <concat encoding="ISO-8859-1" destfile="${build.dir.classes}/MessageResources.properties" append="true"> |
||
356 | <fileset dir="${conf.dir}/language"> |
||
357 | <include name="*.properties" /> |
||
358 | </fileset> |
||
359 | </concat> |
||
360 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
||
361 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
362 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
363 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
364 | </replace> |
||
365 | <replace file="${hibernate.cfg.xml.build}/${hibernate.cfg.xml.filename}"> |
||
366 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
367 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
368 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
369 | <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/> |
||
370 | </replace> |
||
371 | <replace file="${app.properties.build}/app.properties"> |
||
372 | <replacefilter token="@tmp.dir@" value="${tmp.dir}"/> |
||
187 | jmachado | 373 | <replacefilter token="@data.dir@" value="${data.dir}"/> |
1 | fvelez | 374 | <replacefilter token="@out.dir@" value="${out.dir}"/> |
29 | jmachado | 375 | <replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/> |
79 | jmachado | 376 | <replacefilter token="@use.ldap@" value="${use.ldap}"/> |
146 | jmachado | 377 | <replacefilter token="@site.url@" value="${site.url}"/> |
163 | jmachado | 378 | <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/> |
379 | <replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/> |
||
214 | jmachado | 380 | <replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/> |
381 | <replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/> |
||
1 | fvelez | 382 | </replace> |
383 | <replace file="${build.dir.classes}/${log4j.properties.filename}"> |
||
384 | <replacefilter token="@log.file@" value="${log.file}"/> |
||
299 | jmachado | 385 | <replacefilter token="@log.level@" value="${log.level}"/> |
1 | fvelez | 386 | </replace> |
352 | jmachado | 387 | <!--<replace file="${build.dir.scripts}/${scripts.setenv.file}"> |
219 | jmachado | 388 | <replacefilter token="@tomcat.home@" value="${tomcat.home}"/> |
352 | jmachado | 389 | </replace>--> |
1 | fvelez | 390 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
391 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
392 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
393 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
394 | </replace> |
||
395 | </target> |
||
396 | <target name="generateHibernateCfgXml" depends="compileToolFiles"> |
||
397 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
||
398 | <java classname="${mapping.buider.class}" classpath="${build.dir.classes}"> |
||
399 | <arg value="${hibernate.cfg.xml.build}"/> |
||
400 | <arg value="${hibernate.cfg.xml}"/> |
||
401 | <arg value="${package.dir}"/> |
||
402 | </java> |
||
403 | <antcall target="replaceFiltersConfigurationFiles"/> |
||
404 | </target> |
||
405 | <target name="dbInit"> |
||
7 | jmachado | 406 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
407 | <java classname="pt.estgp.estgweb.examples.DBInit" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
1 | fvelez | 408 | |
7 | jmachado | 409 | <antcall target="replaceFiltersConfigurationFiles"/> |
410 | </target> |
||
1 | fvelez | 411 | |
412 | |||
7 | jmachado | 413 | |
1 | fvelez | 414 | <!-- |
415 | Hibernate Tools Task |
||
416 | --> |
||
7 | jmachado | 417 | <taskdef name="hibernatetool" |
418 | classname="org.hibernate.tool.ant.HibernateToolTask" |
||
419 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
1 | fvelez | 420 | <!-- |
421 | ========================================================================================== |
||
422 | GENERATE SQL SCRIPTS |
||
423 | ========================================================================================== |
||
424 | --> |
||
425 | <taskdef name="schemaexport" |
||
426 | classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" |
||
427 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
428 | |||
429 | |||
215 | jmachado | 430 | <target name="generateHibernateSql" depends="build"> |
1 | fvelez | 431 | <schemaexport |
432 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
433 | quiet="no" |
||
434 | text="no" |
||
435 | drop="no" |
||
436 | delimiter=";" |
||
437 | output="${build.dir.classes}/app-scripts.sql"> |
||
438 | <fileset dir="${hbm.dir}"> |
||
439 | <include name="**/*.hbm.xml"/> |
||
440 | </fileset> |
||
441 | </schemaexport> |
||
442 | </target> |
||
443 | |||
444 | <target name="generateHibernateDomainObjects"> |
||
445 | <hibernatetool> |
||
446 | <configuration> |
||
447 | <fileset dir="${hbm.dir}"> |
||
448 | <include name="**/*.hbm.xml"/> |
||
449 | </fileset> |
||
450 | </configuration> |
||
451 | <hbm2java |
||
452 | jdk5="true" |
||
453 | ejb3="false" |
||
454 | destdir="${gen.dir.java}"/> |
||
455 | </hibernatetool> |
||
456 | <delete> |
||
457 | <fileset dir="${gen.dir.java}"> |
||
458 | <include name="**/*Impl.java"/> |
||
459 | </fileset> |
||
460 | </delete> |
||
461 | </target> |
||
462 | |||
463 | |||
464 | <!-- |
||
465 | ========================================================================================== |
||
466 | GENERATE DAO IMPLEMENTATION |
||
467 | ========================================================================================== |
||
468 | --> |
||
469 | <target name="generateHibernateDaoClasses"> |
||
470 | <hibernatetool destdir="${gen.dir.java}" > |
||
471 | <configuration> |
||
472 | <fileset dir="${hbm.dir}"> |
||
473 | <include name="**/*.hbm.xml"/> |
||
474 | </fileset> |
||
475 | </configuration> |
||
476 | <hbmtemplate |
||
477 | filepattern="{class-name}${dao.file.pattern}.java" |
||
478 | templatepath="${dao.template.dir}" |
||
479 | template="${dao.impl.template}" |
||
480 | destdir="${dao.impl.package.dir}"> |
||
481 | <property key="jdk5" value="true"/> |
||
482 | <property key="ejb3" value="false"/> |
||
483 | <property key="dao" value="${dao.file.pattern}"/> |
||
484 | <property key="daoDomainPackage" value="${domain.package}"/> |
||
485 | <property key="daoInterfacesPackage" value="${dao.interfaces.package}"/> |
||
486 | <property key="daoImplPackage" value="${dao.impl.package}"/> |
||
487 | </hbmtemplate> |
||
488 | </hibernatetool> |
||
489 | <delete> |
||
490 | <fileset dir="${gen.dir.java}"> |
||
491 | <include name="**/*ImplDao.java"/> |
||
492 | </fileset> |
||
493 | </delete> |
||
494 | </target> |
||
495 | |||
496 | |||
497 | |||
498 | <!-- |
||
499 | Run Deamon |
||
500 | --> |
||
501 | |||
502 | <!--<target name="run">--> |
||
503 | <!--<java classname="mitra.oaiharvest.harvest.HarvestEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
504 | <!--<java classname="mitra.oaiharvest.index.IndexEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
505 | <!--</target>--> |
||
336 | jmachado | 506 | <target name="util.task.createRepositoryXML"> |
507 | <java classname="pt.estgp.estgweb.services.data.CreateDescriptionsXML" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
508 | </target> |
||
1 | fvelez | 509 | |
336 | jmachado | 510 | |
273 | jmachado | 511 | </project> |