Compiling from the command line
For those who refuse to use Eclipse, or want to perform their software builds in an automated way, there is a mobl command line compiler as well.
Requirements
- A recent version of the Java SE SDK, if you don't have it already. Preferably version 6. To test if Java is already installed and, if so, what version you are running, open a command line console and type:
java -version
A clone or download of the mobl standard library:
git clone git://github.com/mobl/mobl-lib.git
moblc.jar, the compiler itself.
Running
cd
to your project's directory, then invoke the compiler as follows:
java -jar /path/to/moblc.jar -I /path/to/mobl-lib \
-i yourapp.mobl
When the stdlib
configuration is used in the project's config.mobl
file, you can leave out the -I /path/to/mobl-lib
:
configuration
stdlib /path/to/mobl-lib
Command-line switches
-i
the.mobl
file to compile-I
adds a directory to the module search path-d
the destination directory (defaults to./www
)-O
enable optimization mode (dead code elimination, code minification). (New in 0.4.0)
Limitations
- Error reporting does not mention line and column numbers, so errors are more difficult to trace back than while using the IDE