Stand Alone Compiler - CoreMedia/jangaroo-tools GitHub Wiki
If you want to use Jangaroo without Maven, here is a step-by-step description of how to set up and use the compiler from the command line.
Lines starting with >
are what you are supposed to type into a command shell, everything else is output.
Instructions are for Windows; if you use Linux or OS X, you have to replace \
by /
, %VAR%
by $VAR
, ;
inside -classpath
by :
, and type
by cat
. (It would be nice of someone to maintain a *nix version of this documentation!)
-
You need a Java JRE 1.6 or 1.7 (1.8 may also work, but we have not tested that yet). Download from Oracle and follow the installation instructions.
-
Download the latest Jangaroo 1.0.x SDK as a
zip
from Maven Central: Jangaroo 1.x SDK on Maven Central -
Unpack the
zip
into a directory of your choice (sayC:\jangaroo-sdk
). -
Add the
bin
sub-directory to yourPATH
:>set PATH=%PATH%;C:\jangaroo-sdk\bin
-
Try starting the compiler, it should output usage instructions:
>jooc usage: jooc [options] <file> ... ...
-
Store the library sub-directory in an environment variable:
>set JOOLIBS=C:\jangaroo-sdk\libs
Now you are ready to use the Jangaroo compiler from the command line.
To test the compiler with an example project, use the following steps:
-
Download the "Jangaroo Quickstart" example and unpack to another folder, say
C:\jangaroo-quickstart
: jangaroo-quickstart-master.zip -
Go to the subfolder
my-joo\my-joo-lib\src\main\joo
:>cd \jangaroo-quickstart\my-joo\my-joo-lib\src\main\joo
-
Now, compile
com\acme\HelloWorld.as
(see here for a documentation of all compiler command line switches):>jooc -v -g SOURCE -classpath %JOOLIBS%\jangaroo-runtime.jar -sourcepath my-joo-lib\src\main\joo -d my-joo-app\src\main\webapp\joo\classes my-joo-lib\src\main\joo\com\acme\HelloWorld.as -genarateapi: false -g option values: debugMode=SOURCE Parsing C:\jangaroo-quickstart-master\my-joo\my-joo-lib\src\main\joo\com\acme\HelloWorld.as (sourcepath) Parsing C:\jangaroo-sdk\libs\jangaroo-runtime.jar!META-INF/joo-api/Object.as (classpath) Parsing C:\jangaroo-sdk\libs\jangaroo-runtime.jar!META-INF/joo-api/String.as (classpath) writing file: 'C:\jangaroo-quickstart-master\my-joo\my-joo-app\src\main\webapp\joo\classes\com\acme\HelloWorld.js'
-
Repeat compilation for
my-joo-app
. Here, you additionally need the librariesjangaroo-browser
andmy-joo
:>jooc -v -g SOURCE -classpath %JOOLIBS%\jangaroo-runtime.jar;%JOOLIBS%\jangaroo-browser.jar;my-joo-lib\src\main\joo -sourcepath my-joo-app\src\main\joo -d my-joo-app\src\main\webapp\joo\classes my-joo-lib\src\main\joo\com\acme\HelloWorld.as -genarateapi: false -g option values: debugMode=SOURCE Parsing C:\jangaroo-sdk\jangaroo-quickstart-master\my-joo\my-joo-app\src\main\joo\com\acme\main\Main.as (sourcepath) Parsing C:\jangaroo-sdk\libs\jangaroo-runtime.jar!META-INF/joo-api/Object.as (classpath) Parsing C:\jangaroo-sdk\libs\jangaroo-browser.jar!META-INF/joo-api/window.as (classpath) Parsing C:\jangaroo-quickstart\my-joo\my-joo-lib\src\main\joo\com\acme\HelloWorld.as (classpath) Parsing C:\jangaroo-sdk\libs\jangaroo-runtime.jar!META-INF/joo-api/String.as (classpath) Parsing C:\jangaroo-sdk\libs\jangaroo-browser.jar!META-INF/joo-api/js/Element.as (classpath) writing file: 'C:\jangaroo-quickstart\my-joo\my-joo-app\src\main\webapp\joo\classes\com\acme\main\Main.js'
-
Unpack the libraries into the
webapp
directory:>cd my-joo-app\src\main\webapp >"%JAVA_HOME%\bin\jar" -xf %JOOLIBS%\jangaroo-runtime.jar >"%JAVA_HOME%\bin\jar" -xf %JOOLIBS%\jangaroo-browser.jar
-
By concatenating all libraries'
*.module.js
files in the correct order, createjangaroo-application.js
:>type joo\jangaroo-runtime.module.js joo\jangaroo-browser.module.js > joo\jangaroo-application.js
-
Eventually, the complete Web app is assembled. You can now open the example in a browser:
>start index.html