Automated Flash CS4 builds from Flash Builder
2010 September 7
VICTORY IS MINE! After hours of hacking, I managed to get Flash Builder to compile multiple FLAs, copy them to a server, and then open the target in a web browser and connect it to the console using the scripts I devised earlier. Here’s what I had to do.
- Install ANT for Flash Builder.
- Put together an ANT build file (i.e. build.xml):
<?xml version="1.0" encoding="utf-8" ?> <project name="Flash Compile" default="Compile All" basedir="./"> <property name="script" value="/Users/daleth/Projects/Oddcast/Avon/build.sh" /> <property name="browser" value="Safari" /> <property name="local.path" value="http://host.staging.oddcast.com/avon" /> <target name="Compile All"> <exec executable="${script}"> </exec> <!-- <antcall target="Open in Browser"></antcall> --> </target> <!-- Open in local browser --> <target name="Open in Browser"> <exec executable="open"> <arg line="-a ${browser} ${local.path}" /> </exec> </target> </project> - Go to your project properties in Flash Builder and then “Builders”
- Uncheck “Flex”
- Click “New…”
- Add the path to your build.xml in the Main/Buildfile box
- Go to “Targets” and “Set Targets…” for “Manual Build”
- Choose both the “Compile All” and “Open in Browser” targets and make sure they execute in that order
- Go to “Build Options” and make sure “Allocate Console” and “Launch in background” are checked.
- Go to “Run/Debug Settings” in your project properties
- Remove any “URL or path to launch” since we’re specifying it in our buildfile
- Now when you hit Command-F11, your launcher will use the new builder, and you’ll still get your console and debugger just like normal!!
Related Posts:
Pingback: Setting up Flash Builder 4 | Limina.Log