AS3 with Ant in FlashDevelop: Solved!

Earlier I had posted my AS3 FlashDevelop Project Template, but in the end had to recant due to the fact that when you launch Ant from FlashDevelop, it runs it from the directory of the currently open file, which is usually not the same as the project directory, and means Ant can’t find your build.xml and the whole thing fails.

But a solution has been hacked together by Philippe at FlashDevelop.org. You simply create a multicommand shortcut, first changing the directory to the project dir, then running Ant. It is outlined here: http://www.flashdevelop.org/community/viewtopic.php?t=436

[edited above link to point to the actual solution]

And essentially comes down to a line like this:

< button label="ANT Build" click="RunProcessCaptured" image="23" tag="c:\windows\system32\cmd.exe;/c @QUOTEcd @PROJECTDIR&&ant@QUOTE" />

in your toolbar.xml file, as discussed in the last entry. You can play around with the image number, and add a shortcut, as I did earlier, but this works like a charm.

I had switched over to the FlashBuild pluging for FlashDevelop. It’s a nice tool, and I have nothing bad to say about it. If you are not familiar with Ant already, I highly recommend checking it out. But I am comfortable working with Ant, so it’s great to have a solution for this.

This entry was posted in General. Bookmark the permalink.

Leave a Reply