A simple ANT - FDT4 script to compile and launch a Firefox browser

It seems that by default the FDT/ANT task to launch a browser, (fdt.viewDocument location="file") triggers the browser in the internal SWFbrowser. What I wanted was my system browser. The ANT exec tags provides you the option to do just that. It allows you trigger the browser of your choice. The full ANT script is:

[project default="doMyProject" name="PeugeotConfigurator"]
[property name="scr.dir" value="${basedir}/src" /]
[property name="deploy.dir" value="${basedir}/bin-debug" /]
[property name="browser" value="firefox" /]

[target name="doMyProject"]
[fdt.launch.application projectname="PeugeotConfiguratorMainStateMachine_FDT4"
mainclass="${scr.dir}/PeugeotConfigurator.mxml" target="${deploy.dir}/PeugeotConfigurator.swf" /]
[exec executable="${browser}" spawn="yes"]
[arg line="${deploy.dir}/index.html"]

Please note this is tested on Linux (Ubuntu). I have no idea if it solves the problem on Windows. Please use > and < in place of ] and [.


Goyapa said...

Hi i had the same issue, but as i red your post, i was thinking that Powerflasher solve an easier way to target the Browser.
So i found this soloution.
Eclipse> Window> Preferences>General> Web Browser> "Toggel button" Use external web wrowser> "check" default system brouwser. If Firefox is your current System-Browser. But thanks for this ANT script...

My Instagram