jython / build.xml

<!-- Copyright 2000 Dj Walker-Morgan -->

<project name="jython" default="compile" basedir=".">
    <target name="init">
        <property name="sourceDir" value="." />
        <property name="outputDir" value="build" />

        <available classname="java.util.List" property="java2" />

        <!-- This propery should be specified in the ant.property file
           property name="javaccHome" value="/opt/javacc2.0/bin/lib" /-->

        <!-- Give users a change to override editing this file-->
        <property file="ant.properties" />
    </target>

    <target name="clean" depends="init">
        <delete dir="${outputDir}/" />
        <property name="parser" value="${sourceDir}/org/python/parser" />
        <delete file="${parser}/python.jj" />
        <delete file="${parser}/PythonGrammar.java" />
        <delete file="${parser}/PythonGrammarConstants.java" />
        <delete file="${parser}/PythonGrammarTokenManager.java" />
        <delete file="${parser}/PythonGrammarTreeConstants.java" />
        <delete file="${parser}/Node.java" />
        <delete file="${parser}/Token.java" />
        <delete file="${parser}/ASCII_CharStream.java" />
        <delete file="${parser}/JJTPythonGrammarState.java" />
    </target>

    <target name="prepare" depends="init">
        <mkdir dir="${outputDir}" />
    </target>

    <target name="tree" depends="prepare">
        <jjtree 
            javacchome="${javaccHome2}" 
            target="org/python/parser/python.jjt"
            outputdirectory="org/python/parser/"
        />
    </target>

    <target name="parser" depends="tree">
        <javacc 
            javacchome="${javaccHome2}" 
            target="org/python/parser/python.jj"
            outputdirectory="org/python/parser/"
        />
        <!-- Damn! The task above assumes that the generated name
             is basename of the input file. So we fake it to be the case-->
        <touch file="org/python/parser/python.java" />
    </target>

    <!-- 
      Only do this task if our environment is java2.
    -->
    <target name="checkjavaversion" unless="java2">
        <property name="excludejava2files" 
            value="**/CollectionProxy2.java,
                   **/Java2Accessibility.java,
                   **/InternalTables2.java,
                   **/ThreadStateMapping2.java,
                   **/WeakInternalTables.java,
                   **/AutoInternalTables.java,
                   **/SoftIInternalTables.java
                   **/BytecodeLoader2.java
            "/>
    </target>

    <target name="compile" depends="prepare,parser,checkjavaversion">
        <javac 
            srcdir="${sourceDir}/" 
            includes="org/**"
            destdir="${outputDir}/" 
            excludes="org/python/parser/python.java,${excludejava2files}"
        />

       <copy file="org/python/modules/ucnhash.dat" 
             todir="${outputDir}/org/python/modules" />
    </target>

    <target name="jar" depends="compile">
        <jar jarfile="jython.jar" 
             basedir="${outputDir}" 
             includes="**/*.class,**/ucnhash.dat" />
    </target>

    <target name="all" depends="init,clean,prepare,parser,compile,jar">
    </target>
</project>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.