flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alebianco <i...@alessandrobianco.eu>
Subject Building an AIR library with Maven
Date Mon, 23 Sep 2013 13:47:44 GMT
This weekend I decided to convert the the build process of some of my
pet-projects from Ant to Maven ... madness followed shortly.

One of the requirements was to keep using the latest Apache Flex and AIR
builds, respectively 4.10.0 and 3.8. The other was to be able to run the
test suite as part of the build process.

/note: i'll post a pom example at the end, so you can skip all the babble
and go straight to the sources/

Soon I realised that Flexmojos 6.0.x was the only option and Flexunit 4.0.1
would work best with it. from there it was just a matter of figuring out
that they're being deployed under different groupIDs than they were before.

Then I had to deal with the Apache Flex framework not being deployed
anywhere. So I followed the (poorly documented) mavenization process. I
failed. A couple of times.
Then I found  this guide
and everything made sense and worked flawlessly.

Now the project was able to build, but the test suite failed to run,
returning a "Initial window content is invalid" error.
After a (long) while I realised that in the TestRunner.xml descriptor, the
namespace for the application was for AIR 3.1 and it was preventing the swf,
compiled with AIR 3.8, to be loaded.
After going through the Flexmojos code I figured out that it "guesses" the
AIR version depending on the Flex version, but the list only included Adobe
versions of the framework and their "originally shipped" version of AIR.

Luckily there's a property to override the AIR version: ${flex.airVersion}
So I just had to include that in my pom to have the descriptor to be
generated correctly and the test suite to run happily.

I'm not very happy yet about the pom and probably some dragons are still
hidden behind corners but it kind of work, so I thought I was worth sharing.
I'll have another look at the Flexmojos sources and hopefully I'll find a
way to specify the Flex version without having to override the compiler
dependency of the plugin.

*As promised, here's a pom example to check

PS: I'm no Maven expert, not by a long shot, so if I made some gross mistake
in the post or the pom, please let me know ...

View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Building-an-AIR-library-with-Maven-tp29883.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

View raw message