开发者

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

开发者 https://www.devze.com 2023-01-27 03:40 出处:网络
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 th

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开发者_C百科 can run the exportReleaseBuild from an ant script?


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

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

In future you can run the the task using the icon on the toolbar:

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


Just came across this situation myself, and after tweeting w/ @renaun (his blog post has some info as well: http://renaun.com/blog/2010/09/command-line-build-a-flash-builder-4-premium-feature/), it's pretty much useless for a CI build, unless you want to install FB4 premium, you can't run this task.

I was able to get it to run on my OSX environment by following the Adobe docs for it, but it doesn't mention that you have to basically run it from the command line tool. The ant that is installed as a plugin w/ the premium version has an importexport-ant.jar that is being referenced by Eclipse (standalone or plugin).

The only way I got it to run was via cmd line/terminal. It is tedious, and not really useful for a CI build. I did try to just grab the jar file, place it in the right spot, reference that in my ant script and build directly, but that made my compiler angry :(


I think I cracked it by setting up a shell script, and calling the shell script from an ant task. This way you * are * using the headless Flash Builder modus, from within Flash Builder.

Full working example at: https://gist.github.com/1077715

Thanks for the link lordB8r, that one got me thinking : )

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号