rss twitter

Posts Tagged ‘ant’

Compile AIR to native .dmg or .exe files with ANT

An upcoming question in publish- & packaging AIR files is "How to convert them to a .dmg or .exe file?" Easily enough, you do not have to do anything else except using a slightly different ANT build task for it. Instead of passing:

XML:
  1. <arg value="${publish_dir}/${air_file}" />
  2. <arg value="${app_descriptor}" />

to the ADT you use:

XML:
  1. <arg value="-target"/>
  2. <arg value="native"/>
  3. <arg value="${publish_dir}/MyApp.dmg" />
  4. <arg value="${app_descriptor}" />

Read more »

Add Linked Resources (as a src folder) to ANT builds

Here's another quick snippet to add Linked Resources to a compile process built with ANT. You know, you can link a whole directory to be a "Linked Library" in FDT, e.g. Greensock's TweenLite. Doing so means that you cannot use the -library-path argument as it only work with .swc files. Instead of this use -source-path to successfully add a whole directory to be compiled into your SWF.

XML:
  1. <arg value="-source-path=/Users/marvin/libs/greensock-as3" />

This way you can use it in an AIR build as well and you do not have to replace your directory based libraries with SWC files.

Using SWCs within AIR packaging with ANT

In addition to AIR2 and FDT4 (M3) – A detailed Walkthrough I encountered a problem when trying to use external SWCs like e.g. an assets library in your AIR package. In other words: If you're using an SWC with all your graphical stuff exported from the Flash IDE you simply rightclick it in FDT and add it to your Source path to use it in your project. This works fine in a compiled SWF but if you want to launch your project in an AIR environment it will not find the library. And I really had a look for this ("Class not found!") errors after packaging for hours but didn't find anything except an ooold AIR project by a friend of mine who used the following argument in his "Compile SWF" task:

XML:
  1. <arg value="-library-path=${assets_dir}/lib/assets.swc" />

Et voilá, from then on my exported AppBg asset worked flawlessly in the ADL and packaged .air file:

Actionscript:
  1. var back:AppBg = new AppBg();

Now we're ready to take the next step: A real AIR application with chromeless layout, asset-using and some communications..

Powered by WordPress | Free T-Mobile Phones for Sale | Thanks to Palm Pre Blog, Video Game Music and Get Six Pack Abs