source: trunk/ontoCAT/build.xml @ 471

Revision 471, 12.9 KB checked in by tadamusiak, 22 months ago (diff)

javac fix for the ant update on hudson TRY 2

Line 
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<project default="dist" name="ontocat" basedir=".">
3        <!-- set global properties for this build -->
4        <property name="test.reports" value="reports" />
5        <property name="version" value="0.9.8" />
6        <property name="copyright" value="Copyright © 2010 European Bioinformatics
7                Institute and University of Groningen. Released under LGPLv3." />
8
9        <!-- set class path -->
10        <path id="test.classpath">
11                <pathelement location="bin" />
12                <fileset dir="lib">
13                        <include name="**/*.jar" />
14                </fileset>
15        </path>
16        <!-- set junit test set -->
17        <fileset dir="bin">
18                <patternset id="test.sources">
19                        <include name="**/*Test.class" />
20                        <exclude name="**/special/*" />
21                </patternset>
22        </fileset>
23
24        <target name="javadoc">
25                <delete dir="doc" />
26                <mkdir dir="doc" />
27
28                <javadoc excludepackagenames="uk.ac.ebi.ontocat.examples.*,
29                                                                        uk.ac.ebi.ontocat.mediawiki.*,
30                                                                        uk.ac.ebi.ontocat.conceptwiki.*" sourcepath="src" access="public" destdir="doc" author="true" version="true" use="true" windowtitle="OntoCAT" doctitle="OntoCAT ${version} API Documentation" bottom="${copyright}" header="OntoCAT ${version}" footer="${copyright}">
31                        <classpath refid="test.classpath" />
32                </javadoc>
33
34        </target>
35
36        <target name="compile">
37                <javac includeantruntime="true" srcdir="src:test" excludes="**/OntologyParserTest.java" destdir="bin" nowarn="on">
38                        <classpath refid="test.classpath" />
39                </javac>
40                <!-- deliver config files -->
41                <copy todir="bin">
42                        <fileset dir="src" excludes="**/*.java" />
43                </copy>
44        </target>
45
46        <target name="clean-dist">
47                <delete>
48                        <fileset dir="dist" includes="*.jar" />
49                        <fileset dir="dist" includes="*.zip" />
50                </delete>
51        </target>
52
53        <target name="dist" depends="clean-dist, compile, test-html, jar, jar-with-deps, jar-with-deps-small, javadoc, dist-no-test">
54        </target>
55
56        <target name="dist-no-test" depends="clean-dist, compile, jar, jar-with-deps, jar-with-deps-small, javadoc">
57                <zip destfile="dist/${ant.project.name}-${version}.zip">
58                        <zipfileset dir="doc" prefix="${ant.project.name}-${version}/docs" />
59                        <zipfileset dir="src" prefix="${ant.project.name}-${version}/source/src" />
60                        <zipfileset dir="test" prefix="${ant.project.name}-${version}/source/test" />
61                        <zipfileset dir="lib" prefix="${ant.project.name}-${version}/source/lib" />
62                        <zipfileset dir="." prefix="${ant.project.name}-${version}/source" includes="build.xml" />
63                        <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="${ant.project.name}-${version}-with-deps-small.jar" />
64                        <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="${ant.project.name}-${version}-with-deps.jar" />
65                        <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="${ant.project.name}-${version}.jar" />
66                        <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="release_notes.txt" />
67                        <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="COPYING" />
68                        <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="COPYING.LESSER" />
69                </zip>
70        </target>
71
72        <target name="jar-with-deps">
73                <jar destfile="dist/${ant.project.name}-${version}-with-deps.jar" filesetmanifest="mergewithoutmain">
74                        <manifest>
75                                <attribute name="Main-Class" value="uk.ac.ebi.ontocat.examples.Example3" />
76                                <attribute name="Class-Path" value="." />
77                        </manifest>
78                        <fileset dir="bin" />
79                        <fileset dir="src" />
80                        <zipfileset excludes="META-INF/*.SF" src="lib/jargs.jar" />
81                        <zipfileset excludes="META-INF/*.SF" src="lib/log4j-1.2.15.jar" />
82                        <zipfileset excludes="META-INF/*.SF" src="lib/junit-4.8.1.jar" />
83                        <zipfileset excludes="META-INF/*.SF" src="lib/xpp3_min-1.1.4c.jar" />
84                        <zipfileset excludes="META-INF/*.SF" src="lib/opencsv-1.8.jar" />
85                        <zipfileset excludes="META-INF/*.SF" src="lib/owlapi-3.2.2/owlapi-bin.jar" />
86                        <zipfileset excludes="META-INF/*.SF" src="lib/ols-client.jar" />
87                        <zipfileset excludes="META-INF/*.SF" src="lib/axis.jar" />
88                        <zipfileset excludes="META-INF/*.SF" src="lib/jaxrpc.jar" />
89                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-logging-1.1.1.jar" />
90                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-discovery-0.2.jar" />
91                        <zipfileset excludes="META-INF/*.SF" src="lib/wsdl4j-1.6.2.jar" />
92                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2-javadoc.jar" />
93                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2-sources.jar" />
94                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2.jar" />
95                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/lib/slf4j-log4j12-1.5.11.jar" />
96                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/lib/slf4j-api-1.5.11-sources.jar" />
97                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/lib/slf4j-api-1.5.11.jar" />
98                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-lang-2.4.jar" />
99                        <zipfileset excludes="META-INF/*.SF" src="lib/xstream-1.3.1.jar" />
100                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-validator-1.3.1/commons-validator-1.3.1.jar" />
101                        <zipfileset excludes="META-INF/*.SF" src="lib/HermiT/org.semanticweb.HermiT.jar" />
102                </jar>
103        </target>
104
105        <!-- This uses the custom xstream-gae.jar that works on google app engine-->
106        <target name="jar-with-deps-gae">
107                <jar destfile="dist/${ant.project.name}-${version}-with-deps-gae.jar" filesetmanifest="mergewithoutmain">
108                        <manifest>
109                                <attribute name="Main-Class" value="uk.ac.ebi.ontocat.examples.Example3" />
110                                <attribute name="Class-Path" value="." />
111                        </manifest>
112                        <fileset dir="bin" />
113                        <fileset dir="src" />
114                        <zipfileset excludes="META-INF/*.SF" src="lib/jargs.jar" />
115                        <zipfileset excludes="META-INF/*.SF" src="lib/log4j-1.2.15.jar" />
116                        <zipfileset excludes="META-INF/*.SF" src="lib/junit-4.8.1.jar" />
117                        <zipfileset excludes="META-INF/*.SF" src="lib/xpp3_min-1.1.4c.jar" />
118                        <zipfileset excludes="META-INF/*.SF" src="lib/opencsv-1.8.jar" />
119                        <zipfileset excludes="META-INF/*.SF" src="lib/owlapi-3.2.2/owlapi-bin.jar" />
120                        <zipfileset excludes="META-INF/*.SF" src="lib/ols-client.jar" />
121                        <zipfileset excludes="META-INF/*.SF" src="lib/axis.jar" />
122                        <zipfileset excludes="META-INF/*.SF" src="lib/jaxrpc.jar" />
123                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-logging-1.1.1.jar" />
124                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-discovery-0.2.jar" />
125                        <zipfileset excludes="META-INF/*.SF" src="lib/wsdl4j-1.6.2.jar" />
126                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2-javadoc.jar" />
127                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2-sources.jar" />
128                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2.jar" />
129                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/lib/slf4j-log4j12-1.5.11.jar" />
130                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/lib/slf4j-api-1.5.11-sources.jar" />
131                        <zipfileset excludes="META-INF/*.SF" src="lib/ehcache-core-1.7.2/lib/slf4j-api-1.5.11.jar" />
132                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-lang-2.4.jar" />
133                        <zipfileset excludes="META-INF/*.SF" src="lib/xstream-gae.jar" />
134                        <zipfileset excludes="META-INF/*.SF" src="lib/commons-validator-1.3.1/commons-validator-1.3.1.jar" />
135                </jar>
136        </target>
137
138        <target name="jar-with-deps-small">
139                <jar destfile="dist/${ant.project.name}-${version}-with-deps-small.jar" filesetmanifest="mergewithoutmain">
140                        <manifest>
141                                <attribute name="Main-Class" value="uk.ac.ebi.ontocat.examples.Example3" />
142                                <attribute name="Class-Path" value="." />
143                        </manifest>
144                        <fileset dir="bin" />
145                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/jargs.jar" />
146                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/log4j-1.2.15.jar" />
147                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/xpp3_min-1.1.4c.jar" />
148                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/opencsv-1.8.jar" />
149                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/owlapi-3.2.2/owlapi-bin.jar" />
150                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/ols-client.jar" />
151                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/axis.jar" />
152                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/jaxrpc.jar" />
153                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-logging-1.1.1.jar" />
154                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-discovery-0.2.jar" />
155                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/wsdl4j-1.6.2.jar" />
156                        <!--
157                                <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/ehcache-core-1.7.2/ehcache-core-1.7.2.jar" />
158                                <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/ehcache-core-1.7.2/lib/slf4j-log4j12-1.5.11.jar" />
159                                <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/ehcache-core-1.7.2/lib/slf4j-api-1.5.11.jar" />
160                                -->
161                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-lang-2.4.jar" />
162                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/xstream-1.3.1.jar" />
163                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-validator-1.3.1/commons-validator-1.3.1.jar" />
164                        <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/HermiT/org.semanticweb.HermiT.jar" />
165                </jar>
166        </target>
167
168        <target name="jar">
169                <jar destfile="dist/${ant.project.name}-${version}.jar">
170                        <fileset dir="bin" />
171                </jar>
172        </target>
173
174        <target name="test">
175                <delete dir="${test.reports}" />
176                <mkdir dir="${test.reports}" />
177                <echo>Running junit tests...</echo>
178                <junit fork="yes" haltonfailure="yes" printSummary="true" showOutput="false" timeout="600000">
179                        <classpath refid="test.classpath" />
180                        <formatter type="xml" usefile="true" />
181                        <batchtest fork="yes" todir="${test.reports}">
182                                <fileset dir="bin">
183                                        <patternset refid="test.sources" />
184                                </fileset>
185                        </batchtest>
186                </junit>
187        </target>
188
189        <target name="test-html" depends="test">
190                <echo>Generating html report...</echo>
191                <junitreport todir="${test.reports}">
192                        <fileset dir="${test.reports}">
193                                <include name="TEST-*.xml" />
194                        </fileset>
195                        <report todir="${test.reports}" />
196                </junitreport>
197        </target>
198
199        <target name="update-sf">
200                <input message="Please enter your username in ontocat@SF" addproperty="tc.user" defaultvalue="tadamusiak" />
201                <input message="Please enter your password for ontocat@SF:" addproperty="tc.pass" />
202
203                <!-- request interactive shell -->
204                <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${tc.user},ontocat" password="${tc.pass}" command="create" />
205                <!-- archive the old files -->
206                <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${tc.user},ontocat" password="${tc.pass}" command="mv /home/frs/project/o/on/ontocat/ontoCAT/release/*.zip /home/frs/project/o/on/ontocat/ontoCAT/archive/." />
207
208                <!-- update the README -->
209                <scp file="dist/release_notes.txt" trust="true" verbose="true" todir="${tc.user},ontocat@frs.sourceforge.net:/home/pfs/project/o/on/ontocat/ontoCAT/release/README" password="${tc.pass}">
210                </scp>
211
212                <!-- copy new release  -->
213                <scp file="dist/${ant.project.name}-${version}.zip" trust="true" verbose="true" todir="${tc.user},ontocat@frs.sourceforge.net:/home/pfs/project/o/on/ontocat/ontoCAT/release/." password="${tc.pass}">
214                </scp>
215
216
217                <!-- shutdown interactive shell -->
218                <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${tc.user},ontocat" password="${tc.pass}" command="shutdown" />
219        </target>
220
221
222        <property environment="env" />
223        <property name="hudson.user" value="${env.SFUSER}" />
224        <property name="hudson.pass" value="${env.SFPASS}" />
225        <target name="hudson-to-sf">
226                <!-- request interactive shell -->
227                <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${hudson.user},ontocat" password="${hudson.pass}" command="create" />
228                <!-- archive the old files
229                                <sshexec host="shell.sourceforge.net"
230                                         trust="true"
231                                         verbose="true"
232                                         username="${hudson.user},ontocat"
233                                         password="${hudson.pass}"
234                                         command="mv /home/frs/project/o/on/ontocat/ontoCAT/release/*.zip /home/frs/project/o/on/ontocat/ontoCAT/archive/." />
235                        -->
236                <!-- update the README -->
237                <scp file="dist/release_notes.txt" trust="true" verbose="true" todir="${hudson.user},ontocat@frs.sourceforge.net:/home/pfs/project/o/on/ontocat/ontoCAT/nightly_build/README" password="${hudson.pass}">
238                </scp>
239
240                <!-- copy new release  -->
241                <scp file="dist/${ant.project.name}-${version}.zip" trust="true" verbose="true" todir="${hudson.user},ontocat@frs.sourceforge.net:/home/pfs/project/o/on/ontocat/ontoCAT/nightly_build/ontocat-snapshot.zip" password="${hudson.pass}">
242                </scp>
243
244
245                <!-- shutdown interactive shell -->
246                <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${hudson.user},ontocat" password="${hudson.pass}" command="shutdown" />
247        </target>
248
249</project>
Note: See TracBrowser for help on using the repository browser.