Friday, July 10, 2009

Adding Ant to Adobe Flash Builder 4 Beta

There are good instructions for getting Ant to run in Flex Builder 3 at http://iamjosh.wordpress.com/2008/08/11/adding-ant-to-flex-builder-3/ but I just installed Adobe Flash Builder 4 Beta (the June 2009 version) and things are a tiny bit different. Here are the steps I followed:

  1. In Adobe Flash Builder 4 Beta, go to Help -> Software Updates -> Find and Install...

  2. Select "Search for new features to install" and click Next.

  3. Pick "The Eclipse Project Updates" and click Finish.

  4. If prompted, for "Update Site Mirrors", select "Automatically select mirrors". Click "OK".

  5. In the search results, expand "The Eclipse Project Updates", then expand "Eclipse 3.4.2″.

  6. Select "Eclipse Java Development Tools 3.4.2.r342..." and click "Next".

  7. Accept the license agreement and click "Next".

  8. Click "Finish".

  9. Wait for download...

  10. When prompted for feature verification, select "Install All".

  11. Restart Flex Builder as suggested.

You will now have Ant support installed. All build.xml file will have a little ant icon and if you right-click the file and select "Run as", you will see two Ant options:

  • Ant Build - which also has a keyboard short-cut, but does anyone actually remembers shortcuts like Alt+shift+X,Q ?

  • Ant Build... - which allows you to specify which targets to execute.

Side note: Make sure your Flex workspace don't contain space and Ant should work just fine.

My first error "Unable to access jarfile C:\ArcGIS\FlexAPI2\api\${env.FLEX4_HOME}\lib\compc.jar" was easily fixed by adding a new environment property FLEX4_HOME and setting it to C:\PROGRA~1\Adobe\FLASHB~1\sdks\4.0.0\

3 comments:

Duane Nickull said...

Major thanks! This made it easy to get ANT and Flex PMD up and running.

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

For Flash Builder 4.5, my non-8dot3 file was: c:\PROGRA~2\Adobe\ADOBEF~1.5\sdks\4.5.1