Skip to content

Build Apache Royale with Maven

Carlos Rovira edited this page Mar 21, 2020 · 26 revisions

Apache Royale can be built with Maven.

Royale consists of three parts: The compiler, typedefs and the framework(asjs). Each is hosted in a separate GIT repository and has to be built and released separately. You build them in this order:

  1. Compiler
  2. Typedefs
  3. Framework

In addition to building the framework libraries, Maven also assembles the binary distribution of the Royale SDK to use in your IDE of choice.

Notice that you can build for just Javascript targets, and for Javascript and SWF targets using the "option-with-swf" flag

Requirements

  1. Install Java from: http://www.oracle.com/technetwork/java/javase/downloads/index.html (minimum version 8)
  2. Install Maven from: http://maven.apache.org/download.cgi (minimum version 3.3.1)
    1. Download the archive
    2. Unpack the archive
    3. Set your system PATH to the bin directory

if you don't have Maven installed, you can use mvnw (or Maven Wrapper) available in each root repository folder, that allows you check if maven exists in your system and install the latest version if nothing is found.

  1. Download the "Flash Player projector content debugger" for your system from: https://www.adobe.com/support/flashplayer/debug_downloads.html (The browser plugin or ActiveX component will not work).

    1. Create an environment variable called FLASHPLAYER_DEBUGGER and set it to the path of the Flash Debug Player executable. On Windows and Linux machines this is trivial as you simply provide the full path (including the executable name. on Mac's this will look something like this: {Place the Player is installed to}/Flash Player.app/Contents/MacOS/Flash Player Debugger)

    Example for Windows:

    FLASHPLAYER_DEBUGGER=C:\Program Files\Adobe\Flash\flashplayer_22_sa_debug.exe

    Example for Linux:

    FLASHPLAYER_DEBUGGER=/opt/adobe/flash/flashplayer_11_sa_debug.i386/flashplayerdebugger

    Example for Mac:

    FLASHPLAYER_DEBUGGER=/Applications/Adobe/Flash/22.0/Flash Player.app/Contents/MacOS/Flash Player Debugger

Build Steps

  1. First build the Compiler (royale-compiler)

    1. Clone:
    git clone https://github.com/apache/royale-compiler.git royale-compiler
    1. Go into the new directory:
    cd royale-compiler
    git checkout develop
    1. Build the compiler:
    mvn clean install

    This executes all unit and integration tests. You can run the build without running any tests by adding -DskipTests or skip just the integration-tests with -DskipITs.

  2. Next, build the Typedefs (royale-typedefs)

    1. Clone:
    git clone https://github.com/apache/royale-typedefs.git royale-typedefs
    1. Go into the new directory:
    cd royale-typedefs
    git checkout develop
    1. Build the typedefs:
    mvn clean install
  3. Finally, build the Framework (royale-asjs)

    1. Clone:
    git clone https://github.com/apache/royale-asjs.git royale-asjs
    1. Go into the new directory:
    cd royale-asjs
    git checkout develop
    1. Build the framework libs:
    mvn clean install

Now you have the compiler, typedefs and framework ready. That's all :).

If you want to make some modifications to your code you can make the changes and then build only the part that was modified, and you'll be ready to use it in your own project. To do so just go to the sub-project folder and run mvn clean install.

Optional Maven Profiles for Framework (royale-asjs)

If you build without any profile, the framework is built just for Javascript (no SWF at all), but no examples or distribution. To build the optional parts, add the following profiles to the command line using the -P maven option:

  • with-ui-testsuite: It also builds the test suite modules and runs the integration tests

You can use the latest geckodriver to run the Selenium UI tests in Firefox adding -Dwebdriver.gecko.driver=/Users/christofer.dutz/Downloads/geckodriver

  • option-with-swf: Makes each module build the SWF version.
  • option-with-sass-compile: To compile all SASS in themes. You just need to use this profile when update themes and want to generate final CSS.
  • with-examples: Builds the all examples in an examples folder.
  • with-distribution: Also builds the distribution (the Apache Royale SDK to use with an IDE). SDK built with maven allows you to get code intelligence in IDEs and build with standard IDE execution commands. To build distribution (SDK) in the folder of your choice use -DdistributionTargetFolder={pathToDistributionDirectory}.

Combine with-distribution and option-with-swf to get a SDK with SWF support (both Javascript and SWF).

Notice that you can use Maven distribution SDK with IDEs too!. So it's up to you to compile your Apps using standard maven commands (mvn install) or hitting the habitual Build button in your IDE of choice

Quick Summary of build steps using the convenient maven wrapper (mvnw) and all available profiles:

#!/bin/bash
export FLASHPLAYER_DEBUGGER="/Users/christofer.dutz/Devtools/Adobe/Flash/FlashPlayer-32.0/Flash Player.app/Contents/MacOS/Flash Player Debugger"
cd royale-compiler
./mvnw install
cd ../royale-typedefs
./mvnw install
cd ../royale-asjs
./mvnw install -P with-examples,with-distribution,with-ui-testsuite,option-with-swf -Dwebdriver.gecko.driver=/Users/christofer.dutz/Downloads/geckodriver -DdistributionTargetFolder=/Users/christofer.dutz/ApacheRoyale/SDKs
Clone this wiki locally