Ant Task

You can add a <jooc/> task to the Ant build system by means of the following Ant declaration:

<taskdef name="jooc"
         classname="net.jangaroo.jooc.ant.JoocTask">
  <classpath>
    <fileset dir="${jangaroo.tools.lib}">
      <include name="jangaroo-compiler-*.jar"/>
    </fileset>
  </classpath>
</taskdef>

Set the build variable jangaroo.tools.lib to the directory that contans the Jangaroo compiler jar. Afterwards, the compiler may be invoked as follows:

<jooc destdir="${jooc.output}"
      failonerror="true"
      debug="${jooc.debug}"
      verbose="true"

      enableassertions="true"

      sourcepath="${jooc.source}" 

      classpath="${jangaroo-runtime.jar}"

      apidestdir="${jooc.output}/META-INF/joo-api">
  <include name="**/*.as"/>
  <src path="${jooc.source}"/>
</jooc>

Here the build variable jooc.output refers to the target directory, the variable jooc.debug must be to true or false, and the variable jooc.source points to the source directory for Jangaroo sources. The variable jangaroo-runtime.jar denotes the full path to the Jangaroo runtime jar file.

Possible attributes of the <jooc/> task are:

destdirdestination directory
srcdirsource directory
debugtrue, if you want the compiler to include debug output; false otherwise
debugLeveldebug output modes; possible modes are source, lines, none
failonerrorif a failing compilation should stop the build process
verbosetrue, if the compiler should print verbose log messages about the compilation; false otherwise
sourcepatha list of directories which are root directories of Jangaroo sources, separated by the platform specific path separator (available in the Ant variable ${path.separator})
classpatha list of directories or module artifacts (jars) which contain API stubs or the full sources of Jangaroo modules on which the given sources depend on, separated by the platform specific path separator character  (available in the Ant variable ${path.separator})
apidestdirdestination directory where to generate ActionScript API stubs
enableassertionsgenerate runtime checks for assert statements

The <jooc/> task forms an implicit <FileSet/> element, so that nested <include/> or <exclude/> elements may be used to limit the set of files to be processed, as may other appropriate elements and attributes.

If no output directory is specified, output files are written to the directory in which the corresponding input files are placed.

If the debug attribute is not specified or has the value false, use the mode lines. If the attribute debug is specified with a value of true, use the mode that is specified through the option debugLevel or source, if the attribute debugLevel is not present. Mode source generates output that includes all comments, preserves line breaks and white space, and generates readable names for anonymous inner functions. Mode lines only preserves line breaks and white space. Mode none shortens the generated output as far as possible without renaming variables and functions.