fixed some of the jar/wsdl deployment problems.
[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   
8   <target name="init">
9
10     <property name="libDir" value="lib"/>
11     <property name="resourceDir" value="resources"/>
12     <property name="helpDir" value="help"/>
13     <property name="docDir" value="doc"/>
14     <property name="sourceDir" value="src" />
15     <property name="outputDir" value="classes" />
16     <property name="packageDir" value="dist" />
17     <property name="outputJar" value="jalview.jar" />
18
19     <path id="build.classpath">
20       <fileset dir="utils">
21         <include name="*.jar"/>
22         <include name="**/*.jar"/>
23       </fileset>
24       <fileset dir="${libDir}">
25         <include name="*.jar"/>      
26         <include name="**/*.jar"/>
27       </fileset>
28     </path>
29 <!-->    <uptodate property="help.uptodate"
30      targetfile="${helpDir}/helpIndex.xml">
31       <srcfiles
32         dir="${helpDir}"
33         includes="**/*.html" />
34     </uptodate>
35     -->
36   </target>
37
38   <target name="clean" depends="init">
39         <!-- not efficient yet. -->
40     <delete dir="${outputDir}"/>
41   </target>
42
43   <target name="distclean" depends="init, clean">
44     
45     <echo message="REMOVING ALL BACKUP/AUTOSAVES!"/>
46     <delete>
47       <fileset dir=".">
48         <include name="${outputJar}"/>
49         <include name="#*#"/>
50         <include name="#*.*#"/>
51         <include name="**/#*#"/>
52         <include name="**/#*.*#"/>
53         <include name="*~"/>
54         <include name="*.*~"/>
55         <include name="**/*~"/>
56         <include name="**/*.*~"/>
57       </fileset>
58     </delete>
59   </target>
60   
61   <target name="prepare" depends="init">
62     <mkdir dir="${outputDir}"/>
63     <copy todir="${outputDir}">
64       <fileset dir=".">
65
66         <include name="${docDir}/**/*.*"/>
67         <include name="${helpDir}/**/*.*"/>
68         <include name="${libDir}/*.*"/>
69       </fileset>
70       <fileset dir="${resourceDir}">
71         <include name="**/*.*"/>
72       </fileset>
73     </copy>
74   </target>
75
76   <target name="build" depends="prepare">
77             <!-- not efficient yet. -->
78      <javac srcdir="${sourceDir}" destdir="${outputDir}"
79         classpathref="build.classpath" />
80   </target>
81   <target name="buildindices" depends="init, prepare" 
82    unless="help.uptodate">
83     <java
84      classname="com.sun.java.help.search.Indexer"
85      classpathref="build.classpath"
86      fork="true"
87      dir="${outputDir}/${helpDir}"
88      >
89       <arg line="html"/>
90     </java>
91   </target>
92   
93   <target name="makejars" depends="build, buildindices">
94     <!-- make the package jar -->
95     <mkdir dir="${packageDir}"/>
96     
97     <jar destfile="${packageDir}/${outputJar}">
98       <fileset dir="${outputDir}">
99         <exclude name="*.jar" />
100       </fileset>
101     </jar>
102
103     <copy toDir="${packageDir}" flatten="true">
104       <fileset dir="${outputDir}">
105         <include name="*.jar"/>
106         <include name="**/*.jar"/>
107       </fileset>
108     </copy>
109
110     <signjar 
111     storepass="alignmentisfun"
112     keypass="alignmentisfun"
113     keystore="keys/.keystore"
114     alias="jalview"
115     lazy="false"
116     verbose="false"
117     >
118
119     <fileset dir="${packageDir}">
120       <include name="*.jar"/>
121     </fileset>
122     </signjar>
123     <taskdef classpathref="build.classpath" resource="com/roxes/tools/ant/taskdefs.properties"/>
124     
125     <!--    codebase="http://www.jalview.org/jalview/webstart" -->
126     <jnlp toFile="${packageDir}/Jalview.jnlp" href="Jalview.jnlp"
127     codebase="file://">
128     <information>
129       <title>Jalview</title>
130       <vendor>M Clamp</vendor>
131       <homepage href="www.jalview.org"/>
132       <description>Jalview Multiple Alignment Editor</description>
133       <description kind="short">Jalview</description>
134       <icon href="BartonGroupBanner.gif"/>
135     </information>
136     <resources>
137       <j2se version="1.3+"/>
138       <fileset dir="${packageDir}">
139         <include name="*.jar"/>
140       </fileset>
141     </resources>
142     <application_desc main_class="jalview.gui.AlignFrame">
143       <argument>http://www.compbio.dundee.ac.uk/~andrew/jalview/glut.msf</argument>
144       <argument>URL</argument>
145       <argument>MSF</argument>
146         </application_desc>
147     <security>
148       <all_permissions/>
149     </security>  
150     </jnlp>        
151   </target>
152   <target name="runenv" depends="init">
153       <path id="run.classpath">
154         <pathelement location="${outputDir}"/>
155         <fileset dir="${outputDir}">
156         <include name="${libDir}/*.jar"/>
157       </fileset>
158     </path>
159     <pathconvert targetos="unix" refid="run.classpath" property="run.classpath"/>
160     
161     <echo>java -classpath ${run.classpath} jalview.bin.Jalview
162     </echo>
163 </target>
164   
165
166   <target name="package" depends="init, build">
167     
168   </target>
169 </project>