Running Ant From FlashDevelop 3 · Mar 23, 06:55 AM

Kieth Peters figured this out over a year ago. However, follow his directions for the latest version of FlashDevelop (version 3, RC2) and you might run into some trouble. I’ll make this really easy for y’all.
Directions: Adding Ant to FlashDevelop
- Obviously, you need to have Ant installed.
- Make sure that Ant’s bin folder is in your Windows System Path Environment Variable. You can do this by right-clicking My Computer, choose properties, navigate to the Advanced tab and click the Environment Variables button. Then add the path to the bottom box.
- Add the following two lines to C:\Program Files\FlashDevelop\Settings\ToolBar.xml directly before </toolbar> (at the end of the file).
<separator /><button label="ANT Build" click="RunProcessCaptured" image="486" tag="c:\windows\system32\cmd.exe;/c $(Quote)cd $(ProjectDir)&&ant$(Quote)" />- Download this code: /files/fdant.txt
- Replace C:\Program Files\FlashDevelop\Settings\Images.png with this file
- Restart FlashDevelop
- Place your Ant build.xml in your project folder.
Now whenever you click on your newly created Ant button, Ant will build your project based on the build.xml.
Ant-ing a Different Build.xml
I’ve added another button to my work-flow that builds a file named build.test.xml. This file imports build.xml and then executes my main SWF file (AppMain.swf) after the build is complete. Here is what my build.test.xml looks like (note: compile is the default target in buld.xml):
<?xml version="1.0" encoding="utf-8" ?><project name="Tester" default="Test" basedir="."><description>Test SWF</description><import file="build.xml" /><property name="testswf" location="${basedir}\bin\AppMain.swf"/><property name="flashviewer" location="C:\Program Files\Adobe\Adobe Flash CS3\Players\Debug\FlashPlayer.exe"/><target name="Test" depends="compile"><exec executable="${flashviewer}" failonerror="true"><arg value="${testswf}"/></exec></target></project>- Download this code: /files/fdant2.txt
- Create your build.test.xml similar to the one above, and put it in the same folder as build.xml
- Add the following line to C:\Program Files\FlashDevelop\Settings\ToolBar.xml directly before </toolbar> (at the end of the file).
<button label="ANT Build and Test" click="RunProcessCaptured" image="487" tag="c:\windows\system32\cmd.exe;/c $(Quote)cd $(ProjectDir)&&ant -buildfile build.test.xml$(Quote)" />- Download this code: /files/fdant3.txt
The Alternate Method
- Create a new FlashDevelop Project named Build.
- From the Project menu, click Properties….
- From the Output tab check the No output, only run pre/post build commands box
- From the Build tab enter c:\apache-ant\bin\ant.bat in the Pre-Build Command Line box. Of course you should use the correct ant bin path.
- Click Ok
- From this project, whenever you click Build Project or Test Movie your Ant build will run.
— Pickle
Comment
New Pre-Release SubMicroSite Launched to Destroy Old Site PureMVC Port of Keith Craigo's Flex + Zend_Amf + Zend_Auth + Zend_Acl + Zend_Session


thanks a lot for your post.
you really made my work easier ;)
— sébastien · May 7, 11:17 AM · #
no problemo!
— Pickle · May 7, 08:51 PM · #
Very helpful and great icons.
Thanks.
— Trevor · Sep 19, 09:12 AM · #
Great stuff,
But I wonder the build.xml file you speak of : Do you have an example
of one ?
I would like to be able to compile my projects in FD3 with Ant, or say
Im curious how to. I set things up as per above.
But the build.xml file alludes me and have yet not readup fully on the ant documentation…
Thomas
— Thomas · Oct 24, 08:42 AM · #
@Tomas Here’s an example build.xml…
— Pickle · Oct 25, 07:49 AM · #