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"/>
7 This propery should be specified in the ant.property file
8 property name="javaccHome2" value="/opt/javacc2.0/bin/lib"
11 <!-- Give users a change to override editing this file. -->
12 <property file="ant.properties" />
14 <!-- =================================================================== -->
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}"/>
47 <target name="versionstuff">
48 <delete file="src/com/hp/hpl/guess/Version.java"/>
50 <format property="guess.version" pattern="yyyyMMdd-hhmm"
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">
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"/>
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"
78 <available property="threadlocal.present"
79 classname="java.lang.ThreadLocal"
81 <available property="secureclassloader.present"
82 classname="java.security.SecureClassLoader"
84 <available property="java2accessible.present"
85 classname="java.lang.reflect.AccessibleObject"
87 <available property="weakref.present"
88 classname="java.lang.ref.WeakReference"
90 <available property="servlet.present"
91 classname="javax.servlet.Servlet"
92 classpath="${servlet.jar}"
95 <available property="readline.present"
96 classname="org.gnu.readline.Readline"
97 classpath="${readline.jar}"
100 <available property="informix.present"
101 classname="com.informix.jdbc.IfxDriver"
102 classpath="${informix.jar}"
104 <available property="mysql.present"
105 classname="org.gjt.mm.mysql.Driver"
106 classpath="${mysql.jar}"
108 <available property="postgresql.present"
109 classname="org.postgresql.Driver"
110 classpath="${postgresql.jar}"
112 <available property="oracle.present"
113 classname="oracle.jdbc.driver.OracleDriver"
114 classpath="${oracle.jar}"
116 <available property="jndi.present"
117 classname="javax.naming.Context"
118 classpath="${jndi.jar}"
120 <available property="javax.sql.present"
121 classname="javax.sql.DataSource"
122 classpath="${jdbc.jar}"
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" />
142 <target name="prepare" depends="init">
143 <mkdir dir="${outputDir}" />
146 <target name="tree" depends="prepare">
148 javacchome="c:\\java\\javacc"
149 target="src/org/python/parser/python.jjt"
150 outputdirectory="src/org/python/parser/"
154 <target name="parser" depends="tree">
156 javacchome="c:\\java\\javacc"
157 target="src/org/python/parser/python.jj"
158 outputdirectory="src/org/python/parser/"
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" />
167 srcdir="${demoSourceDir}/"
169 optimize="${optimize}"/>
172 <target name="compile" depends="versionstuff,prepare,parser">
174 srcdir="${sourceDir}/"
175 destdir="${outputDir}/"
177 optimize="${optimize}">
178 <include name="gnu/**"/>
179 <include name="org/**"/>
180 <include name="edu/**"/>
181 <include name="com/hp/**"/>
183 <exclude name="org/python/parser/python.java"/>
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"/>
228 srcdir="${sourceDir}/Lib"
229 includes="jxxload_help/**"
230 destdir="${outputDir}/"
232 optimize="${optimize}"
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"/>
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="
253 <copy todir="${outputDir}/images/">
254 <fileset dir="images" includes="
258 <copy todir="${outputDir}/scripts/">
259 <fileset dir="scripts" includes="
263 <copy todir="${outputDir}/">
264 <fileset dir="cachedir/packages" includes="guess.pkc"/>
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" />
273 <target name="srcjar">
274 <jar jarfile="guess-src.jar"
276 includes="**/*.java,**/*.py,**/*.jj,**/*.jjt" />
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/"/>
288 <zip destfile="guess-upgrade.zip">
289 <zipfileset dir="lib" prefix="guess/lib/guess.jar"/>
290 <zipfileset dir="scripts" prefix="guess/scripts"/>
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/"/>
303 <zip destfile="guess-upgrade.zip">
304 <zipfileset dir="scripts" prefix="guess/scripts"/>
305 <zipfileset dir="." includes="lib/guess.jar" prefix="guess/"/>
309 <target name="izpack" depends="jar">
310 <izpack input="compile-lib/install.xml"
311 output="guess-install.jar"
312 installerType="standard"
316 <target name="makeexe" depends="izpack">
317 <exec executable="compile-lib/makeexe.bat"/>
320 <target name="makezip2" depends="jar">
322 <fileset dir="src/Lib" includes="*.class" />
323 <fileset dir="Tools" includes="*.class" />
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/"/>
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"/>
341 <target name="doc" depends="init">
343 <fileset dir="Doc" includes="*.html" />
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"/>
350 <include name="*.ht" />
355 <target name="javadoc" depends="compile">
356 <delete dir="${apidocDir}" />
357 <mkdir dir="${apidocDir}" />
358 <javadoc sourcepath="${sourceDir}"
359 destdir="${apidocDir}"
361 packagenames="org.python.core,
366 org.python.modules.core,
370 com.hp.hpl.guess.util,
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,
380 com.hp.hpl.guess.jung,
381 com.hp.hpl.guess.piccolo.util,
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,
389 org.apache.oro.text.regex,
394 edu.umd.cs.piccolo.activities,
395 edu.umd.cs.piccolo.event,
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"/>
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="
414 sax/drivers2/drv_xmlproc.py,
415 sax/drivers2/__init__.py,
420 dom/ext/reader/__init__.py,
421 dom/ext/reader/Sax*.py,
423 parsers/xmlproc/*.py,
428 <target name="all" depends="init,clean,prepare,parser,compile,jar"/>