Israfil or Flex Mojos?
Want to compile flex code with maven? Don’t know which plugin to choose? Maybe this post will help you. Today, there are several available options for compiling flex with maven. On my list, I have these:
Of the three, I have tried only the first two for real. I did take a look into the servebox plugin sources though, and it seems two work exactly as israfil does, by spawning an external process, executing the SDK mxmlc command-line compiler.
Flex Mojos – Currently The Best
As I see it, this plugin is currently the best of breed. It is the only of the available plugins, that utilize the flex compiler api introduced in flex3, which makes for significantly faster builds than the other plugins, which simply acts as proxies for the mxmlc sdk command-line compiler. In addition to this, flex-mojos includes a nice bunch of features, at the top of my list:
Supports both flex2 and flex3, even though it requires the flex3 sdk dependencies, to get access to the flex compiler api. Only compiles to flex3 currently, as maintainer VELO mention in the comments. Ask project team if you need flex2 support.
- Compiling to libs (swc) or flash applications (swf)
- Also compiles to air executables (haven’t used that at all)
- Support for compiling Runtime Shared Libraries (RSL), which can give faster load-times of your application
- Does not require you to install the flex sdk locally (it is downloaded as dependencies from the repository on demand)
- Can run flexunit unit tests
- Can generate asdoc documentation
- Support for encrypting swf, if you think you need to be that safe
- Can generate flash application wrapper html
In addition to the above list, I feel this plugin has a good, thriving community, with actual ongoing development. I was trying out the hellfire compiler with flex-mojos one day and could not get it to work. I checked out the sources and found a bug in the snapshot code inside flex-mojos. I did a small patch and submitted to project lead, Marvin Froeder (VELO). All the time through, VELO did a superb job of support, and also applied my patch afterwards. A prime example on how a community is built.
If you want to get started compiling with flex-mojos, the project site is at google code, but the sources have moved to sonatype.org, a place for maven stuff. You should of course start following the project blog, but also take a look at the maven site generated documentation. The site docs are not that great yet, but you can lure the options to set for swf compilation from here, and so on for the other goals.
Israfil – A Good Old Friend
There is no doubt, that the israfil plugin has served us well. It compiles both flex2 and flex3 as flex-mojos, but it does not have the same feature set, as flex-mojos does. Another, more troublesome issue, is, that the community does not seem as live as with flex-mojos. We had a problem with israfil in that it uses the JRE on PATH when spawning mxmlc compiler, and this path could not be changed on the continous integration server. Of course, our project needed a different JRE than the one on path. One of my colleagues made a patch, adding support for setting the path to the JRE to use. To my knowledge, this patch has still yet to be applied. I also do not feel a thriving community there, but that is just my personal opinion.
Apart from the problems listed above, israfil is slow, as I showed in my previous post.