| 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.9.2" /> |
|---|
| 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="build.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="build.classpath" /> |
|---|
| 32 | </javadoc> |
|---|
| 33 | |
|---|
| 34 | </target> |
|---|
| 35 | |
|---|
| 36 | <target name="clean-bin"> |
|---|
| 37 | <delete includeemptydirs="true"> |
|---|
| 38 | <fileset dir="bin" includes="**/*" defaultexcludes="false"/> |
|---|
| 39 | </delete> |
|---|
| 40 | </target> |
|---|
| 41 | |
|---|
| 42 | <target name="compile" depends="clean-bin"> |
|---|
| 43 | <javac includeantruntime="false" srcdir="src:test" excludes="**/OntologyParserTest.java" destdir="bin" nowarn="on"> |
|---|
| 44 | <classpath refid="build.classpath" /> |
|---|
| 45 | </javac> |
|---|
| 46 | <copy file="dist/log4j-release.properties" tofile="bin/log4j.properties" /> |
|---|
| 47 | </target> |
|---|
| 48 | |
|---|
| 49 | <target name="clean-dist"> |
|---|
| 50 | <delete> |
|---|
| 51 | <fileset dir="dist" includes="*.jar" /> |
|---|
| 52 | <fileset dir="dist" includes="*.zip" /> |
|---|
| 53 | </delete> |
|---|
| 54 | </target> |
|---|
| 55 | |
|---|
| 56 | <target name="dist" depends="clean-dist, compile, test, jar, jar-with-deps, jar-with-deps-small, javadoc, dist-no-test"> |
|---|
| 57 | </target> |
|---|
| 58 | |
|---|
| 59 | <target name="dist-no-test" depends="clean-dist, compile, jar, jar-with-deps, jar-with-deps-small, javadoc"> |
|---|
| 60 | <zip destfile="dist/${ant.project.name}-${version}.zip"> |
|---|
| 61 | <zipfileset dir="doc" prefix="${ant.project.name}-${version}/docs" /> |
|---|
| 62 | <zipfileset dir="src" prefix="${ant.project.name}-${version}/source/src" /> |
|---|
| 63 | <zipfileset dir="test" prefix="${ant.project.name}-${version}/source/test" /> |
|---|
| 64 | <zipfileset dir="lib" prefix="${ant.project.name}-${version}/source/lib" /> |
|---|
| 65 | <zipfileset dir="." prefix="${ant.project.name}-${version}/source" includes="build.xml" /> |
|---|
| 66 | <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="${ant.project.name}-${version}-with-deps-small.jar" /> |
|---|
| 67 | <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="${ant.project.name}-${version}-with-deps.jar" /> |
|---|
| 68 | <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="${ant.project.name}-${version}.jar" /> |
|---|
| 69 | <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="release_notes.txt" /> |
|---|
| 70 | <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="COPYING" /> |
|---|
| 71 | <zipfileset dir="dist" prefix="${ant.project.name}-${version}" includes="COPYING.LESSER" /> |
|---|
| 72 | </zip> |
|---|
| 73 | </target> |
|---|
| 74 | |
|---|
| 75 | <target name="jar-with-deps"> |
|---|
| 76 | <jar destfile="dist/${ant.project.name}-${version}-with-deps.jar" filesetmanifest="mergewithoutmain"> |
|---|
| 77 | <manifest> |
|---|
| 78 | <attribute name="Main-Class" value="uk.ac.ebi.ontocat.examples.Example3" /> |
|---|
| 79 | <attribute name="Class-Path" value="." /> |
|---|
| 80 | </manifest> |
|---|
| 81 | <fileset dir="bin" /> |
|---|
| 82 | <fileset dir="src" includes="**/*.java" /> |
|---|
| 83 | <zipfileset excludes="META-INF/*.SF" src="lib/jargs.jar" /> |
|---|
| 84 | <zipfileset excludes="META-INF/*.SF" src="lib/log4j-1.2.15.jar" /> |
|---|
| 85 | <zipfileset excludes="META-INF/*.SF" src="lib/junit-4.8.1.jar" /> |
|---|
| 86 | <zipfileset excludes="META-INF/*.SF" src="lib/xpp3_min-1.1.4c.jar" /> |
|---|
| 87 | <zipfileset excludes="META-INF/*.SF" src="lib/opencsv-1.8.jar" /> |
|---|
| 88 | <zipfileset excludes="META-INF/*.SF" src="lib/owlapi-3.2.2/owlapi-bin.jar" /> |
|---|
| 89 | <zipfileset excludes="META-INF/*.SF" src="lib/ols-client.jar" /> |
|---|
| 90 | <zipfileset excludes="META-INF/*.SF" src="lib/axis.jar" /> |
|---|
| 91 | <zipfileset excludes="META-INF/*.SF" src="lib/jaxrpc.jar" /> |
|---|
| 92 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-logging-1.1.1.jar" /> |
|---|
| 93 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-discovery-0.2.jar" /> |
|---|
| 94 | <zipfileset excludes="META-INF/*.SF" src="lib/wsdl4j-1.6.2.jar" /> |
|---|
| 95 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-lang-2.4.jar" /> |
|---|
| 96 | <zipfileset excludes="META-INF/*.SF" src="lib/xstream-1.3.1.jar" /> |
|---|
| 97 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-validator-1.3.1/commons-validator-1.3.1.jar" /> |
|---|
| 98 | <zipfileset excludes="META-INF/*.SF" src="lib/HermiT/org.semanticweb.HermiT.jar" /> |
|---|
| 99 | </jar> |
|---|
| 100 | </target> |
|---|
| 101 | |
|---|
| 102 | <!-- This uses the custom xstream-gae.jar that works on google app engine--> |
|---|
| 103 | <target name="jar-with-deps-gae"> |
|---|
| 104 | <jar destfile="dist/${ant.project.name}-${version}-with-deps-gae.jar" filesetmanifest="mergewithoutmain"> |
|---|
| 105 | <manifest> |
|---|
| 106 | <attribute name="Main-Class" value="uk.ac.ebi.ontocat.examples.Example3" /> |
|---|
| 107 | <attribute name="Class-Path" value="." /> |
|---|
| 108 | </manifest> |
|---|
| 109 | <fileset dir="bin" /> |
|---|
| 110 | <fileset dir="src" includes="**/*.java" /> |
|---|
| 111 | <zipfileset excludes="META-INF/*.SF" src="lib/jargs.jar" /> |
|---|
| 112 | <zipfileset excludes="META-INF/*.SF" src="lib/log4j-1.2.15.jar" /> |
|---|
| 113 | <zipfileset excludes="META-INF/*.SF" src="lib/junit-4.8.1.jar" /> |
|---|
| 114 | <zipfileset excludes="META-INF/*.SF" src="lib/xpp3_min-1.1.4c.jar" /> |
|---|
| 115 | <zipfileset excludes="META-INF/*.SF" src="lib/opencsv-1.8.jar" /> |
|---|
| 116 | <zipfileset excludes="META-INF/*.SF" src="lib/owlapi-3.2.2/owlapi-bin.jar" /> |
|---|
| 117 | <zipfileset excludes="META-INF/*.SF" src="lib/ols-client.jar" /> |
|---|
| 118 | <zipfileset excludes="META-INF/*.SF" src="lib/axis.jar" /> |
|---|
| 119 | <zipfileset excludes="META-INF/*.SF" src="lib/jaxrpc.jar" /> |
|---|
| 120 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-logging-1.1.1.jar" /> |
|---|
| 121 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-discovery-0.2.jar" /> |
|---|
| 122 | <zipfileset excludes="META-INF/*.SF" src="lib/wsdl4j-1.6.2.jar" /> |
|---|
| 123 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-lang-2.4.jar" /> |
|---|
| 124 | <zipfileset excludes="META-INF/*.SF" src="lib/xstream-gae.jar" /> |
|---|
| 125 | <zipfileset excludes="META-INF/*.SF" src="lib/commons-validator-1.3.1/commons-validator-1.3.1.jar" /> |
|---|
| 126 | </jar> |
|---|
| 127 | </target> |
|---|
| 128 | |
|---|
| 129 | <target name="jar-with-deps-small"> |
|---|
| 130 | <jar destfile="dist/${ant.project.name}-${version}-with-deps-small.jar" filesetmanifest="mergewithoutmain"> |
|---|
| 131 | <manifest> |
|---|
| 132 | <attribute name="Main-Class" value="uk.ac.ebi.ontocat.examples.Example3" /> |
|---|
| 133 | <attribute name="Class-Path" value="." /> |
|---|
| 134 | </manifest> |
|---|
| 135 | <fileset dir="bin" /> |
|---|
| 136 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/jargs.jar" /> |
|---|
| 137 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/log4j-1.2.15.jar" /> |
|---|
| 138 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/xpp3_min-1.1.4c.jar" /> |
|---|
| 139 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/opencsv-1.8.jar" /> |
|---|
| 140 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/owlapi-3.2.2/owlapi-bin.jar" /> |
|---|
| 141 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/ols-client.jar" /> |
|---|
| 142 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/axis.jar" /> |
|---|
| 143 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/jaxrpc.jar" /> |
|---|
| 144 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-logging-1.1.1.jar" /> |
|---|
| 145 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-discovery-0.2.jar" /> |
|---|
| 146 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/wsdl4j-1.6.2.jar" /> |
|---|
| 147 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-lang-2.4.jar" /> |
|---|
| 148 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/xstream-1.3.1.jar" /> |
|---|
| 149 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/commons-validator-1.3.1/commons-validator-1.3.1.jar" /> |
|---|
| 150 | <zipfileset excludes="META-INF/*.SF,**/*.java" src="lib/HermiT/org.semanticweb.HermiT.jar" /> |
|---|
| 151 | </jar> |
|---|
| 152 | </target> |
|---|
| 153 | |
|---|
| 154 | <target name="jar"> |
|---|
| 155 | <jar destfile="dist/${ant.project.name}-${version}.jar"> |
|---|
| 156 | <fileset dir="bin" /> |
|---|
| 157 | </jar> |
|---|
| 158 | </target> |
|---|
| 159 | |
|---|
| 160 | <target name="test"> |
|---|
| 161 | <delete dir="${test.reports}" /> |
|---|
| 162 | <mkdir dir="${test.reports}" /> |
|---|
| 163 | <echo>Running junit tests...</echo> |
|---|
| 164 | <junit fork="yes" haltonfailure="yes" printSummary="true" showOutput="false" timeout="600000"> |
|---|
| 165 | <classpath refid="build.classpath" /> |
|---|
| 166 | <formatter type="xml" usefile="true" /> |
|---|
| 167 | <batchtest fork="yes" todir="${test.reports}"> |
|---|
| 168 | <fileset dir="bin"> |
|---|
| 169 | <patternset refid="test.sources" /> |
|---|
| 170 | </fileset> |
|---|
| 171 | </batchtest> |
|---|
| 172 | </junit> |
|---|
| 173 | </target> |
|---|
| 174 | |
|---|
| 175 | <target name="update-sf"> |
|---|
| 176 | <input message="Please enter your username in ontocat@SF" addproperty="tc.user" defaultvalue="tadamusiak" /> |
|---|
| 177 | <input message="Please enter your password for ontocat@SF:" addproperty="tc.pass" /> |
|---|
| 178 | |
|---|
| 179 | <!-- request interactive shell --> |
|---|
| 180 | <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${tc.user},ontocat" password="${tc.pass}" command="create" /> |
|---|
| 181 | <!-- archive the old files --> |
|---|
| 182 | <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/." /> |
|---|
| 183 | |
|---|
| 184 | <!-- update the README --> |
|---|
| 185 | <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}"> |
|---|
| 186 | </scp> |
|---|
| 187 | |
|---|
| 188 | <!-- copy new release --> |
|---|
| 189 | <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}"> |
|---|
| 190 | </scp> |
|---|
| 191 | |
|---|
| 192 | |
|---|
| 193 | <!-- shutdown interactive shell --> |
|---|
| 194 | <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${tc.user},ontocat" password="${tc.pass}" command="shutdown" /> |
|---|
| 195 | </target> |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | <property environment="env" /> |
|---|
| 199 | <property name="hudson.user" value="${env.SFUSER}" /> |
|---|
| 200 | <property name="hudson.pass" value="${env.SFPASS}" /> |
|---|
| 201 | <target name="hudson-to-sf"> |
|---|
| 202 | <!-- request interactive shell --> |
|---|
| 203 | <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${hudson.user},ontocat" password="${hudson.pass}" command="create" /> |
|---|
| 204 | <!-- archive the old files |
|---|
| 205 | <sshexec host="shell.sourceforge.net" |
|---|
| 206 | trust="true" |
|---|
| 207 | verbose="true" |
|---|
| 208 | username="${hudson.user},ontocat" |
|---|
| 209 | password="${hudson.pass}" |
|---|
| 210 | command="mv /home/frs/project/o/on/ontocat/ontoCAT/release/*.zip /home/frs/project/o/on/ontocat/ontoCAT/archive/." /> |
|---|
| 211 | --> |
|---|
| 212 | <!-- update the README --> |
|---|
| 213 | <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}"> |
|---|
| 214 | </scp> |
|---|
| 215 | |
|---|
| 216 | <!-- copy new release --> |
|---|
| 217 | <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}"> |
|---|
| 218 | </scp> |
|---|
| 219 | |
|---|
| 220 | |
|---|
| 221 | <!-- shutdown interactive shell --> |
|---|
| 222 | <sshexec host="shell.sourceforge.net" trust="true" verbose="true" username="${hudson.user},ontocat" password="${hudson.pass}" command="shutdown" /> |
|---|
| 223 | </target> |
|---|
| 224 | |
|---|
| 225 | </project> |
|---|