Skip to content

Compiler ~ Command Line

fwienber edited this page Dec 1, 2014 · 2 revisions

Command Line

The preferred way to use Jangaroo is to install Maven and use a pom.xml, as described in the tutorial. This is how all example applications on github are built. The advantage is that all needed Jangaroo tools and libraries are automatically downloaded and used via Maven. Updating tools and libraries is just a matter of changing the corresponding version numbers in the POM.

For those who don't like Maven, we offer a command line version of the compiler as part of the Jangaroo SDK. We have set up instructions on what to download and how to invoke the compiler from the command line in the Jangaroo Tools Wiki on the page "Stand Alone Compiler".

The jooc command is followed by command line options and then by a list of files to be compiled. Possible options are:

Option Description
-d <dir> output directory where to put generated JavaScript code
-g <mode> generate debuggable output; possible modes are source, lines, none
-api <dir> destination directory where to generate ActionScript API stubs
-sourcepath <path> a list of directories which are root directories of Jangaroo sources, separated by the platform specific path separator character (e.g. ';' on Windows, ':' on MacOS and Linux)
-classpath <path> a 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 (e.g. ';' on Windows, ':' on MacOS and Linux)
-autosemicolon <mode> Configures automatic semicolon insertion according to ECMA-262. Possible modes are: warn (default) - issue a compiler warning if a line terminator is the cause for semicolon insertion. This might change the meaning of the program in unexpected ways. error - treat this as an error (some kind of strict mode, recommended setting). quirks - silently insert semicolons as JavaScript interpreters and Flex mxmlc do.
-ea enable assertions: generate runtime checks for assert statements
-help print a help message
-v print verbose log messages about the compilation
-version print the Jangaro compiler version

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

If no -g option is specified for generating debug output, use the mode lines. If the option -g is specified without a mode, use the mode source. 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.

You find an example invocation of the compiler on the page "Stand Alone Compiler".

Clone this wiki locally