You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by alebianco <in...@alessandrobianco.eu> on 2013/09/23 15:47:44 UTC
Building an AIR library with Maven
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
<http://anthonywhitford.blogspot.co.uk/2013/09/mavenizing-flex-sdk-missing.html>
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
https://gist.github.com/alebianco/6670561*
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.
RE: Building an AIR library with Maven
Posted by Frédéric THOMAS <we...@hotmail.com>.
Updated the pom.xml, done !
-----Message d'origine-----
De : Frédéric THOMAS [mailto:webdoublefx@hotmail.com]
Envoyé : lundi 23 septembre 2013 19:54
À : dev@flex.apache.org
Objet : RE: Building an AIR library with Maven
Hi,
I assumed you meant FU 4.1, what you can do as well is set the ADT
${air.version} dep in the FM deps, you can have a look at my repo for a
complete air mavenized app (I will update the pom.xml in few hours to
reflect the last changes introduced by the new artifact versions):
https://github.com/apacheflex/whiteboard_fthomas_developerToolSuite
HIH and thanks for sharing, I didn't know the link to
mavenizing-flex-sdk-missing either, nice !
-Fred
-----Message d'origine-----
De : alebianco [mailto:info@alessandrobianco.eu] Envoyé : lundi 23 septembre
2013 15:48 À : dev@flex.apache.org Objet : Building an AIR library with
Maven
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
<http://anthonywhitford.blogspot.co.uk/2013/09/mavenizing-flex-sdk-missing.h
tml>
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
https://gist.github.com/alebianco/6670561*
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.
RE: Building an AIR library with Maven
Posted by alebianco <in...@alessandrobianco.eu>.
I'll post the link to the project and full pom as soon as I can, hopefully it
will be clearer
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Building-an-AIR-library-with-Maven-tp29883p29971.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
RE: Building an AIR library with Maven
Posted by Frédéric THOMAS <we...@hotmail.com>.
I just wonder if you visited the wiki
<https://cwiki.apache.org/confluence/display/FLEX/Apache+Flex+SDK+Mavenizer>
if yes, what informations there are missing ?> Anyway, I tried what you
suggested to completely swap the flex and air versions in the pom, but it
still won't run the test suite. I'm starting to think it's just because of
the way FM6 "guesses" the air version to fill the descriptor template. I'll
see if I can get @chrisdutz to comment on the issue ...I'm not sure to
understand, do you mean you haven't a file descriptor ?I use to create one,
never tried without, so, the only thing I need to do, in more than specify
the AIR SDK as dependency in the pom.xml, is to modify the AIR version in
the descriptor as well and that works fine, even for tests.
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Building-an-AIR-library-with-Maven-tp29883p29927.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
RE: Building an AIR library with Maven
Posted by alebianco <in...@alessandrobianco.eu>.
> I don't know where it could be more public than on github though :P
i was just hinting at the fact that i never found the repo linked in any
kind of documentation before. and i had to go through the sources to get
some kind of understanding of what each tool does.
I know, I'm lazy ... but some kind of documentation would be helpful if
we're supposed to use it :p ("we" as in devs that uses the flex framework
without being involved in its development)
---
Anyway, I tried what you suggested to completely swap the flex and air
versions in the pom, but it still won't run the test suite.
I'm starting to think it's just because of the way FM6 "guesses" the air
version to fill the descriptor template.
I'll see if I can get @chrisdutz to comment on the issue ...
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Building-an-AIR-library-with-Maven-tp29883p29924.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
RE: Building an AIR library with Maven
Posted by Frédéric THOMAS <we...@hotmail.com>.
> it's the kind of information that should be publicized a bit more
Yes, I guess so, especially because it exposes AIR maven modules for locales, themes, UI lib, SWF Host project and AIR itself indeed (plus it makes usage of SQLite and NativeProcess).
I don't know where it could be more public than on github though :P
> And if I can point it out, there's no need to manually compile flexmojos, it's now deployed at https://oss.sonatype.org under the groupID net.flexmojos.oss
Yep and thanks @Chris for that.
> Also I don't like very much the idea of overriding a specific dependency while ignoring others that will end up using a different version of the framework
Doing so, it is easy to switch AIR version even though you downloaded the Flex SDK with a specific AIR version, for example, this Flex SDK was downloaded and mavenized based on AIR 3.8 but I can use 3.4:
<properties>
<flexmojos.version>6.0.1</flexmojos.version>
<flex.version>4.10.0.20130801</flex.version>
<flex.debug>true</flex.debug>
<flex.skip.test>false</flex.skip.test>
<air.version>3.4</air.version>
</properties>
<plugin>
<groupId>net.flexmojos.oss</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<storepass/>
...
</configuration>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.air.compiler</groupId>
<artifactId>adt</artifactId>
<version>${air.version}</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Air SDK dependencies -->
<dependency>
<groupId>com.adobe.flex.framework.air</groupId>
<artifactId>air-framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
<exclusions>
<exclusion>
<groupId>com.adobe.air.framework</groupId>
<artifactId>common-framework</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.adobe.air.framework</groupId>
<artifactId>common-framework</artifactId>
<version>${air.version}</version>
<type>pom</type>
</dependency>
-----Message d'origine-----
De : alebianco [mailto:info@alessandrobianco.eu]
Envoyé : lundi 23 septembre 2013 21:23
À : dev@flex.apache.org
Objet : RE: Building an AIR library with Maven
Thanks Frédéric,
yes I ment FU 4.1.0 of course. I mistyped it on the post but it's correct on the pom.
I didn't come across your repo during my researches this weekend, it could have saved me some headaches probably :) it's the kind of information that should be publicized a bit more I think, especially if they could be useful to developers that uses the framework and not just to the ones who builds it.
And if I can point it out, there's no need to manually compile flexmojos, it's now deployed at https://oss.sonatype.org under the groupID net.flexmojos.oss
As for your suggestion: I think (not 100% sure now) I tried overriding the adt compiler dependency version with no luck. The problem is not packaging the application, especially since I'm building an swc, but creating the right descriptor for the TestRunner application to be run through adl.
Also I don't like very much the idea of overriding a specific dependency while ignoring others that will end up using a different version of the framework ... but that's just my OCD kicking in ...
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Building-an-AIR-library-with-Maven-tp29883p29910.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
RE: Building an AIR library with Maven
Posted by alebianco <in...@alessandrobianco.eu>.
Thanks Frédéric,
yes I ment FU 4.1.0 of course. I mistyped it on the post but it's correct on
the pom.
I didn't come across your repo during my researches this weekend, it could
have saved me some headaches probably :) it's the kind of information that
should be publicized a bit more I think, especially if they could be useful
to developers that uses the framework and not just to the ones who builds
it.
And if I can point it out, there's no need to manually compile flexmojos,
it's now deployed at https://oss.sonatype.org under the groupID
net.flexmojos.oss
As for your suggestion: I think (not 100% sure now) I tried overriding the
adt compiler dependency version with no luck. The problem is not packaging
the application, especially since I'm building an swc, but creating the
right descriptor for the TestRunner application to be run through adl.
Also I don't like very much the idea of overriding a specific dependency
while ignoring others that will end up using a different version of the
framework ... but that's just my OCD kicking in ...
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Building-an-AIR-library-with-Maven-tp29883p29910.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
RE: Building an AIR library with Maven
Posted by Frédéric THOMAS <we...@hotmail.com>.
Hi,
I assumed you meant FU 4.1, what you can do as well is set the ADT
${air.version} dep in the FM deps, you can have a look at my repo for a
complete air mavenized app (I will update the pom.xml in few hours to
reflect the last changes introduced by the new artifact versions):
https://github.com/apacheflex/whiteboard_fthomas_developerToolSuite
HIH and thanks for sharing, I didn't know the link to
mavenizing-flex-sdk-missing either, nice !
-Fred
-----Message d'origine-----
De : alebianco [mailto:info@alessandrobianco.eu]
Envoyé : lundi 23 septembre 2013 15:48
À : dev@flex.apache.org
Objet : Building an AIR library with Maven
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
<http://anthonywhitford.blogspot.co.uk/2013/09/mavenizing-flex-sdk-missing.h
tml>
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
https://gist.github.com/alebianco/6670561*
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.