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