Recently we invested quite a lot of effort to make FlexJS buildable with Maven. This required quite some refactoring on all ends. But in the end it is now possible to build FlexJS with currently just one required Environment variable.
FlexJS consists of three parts: The compiler, typedefs and the framework, each is hosted in a separate GIT repository and have to be built and released separately. The order hereby is:
- Compiler
- Typedefs
- Framework
In addition to building the framework libraries, the framework module also assembles the binary distribution of the FlexJS SDK. It also has a feature of assembling a fully functional FlexJS distribution in a directory of choice, by setting an additional environment variable: distributionTargetFolder. If you set this to the path of a directory, the build will create a distribution there. This can then be used directly in your IDE of choice.
Step-by-step guide
- Install Java from: http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Install Maven 3.3.1 or greater from: http://maven.apache.org/download.cgi (I used 3.3.9)
- Download the archive
- Unpack the archive
- Set your systems PATH to the bin directory (I usually define a MAVEN_HOME to the unpacked directory and then add $MAVEN_HOME/bin to the PATH)
- 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)
- Set an environment variable called FLASHPLAYER_DEBUGGER and set it to the path of the Flash Debug Player executable (On windows and Linux machined 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.exeExample for Linux:
FLASHPLAYER_DEBUGGER=/opt/adobe/flash/flashplayer_11_sa_debug.i386/flashplayerdebuggerExample for Mac:
FLASHPLAYER_DEBUGGER=/Applications/Adobe/Flash/22.0/Flash Player.app/Contents/MacOS/Flash Player Debugger- Build Compiler (flex-falcon)
Clone:
git clone https://git-wip-us.apache.org/repos/asf/flex-falcon.git flex-falconGo into the new directory:
cd flex-falcon git checkout developBuild the compiler:
mvn -s settings-template.xml clean installThis will execute all unit-tests and integration-tests. You can however run the build without any tests:
mvn -s settings-template.xml -DskipTests clean installAnd if you just want to run the unit-tests and skip the integration-tests:
mvn -s settings-template.xml -DskipITs clean install- Build Typedefs (flex-typedefs)
Clone:
git clone https://git-wip-us.apache.org/repos/asf/flex-typedefs.git flex-typedefsGo into the new directory:
cd flex-typedefs git checkout developBuild the typedefs:
mvn -s settings-template.xml clean install- Build the Framework (flex-asjs)
Clone:
git clone https://git-wip-us.apache.org/repos/asf/flex-asjs.git flex-asjsGo into the new directory:
cd flex-asjs git checkout developBuild the framework libs:
mvn -s settings-template.xml clean installoptionally you can also build the distribution binaries:
mvn -s settings-template.xml -P build-distribution clean installoptionally you can also build the distribution binaries and a local distribution (including dependencies for Flash, AIR) in a local directory:
mvn -s settings-template.xml -DdistributionTargetFolder={pathToDistributionDirectory} -P build-distribution clean install
The reason for specifying the "-s settings-template.xml" is that we currently are using unreleased artifacts for the mavenizer. If we don't explicitly tell maven to also look in the Apache Snapshot Repo, it will not find these. This option will no longer be needed as soon as we have released the Mavenizer for a first time.
Related articles
6 Comments
Carlos Rovira
Just trying with a macOS Sierra clean install and step 4.c fails if you don't add "-DskipTests".
Edit: Ok, I see this is commented a bit later. And since tests are failing at the time of this test, it's the only way to go.
Christofer Dutz
Actually the tests are probably only failing because of missing FLASHPLAYER_DEBUGGER. I am using Sierra and can run the tests without any issues.
Carlos Rovira
Hi Chris,
I'm trying to run without skipTests, but I'm getting a message about java can't run Flash Player Debugger in mac (Permission denied). Do you know to deal with that?
Thanks
Carlos Rovira
The message is:
java.io.IOException: Cannot run program "/Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player Debugger": error=13, Permission denied
Carlos Rovira
Hi Chris, solved using a Flash Debugger on Application path like /Applications/Adobe/Flash/23.0/Flash\ Player.app/Contents/MacOS/Flash\ Player\ Debugger
instead of /Library/Internet\ Plug-Ins/Flash\ Player.plugin/Contents/MacOS/Flash\ Player\ Debugger
Carlos Rovira
coming back to previous problem, I can confirm all three modules run without problem using only "mvn clean install" when setting FLASH_PLAYER_DEBUGGER