Go AVDN
Using Apache Ant

Now we are going to use Apache Ant to compile the example code in this tutorial, follow the steps below:

Compiling On MS Windows™
Assumptions
The later steps assume you extracted required files onto your local disk as:
Ableverse™ Tutorials: D:\study\av6\ (with auto created tutorials subdir from the zip archive)
Ableverse™ Products: D:\apps\av6\ (All files inside the distributed package may be at the first level, so make sure to create a new directory when extracting it)
Apache Ant: D:\apps\apache-ant-1.6.5 (There should exists a file D:\apps\apache-ant-1.6.5\bin\ant.bat, or you'll need to check its directory structure.)
If you extracted those packages to other locations on your local disk, carefully subsitute those occurances within path strings in the following steps.
Compiling Steps
  1. Edit D:\study\av6\tutorials\build.xml to set correct location of Ableverse™ jars.
    <!-- change this path to where you unpacked the ableverse distribution -->
    <property name="av6.dir" value="D:/apps/av6" />

    This snippet is from build.xml

    Locate the red text above and change it to where you've unpacked Ableverse™ jars.
  2. Look at the msg target to learn how it'll be built.
    <target name="msg">
      <javac encoding="UTF-8"
             srcdir="examples"
             destdir="classes"
             debug="true">
        <include name="tutor/msg/**/*.java" />
        <classpath>
          <path refid="av6jars" />
        </classpath>
      </javac>
      <copy todir="classes">
        <fileset dir="examples"
                 includes="tutor/msg/*"
                 excludes="**/*.java,**/*.css,**/*.html,**/doc-files,**/doc-files/*" />
      </copy>
    </target>

    This snippet is from build.xml

  3. Bring up a command prompt window:
    Choose [Start Menu] -> [Run...] then type in cmd.exe and click [OK].
    You should see a new focused console window appear, and ready to type in commands.
  4. Change working directory to tutorials root:
    C:\Documents and Settings\Compl>cd /d d:\study\av6\tutorials\
    
    D:\study\av6\tutorials>
  5. Set the ANT_HOME environment variable, add its bin dir to PATH list:
    D:\study\av6\tutorials>set ANT_HOME=d:\apps\apache-ant-1.6.5
    
    D:\study\av6\tutorials>>set PATH=%PATH%;%ANT_HOME%\bin
    
    D:\study\av6\tutorials>
  6. Compile all Message Facility example classes:
    D:\study\av6\tutorials>ant msg
    Buildfile: build.xml
    
    msg:
        [javac] Compiling 7 source files to D:\study\av6\tutorials\classes
         [copy] Copying 2 files to D:\study\av6\tutorials\classes
    
    BUILD SUCCESSFUL
    Total time: 6 seconds
    D:\study\av6\tutorials>
  7. Check files generated under D:\study\av6\tutorials\classes.
Compiling On Unix(Solaris, AIX, MacOS etc.)/BSD/Linux
Assumptions
The later steps assume you extracted required files onto your local disk as:
Ableverse™ Tutorials: /home/compl/study/av6/ (with auto created tutorials subdir from the zip archive)
Ableverse™ Products: /home/compl/apps/av6/ (All files inside the distributed package may be at the first level, so make sure to create a new directory when extracting it)
Apache Ant: /home/compl/apps/apache-ant-1.6.5 (There should exists a script file /home/compl/apps/apache-ant-1.6.5/bin/ant, or you'll need to check its directory structure.)
If you extracted those packages to other locations on your local disk, carefully subsitute those occurances within path strings in the following steps.
Compiling Steps
  1. Edit /home/compl/study/av6/tutorials/build.xml to set correct location of Ableverse™ jars.
    <!-- change this path to where you unpacked the ableverse distribution -->
    <property name="av6.dir" value="D:/apps/av6" />

    This snippet is from build.xml

    Locate the red text above and change it to where you've unpacked Ableverse™ jars.
  2. Look at the msg target to learn how it'll be built.
    <target name="msg">
      <javac encoding="UTF-8"
             srcdir="examples"
             destdir="classes"
             debug="true">
        <include name="tutor/msg/**/*.java" />
        <classpath>
          <path refid="av6jars" />
        </classpath>
      </javac>
      <copy todir="classes">
        <fileset dir="examples"
                 includes="tutor/msg/*"
                 excludes="**/*.java,**/*.css,**/*.html,**/doc-files,**/doc-files/*" />
      </copy>
    </target>

    This snippet is from build.xml

  3. Bring up a terminal window:
    This is OS/Window Manager dependent, if you are using a UNIX like system, you should know perfectly how to do this.
  4. Change working directory to tutorials root:
    $ cd /home/compl/study/av6/tutorials/
    $ 
  5. Set the ANT_HOME environment variable, add its bin dir to PATH list:
    $ ANT_HOME=/home/compl/apps/apache-ant-1.6.5
    $ export ANT_HOME
    $ PATH=$PATH:$ANT_HOME/bin
    $ 
  6. Compile all Message Facility example classes:
    $ ant msg
    Buildfile: build.xml
    
    msg:
        [javac] Compiling 7 source files to /home/compl/study/av6/tutorials/classes
         [copy] Copying 2 files to /home/compl/study/av6/tutorials/classes
    
    BUILD SUCCESSFUL
    Total time: 6 seconds
    $ 
  7. Check files generated under /home/compl/study/av6/tutorials/classes.