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 used to support a command line version of the compiler, but during extending the Maven build process, the convenient one-file download got lost on the way. We'll revive that, promised!
However, 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 java -jar ... command is followed by command line options and then by a list of files to be compiled. Possible options are:
| -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 interpretes and Flex compc 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 Jangaroo Tools Wiki page "Stand Alone Compiler".

