How can I build an Ant script to output swfs vs air packages, and to use different classes during the compilation based on my desired destination?
For example I am building an app that will be for the web, mobile and desktop. In some cases my classes will use AIR only components. I want to be able to create ANT build scripts that will not include those classes when outputting a swf for the web. How do I go about doing this?
Here’s what I did for a similar situation:
Then, I could define targets like
Or:
And if I have some factory of common code that instantiates the air class only if necessary, I wrap it with a
CONFIG::AllowAirComponents { ... }so my AIR specific classes wouldn’t interfere with the web build.Hope this helps!