Captive AIR support
I would like to generate a captive AIR build using GradleFx. To do so, I need to pass the directive "-target bundle" to the adt compiler. The packageAir task action calls createCompilerArguments() method to collect the arguments, which uses the additionalCompilerOptions property. I therefore assume that I should be putting the "-target bundle" directive into the additionalCompilerOptions property.
This approach fails because the mxmlc compiler does not recognize the "-target bundle" directive with the error: "unknown configuration variable 'target'", preventing it from getting the adt compiler.
Is there another way to specify adt compiler directives that is independent of mxmlc directives, or is there an air property that enables captive air compile directives?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Yennick Trevels on 24 Aug, 2012 07:05 PM
Unfortunately there isn't a build in way to specify these arguments. This is something high on my list to open up the adt compiler options. Right now the AIR support is limited to a standard desktop application.
What you can do is to write a custom task and call the adt compiler in it (like we do internally in GradleFx), then you have the full freedom. This can look like this:
which you can then execute with 'gradle airBundle'.
I haven't tested this piece of code (copied the biggest part from GradleFx code), but it should be something like this.
2 Posted by Jeff Wilson on 30 Aug, 2012 06:01 PM
I ended up by modifying the source for GradleFx 0.5 to add support for captive air packaging. In the modified version, the air complex property now supports a 'captive' property, so adding 'air.captive = "true"' to an air typed build.gradle file results in a captive packaging of the air file.
Specifically, these are the changes I made:
In GradleFxConvention.groovy, I added the air.captive complex property and defaulted it to "false" for backward compatibility:
In AirPackage.groovy, I made the following 3 changes:
1) added a new addAirCaptiveOptions() method:
2) I updated the createCompilerArguments() method to call the newly added method:
3) Finally, I removed the timeout parameter from the ant.java call in the packageAir() method. This was after noting that a 60-second timeout was still failing due to the increased time required by adt to complete a captive air packaging.
I hope that documenting these enhancements will be be beneficial for both GradleFx users and for the excellent GradleFx project. Enjoy!
Support Staff 3 Posted by Yennick Trevels on 30 Aug, 2012 06:12 PM
Thanks for sharing Jeff!
I'll probably try to open up all air packaging options by including
something like additionalAirOptions, similar to how you can specify
compiler options with additionalCompilerOptions.
The timeout is indeed something we propably should provide a property for,
I'll make an issue for it on the GradleFx issue page.
-Yennick
4 Posted by plank.michael on 06 Oct, 2014 06:39 AM
Is this functionality implemented in one of the latest GradleFX versions?
I would also need to build captive AIR apps.
Support Staff 5 Posted by Yennick Trevels on 06 Oct, 2014 07:25 AM
no, it hasn't. Currently we only support standard desktop apps and mobile apps.