-
Notifications
You must be signed in to change notification settings - Fork 12
Jangaroo SDK
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:
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!)
- You need a Java JRE 1.6 and
JAVA_HOMEset correctly
echo %JAVA_HOME%C:\Program Files (x86)\Java\jdk1.6.0_25- Download the following zip and unpack to a directory of your choice (say
C:\joo):
jangaroo-sdk-0.8.8.zip - 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- Try starting the compiler, it should output usage instructions:
%JOO_HOME%\bin\joocusage: jooc [options] <file> ...
...- Download the "HelloWorld" example and unpack to another folder:
jangaroo-compiler-examples.zip -
cdinto thehelloWorldfolder - Create a
webappdirectory 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 ..- By concatenating all used libraries'
*.module.jsfiles in the correct order, createjangaroo-application.js:
type %JOO_HOME%\meta\joo\jangaroo-runtime.module.js %JOO_HOME%\meta\joo\jangaroo-browser.module.js > webapp\joo\jangaroo-application.js- 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- 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'- Eventually, the complete Web app is assembled. You can now open the example in a browser:
start webapp\helloWorld.htmlAfter 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.
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\jooIt 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:
- The
target-namespaceshould be the name of the module and is used as the namespace "URL" of the generated XML Schema. - The
target-namespace-prefixis an abbreviation of the target namespace to use when this namespace is imported anywhere elese (xmlns:short="very-long-name"). - The
xsd-output-fileis the path and file name of the XML Schema file to generate, usually some temporary path and then the module name.xsd. - The
src-diris the directory to scan for*.asand*.exmlfiles. EXML source files generate ActionScript, while ActionScript source files may contribute to the generated XML Schema. - The
output-diris the directory below which ActionScript sources are generated. - The
imported-xsd-filesis a space-separated list of XML Schema files of all used Ext JS component suites. At least, the location ofext3.xsdmust 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.