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