Ant

Ant is a build tool implemented in Java. It can be used to build Ptolemy II.
  1. Download Ant from http://ant.apache.org/
  2. Uncompress the file. We usually put vendor supplied tools in $PTII/vendors, but Ant can be installed anywhere
  3. Set the appropriate variables.

    Under bash:

    export ANT_HOME=$PTII/vendors/apache-ant-1.6.1
    export PATH=${PATH}:${ANT_HOME}/bin
    
    You may also need to set JAVA_HOME to the location of your Java installation. If which java returns
    /cygdrive/c/j2sdk1.4.2_04/bin/java
    
    export JAVA_HOME=c:/j2sdk1.4.2_04
    

    Permanently setting Windows Variables

    Under Windows, you can set these values permanently by doing Start -> right click on My Computer, select properties -> Advanced -> Environment Variables and then add the ANT_HOME and JAVA_HOME variables and update your path.
    Note you would need to use Windows DOS syntax when adjusting the path, add
    %ANT_HOME%/bin;
    
    ANT_HOME
    New user variable %PTII%/vendors/apache-ant-1.6.1
    JAVA_HOME
    New user variable c:/j2sdk1.4.2_04
    PATH
    Edit the PATH in the user variables section and insert %ANT_HOME%/bin
    After setting the Windows variables, you will need to exit and restart your Cygwin bash shell.
  4. To test, type
    ant -h
    
    You should see a help message
  5. To build Ptolemy:
    cd $PTII
    ant
    
    This command will read $PTII/build.xml and build Ptolemy II.
  6. To see what other targets are available:
    ant -projecthelp 
    
    or
    ant -p
    
Many thanks to Dan Higgins for creating an Ant build file for Ptolemy II