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