ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/jannotatix/build.xml
Revision: 1.2
Committed: Tue Aug 16 11:27:13 2005 UTC (10 years, 8 months ago) by maximilian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +3 -41 lines
Log Message:
*** empty log message ***

Line File contents
1 <!DOCTYPE project [<!ENTITY forrest-targets SYSTEM "forrest-targets.ent">]>
2 <project name="Jannotatix" default="run" basedir=".">
3 <description>
4 Jannotatix
5 </description>
6 <!-- set up external ant tasks stored in the antlib-dir-->
7 <taskdef resource="genjar.properties" classpath="antlib/GenJar.jar" />
8 <!-- set global properties for this build -->
9 <property name="src" location="src/java" />
10 <property name="build" location="build/classes" />
11 <property name="site" location="build/site" />
12 <property name="jardir" location="jar" />
13 <property name="manifest" location="manifest.txt" />
14 <property name="resources" location="res" />
15 <property name="jarname" value="jannotatix.jar" />
16 <property name="schemadir" location="src/schema" />
17 <property name="build" location="build" />
18 <property name="plugindir" location="${user.home}/JannotatixPlugins" />
19 <property name="testdir" location="src/test" />
20 <property name="VERBOSE" value="true" />
21 <property name="DEBUG" value="true" />
22 <property name="libdir" location="lib" />
23 <property name="main" value="Startup.Startup" />
24 <property name="keystore" value="keystore" />
25 <property name="plugins" value="plugins.zip" />
26 <path id="classpath.base">
27 <!-- this is important for genjar! -->
28 <pathelement location="${resources}" />
29 <pathelement location="${build}" />
30 <pathelement location="${libdir}/bytecode-0.92.jar" />
31 <pathelement location="${libdir}/jakarta-regexp.jar" />
32 <pathelement location="${libdir}/biojava.jar" />
33 <pathelement location="${libdir}/concurrent.jar" />
34 <pathelement location="${libdir}/castor.jar" />
35 <pathelement location="${libdir}/commons-cli-1.0.jar" />
36 <pathelement location="${libdir}/commons-httpclient-2.0.jar" />
37 <pathelement location="${libdir}/jbcl.jar" />
38 <pathelement location="${libdir}/xml.jar" />
39 <pathelement location="${libdir}/commons-logging.jar" />
40 <pathelement location="${libdir}/commons-lang-2.0.jar" />
41 <pathelement location="${libdir}/liquidlnf.jar" />
42 <pathelement location="${libdir}/xerces.jar" />
43 <pathelement location="${libdir}/log4j.jar" />
44 <pathelement location="${libdir}/commons-configuration-1.0-rc1.jar" />
45 <pathelement location="${libdir}/commons-collections-3.1.jar" />
46 <pathelement location="${libdir}/xml-actions.jar" />
47 </path>
48 <path id="classpath.test">
49 <path refid="classpath.base" />
50 <pathelement location="${testdir}" />
51 <pathelement location="antlib/junit.jar" />
52 </path>
53
54 <target name="init" description="create directories">
55
56 <!-- Create the time stamp -->
57 <tstamp />
58 <!-- Create the build directory structure used by compile -->
59 <mkdir dir="${build}" />
60 </target>
61
62 <target name="compile" depends="init,copy-resources" description="compile the source ">
63 <!-- Compile the java code from ${src} into ${build} -->
64 <javac srcdir="${src}" destdir="${build}" debug="${DEBUG}" debuglevel="lines,vars,source">
65 <classpath refid="classpath.base" />
66 </javac>
67 </target>
68
69 <target name="jar" depends="compile,extractlibs,copy-resources" description="generate jar-file">
70 <!-- prepare the distribution directory -->
71 <echo message="make sure you have the jar-files from the antlib/-directory in your classpath or in $ANT_HOME/lib if this triggers an errormessage." />
72 <delete dir="${build}/package cache" />
73 <delete file="${jarname}" />
74 <classfileset id="reqdClasses" dir="${build}">
75 <rootfileset dir="${build}" includes="Startup/Startup.class" />
76 <rootfileset dir="${build}" includes=" org/biojava/bio/seq/impl/SimpleFeature.class" />
77 </classfileset>
78
79 <jar jarfile="${jarname}" manifest="${manifest}" index="true" duplicate="preserve">
80 <fileset refid="reqdClasses" />
81 <fileset dir=".">
82 <include name="LICENCE" />
83 <include name="LICENCE.COMMONS" />
84 <include name="README" />
85 </fileset>
86 <fileset dir="${build}">
87 <include name="**/*.gif" />
88 <include name="**/*.properties" />
89 <include name="**/*.xml" />
90 <include name="org/apache/log4j/**/*.class" />
91 <include name="data/xml/**/*.class" />
92 <include name="org/exolab/castor/xml/validators/**/*.class" />
93 <include name="org/biojava/bio/seq/impl/**/*.class" />
94 <include name="org/biojava/bio/gui/sequence/*.class" />
95 <include name="org/apache/xerces/**/*.class" />
96 <!-- the resource file for xml-actions -->
97 <include name="com/sun/jaf/ui/resources/*.dtd" />
98 <include name="org/biojava/ontology/**/*.*" />
99 <include name="org/apache/commons/logging/impl//*.class" />
100 </fileset>
101 </jar>
102 </target>
103
104 <target name="testjar" depends="jar" description="run the jar file">
105 <!-- jar="jar/${jarname}-${DSTAMP}.jar" -->
106 <java jar="${jarname}" fork="true">
107 <classpath refid="classpath.base" />
108 </java>
109 </target>
110
111 <target name="run" depends="compile" description="run the classes">
112 <!-- dir="${build}" -->
113 <java classname="${main}" fork="true">
114 <sysproperty key="DEBUG" value="true" />
115 <classpath refid="classpath.base" />
116 </java>
117 </target>
118
119 <target name="compile-test" description="compiles the tests">
120 <javac srcdir="${testdir}" verbose="${VERBOSE}">
121 <classpath refid="classpath.test" />
122 </javac>
123 </target>
124
125 <target name="clean-compile-test">
126 <delete verbose="${VERBOSE}">
127 <fileset dir="${testdir}" includes="**/*.class" />
128 </delete>
129 </target>
130
131 <target name="clean-compile" description="deletes java classes">
132 <delete dir="${build}" />
133 </target>
134
135 <target name="test" depends="compile-test">
136 <junit failureProperty="test.failure">
137 <classpath refid="classpath.test" />
138 <formatter type="brief" usefile="false" />
139 <test name="TestExample" />
140 </junit>
141 <fail message="test failed" if="test.failure" />
142 </target>
143
144 <target name="clean" depends="clean-site" description="clean up">
145 <!-- Delete the ${build} and ${dist} directory trees -->
146 <delete dir="build" />
147 <delete dir="unjarred" />
148 <delete dir="${dist}" />
149 <delete file="${jarname}" />
150 </target>
151
152 <target name="extractlibs" depends="" description="explode libraries, needed for generating a jar, as we include all library dependencies into the jar">
153 <unzip dest="${build}">
154 <fileset dir="${libdir}">
155 <include name="**/*.jar" />
156 </fileset>
157 </unzip>
158 </target>
159
160 <target name="unjar" depends="" description="extract jarfile to view contents">
161 <unzip dest="unjarred" src="${jarname}">
162 </unzip>
163 </target>
164
165 <target name="unjar-clean" depends="" description="delete unjarred directory">
166 <delete verbose="${VERBOSE}" dir="unjarred">
167 </delete>
168 </target>
169
170 <target name="castor" depends="" description="create xml-parsing classes with castor sourcegenerator">
171 <echo message="Generating value objects..." />
172 <java classname="org.exolab.castor.builder.SourceGenerator" fork="true">
173 <classpath refid="classpath.base" />
174 <classpath>
175 <fileset dir="antlib">
176 <include name="xerces.jar" />
177 <include name="castor.jar" />
178 </fileset>
179 </classpath>
180 <arg line="-dest ${build} -package data.xml -i ${schemadir}/AlgorithmDescription.xsd -f -types j2" />
181 </java>
182 <java classname="org.exolab.castor.builder.SourceGenerator" fork="true">
183 <classpath refid="classpath.base" />
184 <classpath>
185 <fileset dir="antlib">
186 <include name="xerces.jar" />
187 <include name="castor.jar" />
188 </fileset>
189 </classpath>
190 <arg line="-dest ${src} -package data.xml -i ${schemadir}/AlgorithmDescriptionBatch.xsd -f -types j2" />
191 </java>
192 </target>
193
194 <target name="publish-site" depends="" description="publish website on bioinformatics">
195 <scp todir="maximilian@www.bioinformatics.org:public_html/jannotatix" keyfile="${user.home}/.ssh/id_rsa" passphrase="" trust="yes">
196 <fileset dir="${site}">
197 <include name="**/*.*" />
198 </fileset>
199 </scp>
200 </target>
201
202 <target name="publish-jar" depends="" description="publish jar on bioinformatics">
203 <scp file="jannotatix.jar" todir="maximilian@www.bioinformatics.org:public_html/jannotatix" keyfile="${user.home}/.ssh/id_rsa" passphrase="" trust="yes">
204 </scp>
205 </target>
206
207 <target name="sign-jar" depends="" description="sign the jar, needed for a webstart-jar">
208 <echo level="info">Signing JARS...</echo>
209 <!-- <signjar jar="${jarname}" keystore="${keystore}" alias="max" storepass="password" /> -->
210 <signjar jar="${jarname}" alias="max" storepass="password" />
211 </target>
212
213
214 <target name="copy-resources" description="copy the resources into the build-dir">
215 <echo level="info">Copying resources...</echo>
216 <copy todir="${build}">
217 <fileset dir="${resources}">
218 <exclude name="**/*.java" />
219 </fileset>
220 </copy>
221 <!-- this is necessary for the xml-actions dtd files -->
222 <copy todir="${build}">
223 <fileset dir="${src}">
224 <include name="**/*.dtd" />
225 </fileset>
226 </copy>
227 </target>
228
229 <target name="testsite" description="generate the site and run mozilla on it" depends="site">
230 <exec executable="mozilla" spawn="true">
231 <arg value="build/site/index.html" />
232 </exec>
233 </target>
234
235 <target name="publish-plugins" description="zips your local plugins-dir and puts it onto the webserver">
236 <zip destfile="${plugins}/motifsampler.zip" basedir="${plugindir}/MotifSampler" duplicate="fail" />
237
238 <scp todir="maximilian@ftp.bioinformatics.org:/jannotatix" file="${plugins}" keyfile="${user.home}/.ssh/id_rsa" passphrase="" trust="yes">
239 </scp>
240 </target>
241
242 <target name="clean-site" description="cleans up forrest's mess in src dir">
243 <delete dir="${site}/build" />
244 </target>
245
246 &forrest-targets;
247 </project>