Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I use ant build to execute exportReleaseBuild task in Flash Builder 4

I'm trying to do an Ant build with FlashBuilder 4 for an Export Release Build. There is supposed to be a new (in FB4) ant task fb.exportReleaseBuild that will execute the release build. Reference to the usage is here:

http://help.adobe.com/en_US/flashbuilder/using/WSbde04e3d3e6474c4-59108b2e1215eb9d5e4-8000.html

When I include a target

..target name="exportRelease"

fb.exportReleaseBuild project="${flexproject}" ...

I generate an error indicating that the task can't be found:

Problem: failed to create task or type fb.exportReleaseBuild Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any presetde/macrodef declarations have taken place.

I look in flexTasks.jar and it doesn't include any flex.ant.exportReleaseBuild class despite having the latest jar.

Am I wrong in assuming I can run the exportReleaseBuild from an ant script?

like image 438
Danny Avatar asked Nov 25 '10 15:11

Danny


1 Answers

You have probably solved this by now, but here's the answer in case someone else needs it.

The Ant compiler is telling you that it can't find the ExportReleaseBuild task. The reason is that when Ant is run from the IDE, it runs as a separate process to Flash Builder. When you run it from the command line it runs in the same process, which is why it works.

To get this to work in the IDE:

  1. Open the build.xml file in Flash Builder
  2. Go to Run -> External Tools -> External Tools Configuration...
  3. Select Ant, then click the New Launch Configuration button
  4. Enter a name for the build task
  5. Select the Main tab:
    1. Browse to the location of the build file
    2. Browse to the location of the workspace
  6. Select the JRE tab, then tick "run in the same JRE as this Workspace" (see image below)
  7. Click Apply, then click Run

enter image description here

In future you can run the the task using the icon on the toolbar: enter image description here

like image 172
Luke Van In Avatar answered Sep 22 '22 17:09

Luke Van In