Rev 995 | Rev 1029 | 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"/> |
||
995 | jmachado | 223 | <exclude name="xerces-2.6.2.jar"/> |
1 | fvelez | 224 | </fileset> |
225 | <fileset dir="${common.lib.dir}/log4j"> |
||
226 | <include name="**/*.jar"/> |
||
227 | </fileset> |
||
228 | <fileset dir="${common.lib.dir}/mysql"> |
||
229 | <include name="**/*.jar"/> |
||
230 | </fileset> |
||
231 | <fileset dir="${common.lib.dir}/commons"> |
||
232 | <include name="**/*.jar"/> |
||
233 | </fileset> |
||
234 | <fileset dir="${common.lib.dir}/struts"> |
||
235 | <include name="**/*.jar"/> |
||
236 | </fileset> |
||
10 | jmachado | 237 | <fileset dir="${common.lib.dir}/ldap"> |
238 | <include name="**/*.jar"/> |
||
239 | </fileset> |
||
29 | jmachado | 240 | <fileset dir="${common.lib.dir}/mail"> |
241 | <include name="**/*.jar"/> |
||
242 | </fileset> |
||
18 | jmachado | 243 | <fileset dir="${common.lib.dir}/jfreechart"> |
244 | <include name="**/*.jar"/> |
||
245 | </fileset> |
||
99 | jmachado | 246 | <fileset dir="${common.lib.dir}/lucene"> |
92 | jmachado | 247 | <include name="**/*.jar"/> |
248 | </fileset> |
||
995 | jmachado | 249 | <fileset dir="${common.lib.dir}/jaxrpc"> |
104 | jmachado | 250 | <include name="**/*.jar"/> |
186 | fvelez | 251 | </fileset> |
244 | jmachado | 252 | <fileset dir="${common.lib.dir}/saxon"> |
253 | <include name="**/*.jar"/> |
||
254 | </fileset> |
||
726 | jmachado | 255 | <fileset dir="${common.lib.dir}/fop"> |
256 | <include name="**/*.jar"/> |
||
257 | </fileset> |
||
808 | jmachado | 258 | <fileset dir="${common.lib.dir}/itextpdf"> |
259 | <include name="**/*.jar"/> |
||
260 | </fileset> |
||
995 | jmachado | 261 | <fileset dir="${common.lib.dir}/json"> |
262 | <include name="**/*.jar"/> |
||
263 | </fileset> |
||
1 | fvelez | 264 | </copy> |
265 | <copy file="${dist.dir}/estgweb.jar" todir="${build.dir.war}/WEB-INF/lib"/> |
||
266 | <copy todir="${build.dir.war}/WEB-INF" overwrite="true"> |
||
267 | <fileset dir="${conf.dir}/WEB-INF"> |
||
268 | <include name="**/*.*"/> |
||
269 | </fileset> |
||
270 | </copy> |
||
271 | <mkdir dir="${build.dir.war}/WEB-INF/classes"/> |
||
272 | <copy todir="${build.dir.war}/WEB-INF/classes" overwrite="true"> |
||
273 | <fileset dir="${build.dir.classes}"> |
||
18 | jmachado | 274 | <include name="**/*.types"/> |
1 | fvelez | 275 | <include name="**/*.properties"/> |
29 | jmachado | 276 | <include name="**/*.txt"/> |
1 | fvelez | 277 | <include name="**/*.xml"/> |
730 | jmachado | 278 | <include name="**/*.gif"/> |
214 | jmachado | 279 | <include name="**/*.exe"/> |
248 | jmachado | 280 | <include name="**/*.xsl"/> |
281 | <include name="**/*.xsd"/> |
||
1 | fvelez | 282 | </fileset> |
283 | </copy> |
||
284 | <copy todir="${build.dir.war}" overwrite="true"> |
||
285 | <fileset dir="src/web"> |
||
286 | <include name="**/*"/> |
||
287 | </fileset> |
||
288 | </copy> |
||
48 | fvelez | 289 | <replace file="${build.dir.war}/js/ajax.js"> |
165 | jmachado | 290 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
48 | fvelez | 291 | </replace> |
165 | jmachado | 292 | <replace file="${build.dir.war}/css/style.css"> |
293 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
294 | </replace> |
||
295 | <replace file="${build.dir.war}/css/intranet.css"> |
||
296 | <replacefilter token="@contextPath@" value="${tomcat.context.path}"/> |
||
297 | </replace> |
||
385 | jmachado | 298 | </target> |
165 | jmachado | 299 | |
385 | jmachado | 300 | <target name="jasper" depends="copy.jsps.war"> |
301 | <delete dir="${build.dir.jsp}"/> |
||
302 | <mkdir dir="${build.dir.jsp}"/> |
||
303 | <tomcat.jasper validateXml="false" uriroot="${build.dir.war}" webXmlFragment="${build.dir.war}/WEB-INF/generated_web.xml" addWebXmlMappings="true" outputDir="${build.dir.jsp}" /> |
||
304 | <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"> |
||
305 | <src path="${build.dir.jsp}"/> |
||
306 | <classpath path="${build.dir.classes}"/> |
||
307 | <classpath refid="pathToToolsLib"/> |
||
308 | </javac> |
||
309 | <delete> |
||
310 | <fileset dir="${build.dir.war}"> |
||
311 | <include name="**/*.jsp"/> |
||
312 | </fileset> |
||
313 | </delete> |
||
1 | fvelez | 314 | </target> |
315 | |||
316 | <target name="war" depends="build.war"> |
||
317 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
318 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
319 | <fileset dir="${build.dir.war}"> |
||
320 | <include name="**/*" /> |
||
321 | </fileset> |
||
322 | </jar> |
||
323 | </target> |
||
324 | |||
385 | jmachado | 325 | <target name="war.jasper" depends="build.war,jasper"> |
326 | <delete file="${dist.dir}/${tomcat.war.file}"/> |
||
327 | <jar destfile="${dist.dir}/${tomcat.war.file}"> |
||
328 | <fileset dir="${build.dir.war}"> |
||
329 | <include name="**/*" /> |
||
330 | </fileset> |
||
331 | </jar> |
||
332 | </target> |
||
1 | fvelez | 333 | |
385 | jmachado | 334 | |
1 | fvelez | 335 | <!-- |
336 | ========================================================================================== |
||
337 | Generate Configuration Files TASKS |
||
338 | ========================================================================================== |
||
339 | --> |
||
229 | jmachado | 340 | <target name="createConfigurationFiles" depends="compileToolFiles,copyConfigurationFiles,replaceFiltersConfigurationFiles,generateHibernateCfgXml"/> |
1 | fvelez | 341 | |
342 | <target name="copyConfigurationFiles"> |
||
343 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
344 | <fileset dir="${hbm.dir}" includes="**/*.hbm.xml"/> |
||
345 | </copy> |
||
244 | jmachado | 346 | <mkdir dir="${build.dir.classes}/template/xsd"/> |
347 | <copy todir="${build.dir.classes}/template/xsd" overwrite="true"> |
||
348 | <fileset dir="${src.xsd}"> |
||
349 | <include name="**/*.xsl"/> |
||
350 | <include name="**/*.xsd"/> |
||
351 | </fileset> |
||
352 | </copy> |
||
1 | fvelez | 353 | <copy overwrite="true" todir="${build.dir.classes}"> |
354 | <fileset dir="${src.dir}" includes="**/*.xsl"/> |
||
355 | </copy> |
||
356 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
730 | jmachado | 357 | <fileset dir="${src.dir}" includes="**/*.gif"/> |
358 | </copy> |
||
359 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
381 | jmachado | 360 | <fileset dir="${src.dir}" includes="**/*.csv"/> |
361 | </copy> |
||
362 | <copy overwrite="true" todir="${build.dir.classes}"> |
||
1 | fvelez | 363 | <fileset dir="${conf.dir}/berserk" includes="*.*"/> |
364 | </copy> |
||
29 | jmachado | 365 | <mkdir dir="${email.templates.dir.build}"/> |
366 | <copy overwrite="true" todir="${email.templates.dir.build}"> |
||
367 | <fileset dir="${email.templates.dir.conf}" includes="*.*"/> |
||
368 | </copy> |
||
227 | jmachado | 369 | <mkdir dir="${sms.templates.dir.build}"/> |
370 | <copy overwrite="true" todir="${sms.templates.dir.build}"> |
||
371 | <fileset dir="${sms.templates.dir.conf}" includes="*.*"/> |
||
372 | </copy> |
||
215 | jmachado | 373 | <mkdir dir="${assignement.templates.dir.build}"/> |
374 | <copy overwrite="true" todir="${assignement.templates.dir.build}"> |
||
375 | <fileset dir="${assignement.templates.dir.conf}" includes="*.*"/> |
||
376 | </copy> |
||
1 | fvelez | 377 | <copy overwrite="true" todir="${hibernate.cfg.xml.build}" file="${hibernate.cfg.xml}"/> |
18 | jmachado | 378 | <copy overwrite="true" todir="${mime.types.build}" file="${mime.types}"/> |
1 | fvelez | 379 | <copy overwrite="true" todir="${app.properties.build}" file="${app.properties}"/> |
380 | <copy overwrite="true" todir="${jdbc.properties.build}" file="${jdbc.properties}"/> |
||
381 | <copy overwrite="true" todir="${ldap.properties.build}" file="${ldap.properties}"/> |
||
382 | <copy overwrite="true" todir="${build.dir.classes}" file="${log4j.properties}"/> |
||
214 | jmachado | 383 | <mkdir dir="${build.dir.intranet.setup.folders.file}"/> |
384 | <copy overwrite="true" todir="${build.dir.intranet.setup.folders.file}" file="${intranet.setup.folders.file.src}"/> |
||
219 | jmachado | 385 | |
368 | jmachado | 386 | <mkdir dir="${build.dir.classes}/pt/estgp/estgweb/directories"/> |
387 | <copy overwrite="true" todir="${build.dir.classes}/pt/estgp/estgweb/directories"> |
||
388 | <fileset dir="${conf.dir}/directories" includes="*.*"/> |
||
389 | </copy> |
||
347 | jmachado | 390 | <!--<java classname="${scripts.buider.class}" classpath="${build.dir.classes}">--> |
391 | <!--<arg value="${basedir}${file.separator}..${file.separator}common"/>--> |
||
392 | <!--<arg value="${basedir}${file.separator}build${file.separator}ant${file.separator}classes"/>--> |
||
393 | <!--<arg value="${build.dir.scripts}"/>--> |
||
394 | <!--<arg value="${scripts.target.libs.file}"/>--> |
||
395 | <!--</java>--> |
||
396 | <!--<copy overwrite="true" todir="${build.dir.scripts}">--> |
||
397 | <!--<fileset dir="${src.scripts}" includes="*.*"/>--> |
||
398 | <!--</copy>--> |
||
244 | jmachado | 399 | |
1 | fvelez | 400 | </target> |
401 | |||
402 | <target name="replaceFiltersConfigurationFiles"> |
||
403 | <delete file="${build.dir.classes}/MessageResources.properties"/> |
||
404 | <concat encoding="ISO-8859-1" destfile="${build.dir.classes}/MessageResources.properties" append="true"> |
||
405 | <fileset dir="${conf.dir}/language"> |
||
406 | <include name="*.properties" /> |
||
407 | </fileset> |
||
408 | </concat> |
||
409 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
||
410 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
411 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
412 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
413 | </replace> |
||
414 | <replace file="${hibernate.cfg.xml.build}/${hibernate.cfg.xml.filename}"> |
||
415 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
416 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
417 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
418 | <replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/> |
||
419 | </replace> |
||
420 | <replace file="${app.properties.build}/app.properties"> |
||
421 | <replacefilter token="@tmp.dir@" value="${tmp.dir}"/> |
||
187 | jmachado | 422 | <replacefilter token="@data.dir@" value="${data.dir}"/> |
1 | fvelez | 423 | <replacefilter token="@out.dir@" value="${out.dir}"/> |
29 | jmachado | 424 | <replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/> |
79 | jmachado | 425 | <replacefilter token="@use.ldap@" value="${use.ldap}"/> |
146 | jmachado | 426 | <replacefilter token="@site.url@" value="${site.url}"/> |
1017 | jmachado | 427 | <!-- DONT USE ANY MORE NOW IS IN CONFIGURATION DAO <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/>--> |
163 | jmachado | 428 | <replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/> |
214 | jmachado | 429 | <replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/> |
430 | <replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/> |
||
1 | fvelez | 431 | </replace> |
432 | <replace file="${build.dir.classes}/${log4j.properties.filename}"> |
||
433 | <replacefilter token="@log.file@" value="${log.file}"/> |
||
299 | jmachado | 434 | <replacefilter token="@log.level@" value="${log.level}"/> |
1 | fvelez | 435 | </replace> |
352 | jmachado | 436 | <!--<replace file="${build.dir.scripts}/${scripts.setenv.file}"> |
219 | jmachado | 437 | <replacefilter token="@tomcat.home@" value="${tomcat.home}"/> |
352 | jmachado | 438 | </replace>--> |
1 | fvelez | 439 | <replace file="${jdbc.properties.build}/${jdbc.properties.filename}"> |
440 | <replacefilter token="@database.username@" value="${database.username}"/> |
||
441 | <replacefilter token="@database.password@" value="${database.password}"/> |
||
442 | <replacefilter token="@database.connection.url@" value="${database.connection.url}"/> |
||
443 | </replace> |
||
444 | </target> |
||
445 | <target name="generateHibernateCfgXml" depends="compileToolFiles"> |
||
446 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
||
447 | <java classname="${mapping.buider.class}" classpath="${build.dir.classes}"> |
||
448 | <arg value="${hibernate.cfg.xml.build}"/> |
||
449 | <arg value="${hibernate.cfg.xml}"/> |
||
450 | <arg value="${package.dir}"/> |
||
451 | </java> |
||
452 | <antcall target="replaceFiltersConfigurationFiles"/> |
||
453 | </target> |
||
454 | <target name="dbInit"> |
||
7 | jmachado | 455 | <!--<delete file="${build.dir.classes}/${hibernate.cfg.xml.filename}"/>--> |
456 | <java classname="pt.estgp.estgweb.examples.DBInit" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
1 | fvelez | 457 | |
7 | jmachado | 458 | <antcall target="replaceFiltersConfigurationFiles"/> |
459 | </target> |
||
1 | fvelez | 460 | |
461 | |||
7 | jmachado | 462 | |
1 | fvelez | 463 | <!-- |
464 | Hibernate Tools Task |
||
465 | --> |
||
7 | jmachado | 466 | <taskdef name="hibernatetool" |
467 | classname="org.hibernate.tool.ant.HibernateToolTask" |
||
468 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
1 | fvelez | 469 | <!-- |
470 | ========================================================================================== |
||
471 | GENERATE SQL SCRIPTS |
||
472 | ========================================================================================== |
||
473 | --> |
||
474 | <taskdef name="schemaexport" |
||
475 | classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" |
||
476 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
477 | |||
478 | |||
215 | jmachado | 479 | <target name="generateHibernateSql" depends="build"> |
1 | fvelez | 480 | <schemaexport |
481 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
482 | quiet="no" |
||
483 | text="no" |
||
484 | drop="no" |
||
485 | delimiter=";" |
||
486 | output="${build.dir.classes}/app-scripts.sql"> |
||
487 | <fileset dir="${hbm.dir}"> |
||
488 | <include name="**/*.hbm.xml"/> |
||
489 | </fileset> |
||
490 | </schemaexport> |
||
491 | </target> |
||
492 | |||
852 | jmachado | 493 | <target name="generateUpdateHibernateSql" depends="build"> |
494 | <taskdef name="schemaupdate" |
||
495 | classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask" |
||
496 | classpathref="pathToToolsLib" classpath="${build.dir.classes}"/> |
||
497 | |||
498 | <schemaupdate |
||
499 | properties="${jdbc.properties.build}/${jdbc.properties.filename}" |
||
500 | quiet="no" |
||
501 | text="no"> |
||
502 | <fileset dir="${hbm.dir}"> |
||
503 | <include name="**/*.hbm.xml"/> |
||
504 | </fileset> |
||
505 | </schemaupdate> |
||
506 | </target> |
||
507 | |||
1 | fvelez | 508 | <target name="generateHibernateDomainObjects"> |
691 | jmachado | 509 | <replace dir="${hbm.dir}" value=""> |
510 | <include name="**/*.hbm.xml"/> |
||
511 | <replacefilter token='<timestamp source="db"' value="<timestamp"/> |
||
512 | </replace> |
||
1 | fvelez | 513 | <hibernatetool> |
514 | <configuration> |
||
515 | <fileset dir="${hbm.dir}"> |
||
516 | <include name="**/*.hbm.xml"/> |
||
517 | </fileset> |
||
518 | </configuration> |
||
519 | <hbm2java |
||
520 | jdk5="true" |
||
521 | ejb3="false" |
||
522 | destdir="${gen.dir.java}"/> |
||
523 | </hibernatetool> |
||
524 | <delete> |
||
525 | <fileset dir="${gen.dir.java}"> |
||
526 | <include name="**/*Impl.java"/> |
||
527 | </fileset> |
||
528 | </delete> |
||
691 | jmachado | 529 | <replace dir="${hbm.dir}" value=""> |
530 | <include name="**/*.hbm.xml"/> |
||
531 | <replacefilter token='<timestamp' value='<timestamp source="db"'/> |
||
532 | </replace> |
||
1 | fvelez | 533 | </target> |
534 | |||
535 | |||
536 | <!-- |
||
537 | ========================================================================================== |
||
538 | GENERATE DAO IMPLEMENTATION |
||
539 | ========================================================================================== |
||
540 | --> |
||
541 | <target name="generateHibernateDaoClasses"> |
||
542 | <hibernatetool destdir="${gen.dir.java}" > |
||
543 | <configuration> |
||
544 | <fileset dir="${hbm.dir}"> |
||
545 | <include name="**/*.hbm.xml"/> |
||
546 | </fileset> |
||
547 | </configuration> |
||
548 | <hbmtemplate |
||
549 | filepattern="{class-name}${dao.file.pattern}.java" |
||
550 | templatepath="${dao.template.dir}" |
||
551 | template="${dao.impl.template}" |
||
552 | destdir="${dao.impl.package.dir}"> |
||
553 | <property key="jdk5" value="true"/> |
||
554 | <property key="ejb3" value="false"/> |
||
555 | <property key="dao" value="${dao.file.pattern}"/> |
||
556 | <property key="daoDomainPackage" value="${domain.package}"/> |
||
557 | <property key="daoInterfacesPackage" value="${dao.interfaces.package}"/> |
||
558 | <property key="daoImplPackage" value="${dao.impl.package}"/> |
||
559 | </hbmtemplate> |
||
560 | </hibernatetool> |
||
561 | <delete> |
||
562 | <fileset dir="${gen.dir.java}"> |
||
563 | <include name="**/*ImplDao.java"/> |
||
564 | </fileset> |
||
565 | </delete> |
||
566 | </target> |
||
567 | |||
568 | |||
995 | jmachado | 569 | <!-- |
570 | ========================================================================================== |
||
571 | GENERATE WEBSERVICES JAXWS |
||
572 | ========================================================================================== |
||
573 | --> |
||
1 | fvelez | 574 | |
995 | jmachado | 575 | |
576 | |||
577 | |||
578 | <target name="ws.generate-siges-client" depends="initDirs"> |
||
579 | <taskdef name="wsimport2" classname="com.sun.tools.ws.ant.WsImport" |
||
580 | classpathref="pathToToolsLib"> |
||
581 | </taskdef> |
||
582 | <copy file="${ws.client.binding.dir}/${ws.siges.binding.file}" todir="${build.dir.ws}" overwrite="true"/> |
||
583 | <replace file="${build.dir.ws}/${ws.siges.binding.file}" encoding="UTF-8"> |
||
584 | <replacefilter token="@wsdl.client@" value="${ws.siges.wsdl}"/> |
||
585 | <replacefilter token="@target.namespace@" value="${ws.siges.target.namespace}"/> |
||
586 | <replacefilter token="@ws.package@" value="${ws.siges.package}"/> |
||
587 | </replace> |
||
588 | <!--xendorsed="true"--> |
||
589 | <wsimport2 |
||
590 | |||
591 | debug="${ws.debug}" |
||
592 | verbose="${ws.verbose}" |
||
593 | keep="${ws.keep}" |
||
594 | extension="${ws.extension}" |
||
595 | destdir="${gen.dir.java}" |
||
596 | wsdl="${ws.siges.wsdl}"> |
||
597 | <binding dir="${build.dir.ws}" includes="${ws.client.binding.file}"/> |
||
598 | </wsimport2> |
||
599 | <delete> |
||
600 | <fileset dir="${gen.dir.java}"> |
||
601 | <include name="**/*.class"/> |
||
602 | </fileset> |
||
603 | </delete> |
||
604 | </target> |
||
605 | |||
606 | |||
1 | fvelez | 607 | <!-- |
995 | jmachado | 608 | ========================================================================================== |
609 | DEAMONS |
||
610 | ========================================================================================== |
||
1 | fvelez | 611 | --> |
612 | |||
995 | jmachado | 613 | |
1 | fvelez | 614 | <!--<target name="run">--> |
615 | <!--<java classname="mitra.oaiharvest.harvest.HarvestEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
616 | <!--<java classname="mitra.oaiharvest.index.IndexEngine" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>--> |
||
617 | <!--</target>--> |
||
336 | jmachado | 618 | <target name="util.task.createRepositoryXML"> |
619 | <java classname="pt.estgp.estgweb.services.data.CreateDescriptionsXML" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
620 | </target> |
||
359 | jmachado | 621 | <target name="util.task.reset.urlsstats"> |
622 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
623 | </target> |
||
438 | jmachado | 624 | <target name="util.task.reset.urlsstats.digests"> |
625 | <java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsServiceDigests" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
||
626 | </target> |
||
1 | fvelez | 627 | |
336 | jmachado | 628 | |
273 | jmachado | 629 | </project> |