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