I hope I understood correctly what is this: it's automatically changed by the build...
[guess.git] / build.xml
blobcc3ad4a2bf30ffb8650e0b51f02a7f95614179da
1 <!-- Copyright 2000 Dj Walker-Morgan -->
3 <project name="jython" default="jar" basedir=".">
5 <taskdef name="izpack" classpath="compile-lib/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask"/>
6     <!--
7       This propery should be specified in the ant.property file
8       property name="javaccHome2" value="/opt/javacc2.0/bin/lib"
9     -->
11     <!-- Give users a change to override editing this file. -->
12     <property file="ant.properties" />
14     <!-- =================================================================== -->
15     <!-- Classpaths                                                          -->
16     <!-- =================================================================== -->
17     <path id="main.classpath">
18         <pathelement path="${readline.jar}"/>
19         <pathelement path="${servlet.jar}"/>
20         <pathelement path="${informix.jar}"/>
21         <pathelement path="${oracle.jar}"/>
22         <pathelement path="${mysql.jar}"/>
23         <pathelement path="${postgresql.jar}"/>
24         <pathelement path="${jndi.jar}"/>
25         <pathelement path="${jdbc.jar}"/>
26         <pathelement path="lib/jung.jar"/>
27         <pathelement path="lib/commons-collections.jar"/>
28         <pathelement path="lib/piccolo.jar"/>
29         <pathelement path="lib/jide-components.jar"/>
30         <pathelement path="lib/jide-common.jar"/>
31         <pathelement path="lib/piccolox.jar"/>
32         <pathelement path="lib/prefuse.jar"/>
33         <pathelement path="lib/hsqldb.jar"/>
34         <pathelement path="lib/freehep-all.jar"/>
35         <pathelement path="lib/TGGraphLayout.jar"/>
36         <pathelement path="lib/looks.jar"/>
37         <pathelement path="lib/forms.jar"/>
38         <pathelement path="lib/jfreechart.jar"/>
39         <pathelement path="lib/jcommon.jar"/>
40         <pathelement path="lib/mascoptLib.jar"/>
41         <pathelement path="lib/colt.jar"/>
42         <pathelement path="c:/program files/jmf2.1.1e/lib/jmf.jar"/>
43         <pathelement path="${java.class.path}"/>
44         <pathelement location="${build.classes}"/>
45     </path>
47     <target name="versionstuff">
48                <delete file="src/com/hp/hpl/guess/Version.java"/>
49                <tstamp>
50                     <format property="guess.version" pattern="yyyyMMdd-hhmm"
51                      unit="hour"/>
52                 </tstamp>
53               <filter token="version" value="${guess.version}"/>
54               <copy file="src/com/hp/hpl/guess/Version.tmpl" tofile="src/com/hp/hpl/guess/Version.java"  filtering="true">
55               </copy>
56               <copy file="compile-lib/install.tmpl" tofile="compile-lib/install.xml"  filtering="true"/>
57               <copy file="compile-lib/config.blank" tofile="compile-lib/config.txt"  filtering="true"/>
58     </target>
60     <target name="init">
62         <property name="sourceDir" value="${basedir}/src" />
63         <property name="outputDir" value="${basedir}/build" />
64         <property name="demoSourceDir" value="${basedir}/demo" />
65         <property name="apidocDir" value="${basedir}/doc" />
66         <property name="debug" value="on" />
67         <property name="optimize" value="on" />
68         <property name="certAlias" value="eytancert" />
69         <property name="keyPass" value="Password" />
70         <property name="storePass" value="Password" />
71         <mkdir dir="cachedir"/>
72         <mkdir dir="cachedir\packages"/>
75         <available property="java2collection.present"
76             classname="java.util.List"
77         />
78         <available property="threadlocal.present"
79             classname="java.lang.ThreadLocal"
80         />
81         <available property="secureclassloader.present"
82             classname="java.security.SecureClassLoader"
83         />
84         <available property="java2accessible.present"
85             classname="java.lang.reflect.AccessibleObject"
86         />
87         <available property="weakref.present"
88             classname="java.lang.ref.WeakReference"
89         />
90         <available property="servlet.present" 
91             classname="javax.servlet.Servlet"
92             classpath="${servlet.jar}"
93         />
95         <available property="readline.present"
96             classname="org.gnu.readline.Readline"
97             classpath="${readline.jar}"
98         />
100         <available property="informix.present"
101             classname="com.informix.jdbc.IfxDriver"
102             classpath="${informix.jar}"
103         />
104         <available property="mysql.present"
105             classname="org.gjt.mm.mysql.Driver"
106             classpath="${mysql.jar}"
107         />
108         <available property="postgresql.present"
109             classname="org.postgresql.Driver"
110             classpath="${postgresql.jar}"
111         />
112         <available property="oracle.present"
113             classname="oracle.jdbc.driver.OracleDriver"
114             classpath="${oracle.jar}"
115         />
116         <available property="jndi.present"
117             classname="javax.naming.Context"
118             classpath="${jndi.jar}"
119         />
120         <available property="javax.sql.present"
121             classname="javax.sql.DataSource"
122             classpath="${jdbc.jar}"
123         />
126     </target>
128     <target name="clean" depends="init">
129         <delete dir="${outputDir}/" />
130         <property name="parser" value="${sourceDir}/org/python/parser" />
131         <delete file="${parser}/python.jj" />
132         <delete file="${parser}/PythonGrammar.java" />
133         <delete file="${parser}/PythonGrammarConstants.java" />
134         <delete file="${parser}/PythonGrammarTokenManager.java" />
135         <delete file="${parser}/PythonGrammarTreeConstants.java" />
136         <delete file="${parser}/Node.java" />
137         <delete file="${parser}/Token.java" />
138         <delete file="${parser}/ASCII_CharStream.java" />
139         <delete file="${parser}/JJTPythonGrammarState.java" />
140     </target>
142     <target name="prepare" depends="init">
143         <mkdir dir="${outputDir}" />
144     </target>
146     <target name="tree" depends="prepare">
147         <jjtree
148             javacchome="c:\\java\\javacc"
149             target="src/org/python/parser/python.jjt"
150             outputdirectory="src/org/python/parser/"
151         />
152     </target>
154     <target name="parser" depends="tree">
155         <javacc
156             javacchome="c:\\java\\javacc"
157             target="src/org/python/parser/python.jj"
158             outputdirectory="src/org/python/parser/"
159         />
160         <!-- Damn! The task above assumes that the generated name
161              is basename of the input file. So we fake it to be the case-->
162         <touch file="src/org/python/parser/python.java" />
163     </target>
165     <target name="demo">
166         <javac
167             srcdir="${demoSourceDir}/"
168             debug="${debug}"
169             optimize="${optimize}"/>
170     </target>
172     <target name="compile" depends="versionstuff,prepare,parser">
173         <javac
174             srcdir="${sourceDir}/"
175             destdir="${outputDir}/"
176             debug="${debug}"
177             optimize="${optimize}">
178             <include name="gnu/**"/>
179             <include name="org/**"/>
180             <include name="edu/**"/>        
181             <include name="com/hp/**"/>
182             
183             <exclude name="org/python/parser/python.java"/>
184             
185             <include name="com/ziclix/python/sql/**"
186                      if="java2collection.present"/>
188             <exclude name="**/CollectionProxy2.java"
189                      unless="java2collection.present"/>
190             <exclude name="**/Java2Accessibility.java"
191                      unless="java2accessible.present"/>
192             <exclude name="**/BytecodeLoader2.java"
193                      unless="secureclassloader.present"/>
194             <exclude name="**/ThreadStateMapping2.java"
195                      unless="threadlocal.present"/>
197             <exclude name="**/InternalTables2.java"
198                      unless="weakref.present"/>
199             <exclude name="**/WeakInternalTables.java"
200                      unless="weakref.present"/>
201             <exclude name="**/AutoInternalTables.java"
202                      unless="weakref.present"/>
203             <exclude name="**/SoftIInternalTables.java"
204                      unless="weakref.present"/>
205             <exclude name="**/_weakref.java"
206                      unless="weakref.present"/>
208             <exclude name="**/PyServlet.java" unless="servlet.present"/>
209             <exclude name="**/ReadlineConsole.java"
210                      unless="readline.present"/>
212             <exclude name="**/handler/InformixDataHandler.java"
213                      unless="informix.present"/>
214             <exclude name="**/handler/MySQLDataHandler.java"
215                      unless="mysql.present"/>
216             <exclude name="**/handler/OracleDataHandler.java"
217                      unless="oracle.present"/>
218             <exclude name="**/handler/PostgresqlDataHandler.java"
219                      unless="postgresql.present"/>
220             <exclude name="**/connect/Lookup.java" unless="jndi.present"/>
221             <exclude name="**/connect/Lookup.java" unless="javax.sql.present"/>
222             <exclude name="**/connect/Connectx.java"
223                      unless="javax.sql.present"/>
224             <classpath refid="main.classpath"/>
225         </javac>
227         <javac
228             srcdir="${sourceDir}/Lib"
229             includes="jxxload_help/**"
230             destdir="${outputDir}/"
231             debug="${debug}"
232             optimize="${optimize}"
233         />
235        <copy file="src/org/python/modules/ucnhash.dat"
236              todir="${outputDir}/org/python/modules" />
238        <copy todir="${outputDir}/com">
239            <fileset dir="${sourceDir}/com">
240               <include name="**/*.properties" if="java2collection.present"/>
241            </fileset>
242        </copy>
244     </target>
246     <target name="jar" depends="compile,demo">
247         <exec executable="pyexport.bat" />
248         <copy todir="${outputDir}/gnu/getopt/">
249             <fileset dir="${sourceDir}/gnu/getopt" includes="
250                 *.properties
251                 "/>
252         </copy>
253         <copy todir="${outputDir}/images/">
254             <fileset dir="images" includes="
255                 *.*
256                 "/>
257         </copy>
258         <copy todir="${outputDir}/scripts/">
259             <fileset dir="scripts" includes="
260                 *.*
261                 "/>
262         </copy>
263         <copy todir="${outputDir}/">
264             <fileset dir="cachedir/packages" includes="guess.pkc"/>
265         </copy>
266         <jar jarfile="guess.jar"
267              manifest="manifest.txt"
268              basedir="${outputDir}"
269              includes="**/*.class,**/ucnhash.dat,**/*.properties,**/*.png,**/*.gif,**/*.py,**/*.ico,guess.pkc" />
270         <copy file="guess.jar" tofile="lib/guess.jar" />
271     </target>
273     <target name="srcjar"> 
274         <jar jarfile="guess-src.jar"
275              basedir="src"
276              includes="**/*.java,**/*.py,**/*.jj,**/*.jjt" />
277     </target>  
279     <target name="makezip" depends="jar,srcjar">
280         <zip destfile="guess.zip">
281            <zipfileset dir="lib" prefix="guess/lib"/>
282            <zipfileset dir="demo" prefix="guess/demo"/>
283            <zipfileset dir="Tools" prefix="guess/Tools"/>
284            <zipfileset dir="scripts" prefix="guess/scripts"/>
285            <zipfileset dir="src/Lib" prefix="guess/src/Lib"/>
286            <zipfileset dir="." includes="guess.bat,guess-noopengl.bat,guess-console-noopengl.bat,guess.sh,guess-console.bat,nohost.gdf,test.html,test2.html,testprefuse.html,testtouchgraph.html,jython.bat,jythonc.bat,test.xml,README.TXT,sample.gdf,guess-src.jar,licenses/**" prefix="guess/"/>
287          </zip>
288          <zip destfile="guess-upgrade.zip">
289            <zipfileset dir="lib" prefix="guess/lib/guess.jar"/>
290            <zipfileset dir="scripts" prefix="guess/scripts"/>
291          </zip>
292     </target>
294     <target name="makezipnc">
295         <zip destfile="guess.zip">
296            <zipfileset dir="lib" prefix="guess/lib"/>
297            <zipfileset dir="demo" prefix="guess/demo"/>
298            <zipfileset dir="Tools" prefix="guess/Tools"/>
299            <zipfileset dir="scripts" prefix="guess/scripts"/>
300            <zipfileset dir="src/Lib" prefix="guess/src/Lib"/>
301            <zipfileset dir="." includes="guess.bat,guess-noopengl.bat,guess-console-noopengl.bat,guess.sh,guess-console.bat,nohost.gdf,test.html,test2.html,testprefuse.html,testtouchgraph.html,jython.bat,jythonc.bat,test.xml,README.TXT,sample.gdf,guess-src.jar,licenses/**" prefix="guess/"/>
302          </zip>
303          <zip destfile="guess-upgrade.zip">
304            <zipfileset dir="scripts" prefix="guess/scripts"/>
305            <zipfileset dir="." includes="lib/guess.jar" prefix="guess/"/>
306          </zip>
307     </target>
309     <target name="izpack" depends="jar">
310        <izpack input="compile-lib/install.xml"
311               output="guess-install.jar"
312               installerType="standard"
313               basedir="."/>
314     </target>
316     <target name="makeexe" depends="izpack">
317         <exec executable="compile-lib/makeexe.bat"/>
318     </target>
320     <target name="makezip2" depends="jar">
321         <delete>
322             <fileset dir="src/Lib" includes="*.class" />
323             <fileset dir="Tools" includes="*.class" />
324         </delete>
325         <zip destfile="guess.zip">
326            <zipfileset dir="lib" prefix="guess/lib"/>
327            <zipfileset dir="scripts" prefix="guess/scripts"/>
328            <zipfileset dir="src/Lib" prefix="guess/src/Lib"/>
329            <zipfileset dir="." includes="guess.bat,guess-console.bat,guess.sh,nohost.gdf,test.html,test2.html,jython.bat,jythonc.bat,test.xml,README.TXT,sample.gdf,licenses/**" prefix="guess/"/>
330          </zip>
331     </target>
334     <target name="jythonc" depends="compile">
335           <exec executable="jythonc.bat">
336               <arg line="--package com.hp.hpl.guess -C javac -w build Test.py"/>
337           </exec>
338     </target>
341     <target name="doc" depends="init">
342         <delete>
343             <fileset dir="Doc" includes="*.html" />
344         </delete>
345         <!-- Create .html files in Doc -->
346         <execon executable="${python.home}/python" dir="Doc">
347             <arg line="${ht2html.dir}/ht2html.py"/>
348             <arg line="-s JPyLocalGenerator"/>
349             <fileset dir="Doc">
350                 <include name="*.ht" />
351             </fileset>
352         </execon>
353     </target>
355     <target name="javadoc" depends="compile">
356         <delete dir="${apidocDir}" />
357         <mkdir dir="${apidocDir}" />
358         <javadoc sourcepath="${sourceDir}"
359                  destdir="${apidocDir}"
360                  public="true"
361                  packagenames="org.python.core,
362                                org.python.util,
363                                org.python.rmi,
364                                org.python.compiler,
365                                org.python.modues,
366                                org.python.modules.core,
367                                org.python.parser,
368                                org.rosuda.JRclient,
369                                com.hp.hpl.guess,
370                                com.hp.hpl.guess.util,
371                                com.hp.hpl.guess.db,
372                                com.hp.hpl.guess.freehep,
373                                com.hp.hpl.guess.layout,
374                                com.hp.hpl.guess.piccolo,
375                                com.hp.hpl.guess.prefuse,
376                                com.hp.hpl.guess.storage,
377                                com.hp.hpl.guess.tg,
378                                com.hp.hpl.guess.ui,
379                                com.hp.hpl.guess.io,
380                                com.hp.hpl.guess.jung,
381                                com.hp.hpl.guess.piccolo.util,
382                                edu.uci.ics.jung,
383                                edu.uci.ics.jung.algorithms,
384                                edu.uci.ics.jung.algorithms.transformation,
385                                edu.uci.ics.jung.generators,
386                                edu.uci.ics.jung.visualization,
387                                edu.uci.ics.jung.contrib,       
388                                gnu.getopt,
389                                org.apache.oro.text.regex,
390                                org.python.compiler,
391                                org.python.modules,
392                                org.python.parser,
393                                edu.umd.cs.piccolo,
394                                edu.umd.cs.piccolo.activities,
395                                edu.umd.cs.piccolo.event,
396                                edu.umd.cs.piccolox,
397                                edu.umd.cs.piccolox.event"
398                  windowtitle="GUESS documentation"
399                  additionalparam="-J-DproxyHost=web-proxy.crl.dec.com -J-DproxyPort=8080">
400                  <link href="http://jung.sourceforge.net/doc/api/"/>
401                  <link href="http://www.cs.umd.edu/hcil/piccolo/learn/piccolo/doc-1.1/api/"/>
402                   <link href="http://java.sun.com/j2se/1.4.2/docs/api"/>
403         </javadoc>
404     </target>
406     <target name="installXML" depends="init">
407         <!-- Set the configuration variables python.home and PyXmlHome
408              in your ant.properties file -->
409         <copy todir="${sourceDir}/Lib/xml">
410             <fileset dir="${python.home}/Lib/xml" includes="__init__.py"/>
411             <fileset dir="${PyXmlHome}/xml" includes="
412                 ns.py,
413                 sax/*.py,
414                 sax/drivers2/drv_xmlproc.py,
415                 sax/drivers2/__init__.py,
416                 utils/*.py,
417                 dom/*.py,
418                 dom/html/*.py,
419                 dom/ext/*.py,
420                 dom/ext/reader/__init__.py,
421                 dom/ext/reader/Sax*.py,
422                 parsers/__init__.py,
423                 parsers/xmlproc/*.py,
424                 "/>
425         </copy>
426     </target>
428     <target name="all" depends="init,clean,prepare,parser,compile,jar"/>
429 </project>