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