better code convention name
[jalview.git] / build.xml
1 <?xml version="1.0"?>
2   <project name="jalviewX" default="build" basedir=".">
3 <!-- we use jalopy to format our sources -->
4 <taskdef name="jalopy"
5          classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
6   <classpath>
7     <fileset dir="utils/jalopy/lib">
8       <include name="*.jar" />
9     </fileset>
10   </classpath>
11 </taskdef>
12     <!-- utils is a class path to additional utilities needed for
13     building docs, jars and webstart stuff -->
14
15 <!--
16         Userdefined build property defaults
17
18         wsdl.server list (plus namespace mapping info ???)  - also want
19                 ... to make this a dynamically generatable property
20         WebStart Location
21         Build location - provide a temporary root for speed
22         jarsigner keystore and info
23         Jakarta and axis classpath ?
24         Default argument for starting Jalview (if it exists).
25
26 -->
27
28     <target name="init">
29       <path id="axis.classpath">
30 <!-->        <fileset dir="/usr/local/axis/lib">
31           <include name="**/*.jar" />
32         </fileset>
33         <fileset dir="/usr/local/jakarta-tomcat-5/webapps/axis/WEB-INF/lib">
34           <include name="**/*.jar"/>
35           <include name="*.jar"/>
36         </fileset> -->
37       </path>
38
39       <property name="" value=""/>
40       <property name="libDir" value="lib"/>
41       <property name="resourceDir" value="resources"/>
42       <property name="helpDir" value="help"/>
43       <property name="docDir" value="doc"/>
44       <property name="sourceDir" value="src" />
45       <property name="outputDir" value="classes" />
46       <property name="packageDir" value="dist" />
47       <property name="outputJar" value="jalview.jar" />
48       <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
49       <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
50       <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
51       <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
52       <property name="wsdl.MsaWS2" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS?wsdl" />
53         <property name="WSInterf" value="MsaWS" />
54       <property name="WebStartLocation" value="http://www.jalview.org/webstart"/>
55       <property name="wsdl.Namespace" value="vamsas" />
56       <property name="wsdl.ClientNS" value="ext.vamsas" />
57
58       <path id="build.classpath">
59         <fileset dir="utils">
60           <include name="*.jar"/>
61           <include name="**/*.jar"/>
62         </fileset>
63         <fileset dir="${libDir}">
64           <include name="*.jar"/>
65           <include name="**/*.jar"/>
66         </fileset>
67 <!--        <fileset dir="old_lib_signed">
68 <include name="lib_axis.jar"/>
69
70         </fileset>-->
71       </path>
72       <!-->    <uptodate property="help.uptodate"
73       targetfile="${helpDir}/helpIndex.xml">
74       <srcfiles
75                  dir="${helpDir}"
76                  includes="**/*.html" />
77                </uptodate>
78       -->
79     </target>
80
81     <target name="clean" depends="init">
82       <!-- not efficient yet. -->
83       <delete dir="${outputDir}"/>
84     </target>
85
86     <target name="distclean" depends="init, clean">
87
88       <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
89       <delete>
90         <fileset dir=".">
91           <include name="${outputJar}"/>
92           <include name="#*#"/>
93           <include name="#*.*#"/>
94           <include name="**/#*#"/>
95           <include name="**/#*.*#"/>
96           <include name="*~"/>
97           <include name="*.*~"/>
98           <include name="**/*~"/>
99           <include name="**/*.*~"/>
100         </fileset>
101       </delete>
102     </target>
103
104     <target name="prepare" depends="init">
105       <mkdir dir="${outputDir}"/>
106       <copy todir="${outputDir}">
107         <fileset dir=".">
108
109           <include name="${docDir}/**/*.*"/>
110           <include name="${helpDir}/**/*.*"/>
111           <include name="${libDir}/*.*"/>
112         </fileset>
113         <fileset dir="${resourceDir}">
114           <include name="**/*.*"/>
115         </fileset>
116       </copy>
117     </target>
118
119     <target name="build" depends="prepare">
120       <!-- not efficient yet. -->
121       <javac source="1.4" target="1.4" srcdir="${sourceDir}" destdir="${outputDir}"
122       classpathref="build.classpath" />
123     </target>
124     <target name="buildindices" depends="init, prepare"
125     unless="help.uptodate">
126     <java
127       classname="com.sun.java.help.search.Indexer"
128       classpathref="build.classpath"
129       fork="true"
130       dir="${outputDir}/${helpDir}"
131       >
132       <arg line="html"/>
133     </java>
134     </target>
135
136     <target name="makejars" depends="build, buildindices">
137       <!-- make the package jar -->
138       <mkdir dir="${packageDir}"/>
139
140       <jar destfile="${packageDir}/${outputJar}">
141         <fileset dir="${outputDir}/">
142           <exclude name="*.jar" />
143           <exclude name="*.jar.*" />
144           <exclude name="**/*.jar" />
145           <exclude name="**/*.jar.*" />
146         </fileset>
147       </jar>
148
149       <copy toDir="${packageDir}" flatten="true">
150         <fileset dir="${outputDir}">
151           <include name="*.jar"/>
152           <include name="**/*.jar"/>
153         </fileset>
154       </copy>
155 <!-- the default keystore details might need to be edited here -->
156       <signjar
157       storepass="alignmentisfun"
158       keypass="alignmentisfun"
159       keystore="keys/.keystore"
160       alias="jalview"
161       lazy="false"
162       verbose="false"
163       >
164
165       <fileset dir="${packageDir}">
166         <include name="*.jar"/>
167       </fileset>
168       </signjar>
169       <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
170
171       <!--    codebase="http://www.jalview.org/jalview/webstart" -->
172       <jnlp toFile="${packageDir}/Jalview.jnlp" href="Jalview.jnlp"
173       codebase="${WebStartLocation}">
174       <information>
175         <title>Jalview</title>
176         <vendor>Barton Group</vendor>
177         <homepage href="www.jalview.org"/>
178         <description>Jalview Multiple Alignment Editor</description>
179         <description kind="short">Jalview</description>
180         <icon href="BartonGroupBanner.gif"/>
181       </information>
182         <resources>
183           <j2se version="1.3+"/>
184           <fileset dir="${packageDir}">
185             <include name="jalview.jar"/>
186           </fileset>
187           <fileset dir="${packageDir}">
188             <include name="*.jar"/>
189             <exclude name="jalview.jar"/>
190           </fileset>
191         </resources>
192         <application_desc main_class="jalview.bin.Jalview">
193           </application_desc>
194         <security>
195           <all_permissions/>
196         </security>
197       </jnlp>
198     </target>
199     <target name="runenv" depends="init">
200       <path id="run.classpath">
201         <pathelement location="${outputDir}"/>
202         <fileset dir="${outputDir}">
203           <include name="${libDir}/*.jar"/>
204         </fileset>
205       </path>
206       <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
207
208       <echo>java -classpath ${run.classpath} jalview.bin.Jalview
209       </echo>
210     </target>
211
212     <target name="buildextclients" depends="init">
213 <!-- Currently, this doesn't happen automatically.
214      1. Run WSDL2Java as below, which generates an ext.vamsas +
215      vamsas.<datapackages> fileset.
216      2. refactor ext.vamsas.SpecificserviceWS* to
217      ext.vamsas.ServiceclassWS* that implements the ServiceclassWSI interface.
218      3. Update the jalview.ws.*WServices classes to reflect the
219      interface type, and all locations of this wsdl type that Jalview
220      might be using.
221
222 -->
223       <path id="axisbuild">
224         <!--        <path refid="axis.classpath"/> -->
225         <path refid="build.classpath"/>
226       </path>
227       <taskdef resource="axis-tasks.properties" classpathref="axisbuild"/>
228       <move todir="./bak">
229         <fileset dir="${sourceDir}" id="client">
230           <include name="${wsdl.ClientNS}/*.*"/>
231         </fileset>
232       </move>
233
234       <axis-wsdl2java
235       output="${sourceDir}"
236       verbose="true"
237       url="${wsdl.MsaWS2}"
238       serverside="false"
239       deployscope="Request"
240       debug="false"
241       helpergen="true"
242       all="true"
243       >
244       <mappingSet>
245         <mapping
246         namespace="${wsdl.Namespace}"
247         package="${wsdl.ClientNS}"
248         />
249         <mapping namespace="http://dataTypes.vamsas"
250         package="${wsdl.ClientNS}"/>
251         </mappingSet>
252     </axis-wsdl2java>
253
254   </target>
255   <target name="package" depends="init, build">
256
257   </target>
258   <!-- jalopy code reformatter -->
259   <target name="sourcescrub" depends="init,build">
260     <jalopy destdir="jsrc" classpathref="run.classpath"
261       convention="jalview-jalopy.xml">
262       <fileset dir="${sourceDir}">
263         <include name="*.java"/>
264         <include name="**/*.java"/>
265         <include name="**/**/*.java"/>
266       </fileset>
267       </jalopy>
268   </target>
269
270 </project>