FDT Ant Tasks

From FDT Documentation

(Difference between revisions)
Jump to: navigation, search
(Tasks)
Line 7: Line 7:
This bit needs a If you get the message "BUILD FAILED Could not create task or type ..." your task probably runs in another JRE. This can be corrected. Therefore got to "Run- >External Tools->External Tools..." in the main menu. Choose your run configuration and go to the tab "JRE". Change the option "Runtime JRE" from "Separate JRE" to "Run in the same JRE as the workspace".  
This bit needs a If you get the message "BUILD FAILED Could not create task or type ..." your task probably runs in another JRE. This can be corrected. Therefore got to "Run- >External Tools->External Tools..." in the main menu. Choose your run configuration and go to the tab "JRE". Change the option "Runtime JRE" from "Separate JRE" to "Run in the same JRE as the workspace".  
-
= Tasks  =
+
= FDT Tasks  =
== fdt.flashCompile  ==
== fdt.flashCompile  ==

Revision as of 15:22, 20 September 2010

FDT provides some Ant tasks of its own. To assure that these tasks work, the task has to run in the same JRE (Java Runtime Environment) as Eclipse.

Contents

JRE - A Common Pitfall

Before getting into Ant, an important concept to understand is how Ant tools, by default, run in their own JRE.

This bit needs a If you get the message "BUILD FAILED Could not create task or type ..." your task probably runs in another JRE. This can be corrected. Therefore got to "Run- >External Tools->External Tools..." in the main menu. Choose your run configuration and go to the tab "JRE". Change the option "Runtime JRE" from "Separate JRE" to "Run in the same JRE as the workspace".

FDT Tasks

fdt.flashCompile

This task compiles a single FLA or a set of FLA's with the Flash IDE. The Flash IDE must be set in the Flash Preferences (see "Preparing the workbench (AS2)"). The Flash Output is captured and shown in the console. If any error occurs the build will be aborted. You can define a timeout for how long the build waits for the output. If the timeout is not specified the task will take a 60 second timeout.

<fdt.flashCompile file="fla" timeout="t in ms " />


Arguments:

  1. file : the FLA to compile
  2. timeout : the timeout(ms) for how long the tasks wait until it fails
  3. failonerror : whether the ant should fail if flash outputs something. Default is "true"


Example: Compile for a single FLA with a timout of 5 seconds.

<project default="default"> <target name="default">
  <fdt.flashCompile file="${basedir}/start.fla" timeout="5000"> </target>
</project>


Example: Compile for a set of FLA's and two additional FLA's.

<project default="default">
  <target name="default">
    <fdt.flashCompile> 
      <fileset dir="${basedir}">
         <include name="*.fla"/>
      </fileset>
    </fdt.flashCompile>
    <fdt.flashCompile file="${basedir}/data/start.fla" failonerror="false"/> 
    <fdt.flashCompile file="${basedir}/data/main.fla"/>
   </target> 
</project>



fdt.viewDocument

Opens a document in the internal SWF Viewer. You can open all types accepted by a browser (html, php, swf, ...).

<fdt.viewDocument location="swf" />

Arguments:

  1. location : the location of the file to open.

Example: Compile for a FLA and show the created SWF in the SWF Viewer.

<project default="default">
  <target name="default">
    <fdt.flashCompile file="${basedir}/main.fla" />
    <fdt.viewDocument location="${basedir}/main.swf" /> 
  </target>
</project>



fdt.browse

Opens a document in the Browser.

<fdt.viewDocument location="url" />

Arguments:

  1. location : the location of the file to open.

Example: Open index.php located on a local server in the default browser.

<project default="default">
  <target name="default">
    <fdt.viewDocument location="http://localhost/index.php" /> 
  </target>
</project>



fdt.extSWFViewer.focusWindow

Focuses a running process. The window pop up to the foreground.

<fdt.extSWFViewer.focusWindow process="executable" />

Arguments:

  1. process : the name of the process to focus.

Example: Set focus to Eclipse.

<project default="default">
  <target name="default">
    <fdt.extSWFViewer.focusWindow process="javaw.exe" />
  </target>
</project>
Get FDT5