Source

jython / build.xml

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

<project name="jython" default="jar" basedir=".">
    <target name="init">
        <property name="sourceDir" value="." />
        <property name="outputDir" value="build" />
        <property name="apidocDir" value="Doc/api" />
        <property name="debug" value="off" />
        <property name="optimize" value="on" />

        <available classname="java.util.List" property="java2" />
        <available classname="javax.servlet.Servlet" property="servlet" />
        <available classname="org.gnu.readline.Readline" property="readline" />

        <!-- 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="check.javaversion" unless="java2">
        <property name="exclude.java2.files" 
            value="**/CollectionProxy2.java,
                   **/Java2Accessibility.java,
                   **/InternalTables2.java,
                   **/ThreadStateMapping2.java,
                   **/WeakInternalTables.java,
                   **/AutoInternalTables.java,
                   **/SoftIInternalTables.java
                   **/BytecodeLoader2.java
            "/>
    </target>

    <target name="check.servlet" unless="servlet">
        <property name="exclude.servlet.files" 
            value="**/PyServlet.java"/>
    </target>

    <target name="check.readline" unless="readline">
        <property name="exclude.readline.files" 
            value="**/ReadlineConsole.java"/>
    </target>

    <target name="checks" depends="check.javaversion,check.servlet,check.readline" />

    <target name="compile" depends="prepare,parser,checks">
        <javac 
            srcdir="${sourceDir}/" 
            includes="org/**"
            destdir="${outputDir}/" 
            excludes="org/python/parser/python.java,
                      ${exclude.java2.files},
                      ${exclude.servlet.files},
                      ${exclude.readline.files}"
            debug="${debug}"
            optimize="${optimize}"
        />

        <javac 
            srcdir="${sourceDir}/Lib" 
            includes="jxxload_help/**"
            destdir="${outputDir}/" 
            debug="${debug}"
            optimize="${optimize}"
        />

       <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="javadoc" depends="compile">
        <mkdir dir="${apidocDir}" />
        <javadoc sourcepath="${sourceDir}"
                 destdir="${apidocDir}"
                 Public="Yes"
                 packagenames="org.python.core,
                               org.python.util"
                 Windowtitle="Jython API documentation"
                 bottom="&lt;a href='http://www.jython.org'>Jython homepage&lt;/a>"
        />
    </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.