Skip to content
fwienber edited this page Jun 22, 2011 · 3 revisions

Upon several requests of people who cannot or do not want to use Maven, we now again provide a stand alone SDK package, containing all you need for Jangaroo development as a single download:

jangaroo-sdk-0.8.8.zip

Here are step-by-step instructions for getting started with the Jangaroo SDK:

The grey boxes are what you are supposed to type into a command shell, a second grey box separated by a line 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 you to submit a *nix version of this documentation!)

  1. You need a Java JRE 1.6 and JAVA_HOME set correctly
echo %JAVA_HOME%
C:\Program Files (x86)\Java\jdk1.6.0_25
  1. Download the following zip and unpack to a directory of your choice (say C:\joo):
    jangaroo-sdk-0.8.8.zip
  2. Store this directory in the environment variable JOO_HOME (note: if path contains spaces, you'll have to use quotes later, so better use a path without spaces):
set JOO_HOME=C:\joo
  1. Try starting the compiler, it should output usage instructions:
%JOO_HOME%\bin\jooc
usage: jooc [options] <file> ...
...
  1. Download the "HelloWorld" example and unpack to another folder:
    jangaroo-compiler-examples.zip
  2. cd into the helloWorld folder
  3. Create a webapp directory and unpack all needed Jangaroo libraries:
mkdir webapp
cd webapp
"%JAVA_HOME%\bin\jar" -xf %JOO_HOME%\libs\jangaroo-runtime.jar
"%JAVA_HOME%\bin\jar" -xf %JOO_HOME%\libs\jangaroo-browser.jar
cd ..
  1. By concatenating all used libraries' *.module.js files in the correct order, create jangaroo-application.js:
type %JOO_HOME%\meta\joo\jangaroo-runtime.module.js %JOO_HOME%\meta\joo\jangaroo-browser.module.js > webapp\joo\jangaroo-application.js
  1. Copy all Web app resources from source to target folder:
xcopy /s /y src\main\webapp webapp\
src\main\webapp\index.html
1 file(s) copied
  1. Compile net.jangaroo.example.HelloWorld (see here for documentation of all compiler parameters):
mkdir webapp\joo\classes
%JOO_HOME%\bin\jooc -v -g source -classpath %JOO_HOME%\libs\jangaroo-runtime.jar;%JOO_HOME%\libs\jangaroo-browser.jar -sourcepath src\main\joo -d webapp\joo\classes src\main\joo\net\jangaroo\example\HelloWorld.as
-genarateapi: false
-g option values:
source=true
lines=false
Parsing ...\helloWorld\src\main\joo\net\jangaroo\example\HelloWorld.as
Parsing C:\joo\libs\jangaroo-runtime-0.8.1.jar!META-INF/joo-api/String.as
Parsing C:\joo\libs\jangaroo-browser-0.8.2.jar!META-INF/joo-api/window.as
writing file: '...\helloWorld\webapp\joo\classes\net\jangaroo\example\HelloWorld.js'
  1. Eventually, the complete Web app is assembled. You can now open the example in a browser:
start webapp\helloWorld.html

After changing HelloWorld.as, recompile (step 10), when changing index.html, copy Web app resources again (step 9). If you use new or other Jangaroo libraries, don't forget to unpack the respective JAR (like in step 7) and recreate jangaroo-application.js (step 8), including all used libraries' *.module.js. Reload browser window to see the result (if changes do not appear, try clearing the browser cache). Of course, you will want to create batch files for those repeating tasks. You will also want to set the JOO_HOME environment variable permanently (hint for Windows 7: use setx) and add %JOO_HOME%\bin to your PATH.

Ext AS: exmlc, propc, and ext-as

The Jangaroo SDK contains all needed tools and libraries even for Ext AS development. There are two additional tools to use, propc and exmlc, and two more libraries, ext-js and ext-as.

The properties compiler propc has a very simple command line: it takes two arguments, the source folder and the target folder:

%JOO_HOME%\propc src\main\joo tmp\joo

It finds all *.properties files below the source folder and generates ActionScript classes in the corresponding package output directory below the target folder.

The EXML compiler also generates ActionScript code, but from XML, not from properties files. Additionally, it generates an XML Schema, describing the component API of the current module. The EXML compiler needs more context than the properties compiler and thus has some more command line parameters. Note that EXML was not really designed as a command line tool and thus is neither very user-friendly nor robust when used from the command line. Stay tuned for updates!

%JOO_HOME%\bin\exmlc <1:target-namespace> <2:target-namespace-prefix>
  <3:xsd-output-file> <4:src-dir> <5:output-dir> <6...:imported-xsd-files>

There are no command line switches, but the parameters have a fixed position:

  1. The target-namespace should be the name of the module and is used as the namespace "URL" of the generated XML Schema.
  2. The target-namespace-prefix is an abbreviation of the target namespace to use when this namespace is imported anywhere elese (xmlns:short="very-long-name").
  3. The xsd-output-file is the path and file name of the XML Schema file to generate, usually some temporary path and then the module name .xsd.
  4. The src-dir is the directory to scan for *.as and *.exml files. EXML source files generate ActionScript, while ActionScript source files may contribute to the generated XML Schema.
  5. The output-dir is the directory below which ActionScript sources are generated.
  6. The imported-xsd-files is a space-separated list of XML Schema files of all used Ext JS component suites. At least, the location of ext3.xsd must be specified, which is contained in the Ext AS library and thus available at %JOO_HOME%\meta\ext3.xsd.

The Ext AS examples project on github contains several DOS build batch files (build.bat) that can be used as examples of how the Jangaroo command line tools can be combined to simulate the Maven build process. Example 5 hello-world-5-localization is the most advanced, as it uses all three compilers.

Clone this wiki locally