Stop Coding!

The Unofficial Flex Compiler Blog

Posts Tagged ‘Apache Ant

What’s New in the latest HFCD Build (2010-09-18)?

In the past couple of months, I managed to fix a few issues and add some enhancements to HFCD. They are now in the latest HFCD build (2010-09-18). Let me briefly describe what they are:

Exclusion Filters

The default behavior of the HFCD plugin is to upload all of the files in a Flex project to HFCD. This obviously is not ideal because a lot of these files are unnecessary for Flex compilations. So now there is a “Exclusion Filters” preference panel under “HellFire Compiler”. You can specify files and directories that you don’t want to be transferred to HFCD there. The default value is “.svn”, which you all know, is a directory created by Subversion. You could add a few more, e.g. .settings, bin-release, etc.

Launch Server

In order to use HFCD, a developer must start HFCD from Terminal (Mac OSX) or Command Prompt (Windows) before he/she starts Flex/Flash Builder. This is one extra step that some developers would like to skip. They would like to see Flex/Flash Builder to launch HFCD automatically. Well, as you know, the HFCD installer automatically setups a launch configuration in Flex/Flash Builder:

The HFCD plugin could simply launch HFCD based on this launch configuration. So now there is a “Launch Server” preference panel under “HellFire Compiler”. You could specify the name of the launch configuration in this preference panel. The HFCD plugin will take care of starting HFCD when the workbench loads and shutting down HFCD when the workbench closes. If you don’t specify a launch configuration name in this preference panel, it’s okay… that means you prefer to launch HFCD manually.

New <property> Tags in Auto-generated build.xml

Developers can use the “Generate Apache Ant build.xml” function to generate build.xml for their workspaces. It’s great for using such build.xml in CI. The paths in build.xml come from the compiler and therefore they are all fully-qualified paths. Usually, before you can use the build.xml file in your CI environment, you need to fix the paths. But the paths are everywhere in build.xml… making it quite cumbersome to fix. Now, there are 3 new <property> tags (${fb.workspace.dir}, ${user.home} and ${flex.sdk.dir}) for three of the most common paths. Hope this consolidation helps.

Turn Off HFCD Background Build During Debugging

Some developers like to make code changes while debugging. As you know, code changes trigger HFCD background builds. If you’re debugging, the background builds might slow down debugging. Now, the HFCD plugin detects whether debugging is in progress and instructs HFCD not to run background builds after receiving code changes.

HFCD “References” View

The primary function of the Flex compiler is to generate SWF output. But there are so many things that the compiler knows about. For example, given a definition, the compiler knows about its dependencies and its references. The dependencies are not difficult for developers to figure out because one can pretty much see that in the import statement list. However, it’s quite challenging to manually and accurately locate all of the references given a definition. One could use Flash Builder’s “References –> Workspace” feature but it takes extremely long time to execute at times. Now there is a new HFCD “References” View.

You simply open a file (MXML or AS). Set the editor active and open the “References” view. The view would ask HFCD for the dependencies and references for the definitions in the active editor window.


And of course the compiler knows the bytecode it generates for the classes in your projects. One way to learn ABC bytecode is to look at what the compiler generates for the code you write. Now with HFCD, if you highlight a few lines of your code in the active editor and open the HFCD “ABC” view, the HFCD plugin would ask HFCD to return the bytecode that corresponds to the code on the highlighted lines.

The screenshot below shows the bytecode for the AS code on line 1445-1451 in

The HFCD “ABC” view is work in progress (the output could be better though…).

Written by Clement Wong

September 19, 2010 at 11:28 pm

HFCD zip Arhives for Ant Lovers

Some developers don’t use Flex Builder and wonder how they can use HFCD from the command line or with their favorite Flex IDEs.

I have just made some HFCD zip archives available:

You don’t have to download all of them… just pick the version that you intend to use.

Unzip the archive. You’ll find a build.xml inside. Edit ${flex.sdk.dir} to point to your corresponding Flex SDK installation directory. Run ant. After running build.xml, you should see the HFCD “client” directory and HFCD “server” directory.

You start HFCD by running server/bin/hfcd. If you want to use ant to call HFCD, use client/lib/hfcd-ant-tasks.jar. For more information on how to use the HFCD ant tasks, please check out the HFCD ant task language reference:

Some developers want to see Maven/Flexmojos support. I like that idea too and I’m going to investigate. Stay tuned.

Written by Clement Wong

July 21, 2010 at 10:00 am

HFCD For Flex 4.1 Now Available

Dear readers,

HFCD for Flex 4.1 is now available. Sorry for the delay. I thought it would take me a week or two to release it. But I wasted a little bit of time working on the wrong Flex SDK revision! Boo…

The good news is that there is no Flex Compiler API changes in Flex 4.1. However, there will be some new methods added to the API in the upcoming Flex 4.5.

I think the most notable fix in the compiler in 4.1 is SDK-25206. If you occasionally switch between airglobal.swc and playerglobal.swc in your Flex Builder workspace, you may run into this issue. But this is a good fix and helps build performance too.

HFCD For Flex 4.1 Coming Soon…

leave a comment »

I started working on an HFCD update for Flex 4.1 yesterday. Looks like it will not be a lot of work for me so I plan to make it available early next week.

If you would like to know the progress, you can follow me on (@stopcoding) Twitter.

HFCD 4 Is Now Officially Available.

Hi, I’m pleased to announce that HFCD 4 is now officially available.

HFCD 4 for Flash Builder achieves better Flex (full and incremental) build performance than Flex 3 and Flex 4 by utilizing:

  1. all of the Flex 4 compiler performance improvements
  2. multicore processor technology
  3. techniques to build Flex apps in the background.

and allows builds to be distributed to multiple machines on a local network. The HFCD ant tasks also make it easy to integrate HFCD with custom build systems or popular build systems like Hudson CI, etc.

To learn more about HFCD, please visit

Those who purchased HFCD 3 before today will receive their FREE copies of HFCD 4. Sorry, this special offer ends today.

But don’t be disappointed. If you find a HFCD bug and file it and I can reproduce it, you will get a HFCD license for free. Click here for details. The offer ends by the end of this month (2010/04) but I’m going to extend it until further notice…

Download HFCD:

Using Apache Ant To Run Parallel HFCD Builds

with one comment

In several of my previous posts about the use of the HFCD ant tasks,

I only mentioned in the build.xml example that you can connect to one HFCD server instance. What I did not mention was that you could script your build.xml to connect to multiple HFCD server instances by using the Apache Ant <parallel> task.

        <hfcd hostname="host1" buildData="${basedir}/build.hfcd.1">
        <hfcd hostname="host2" buildData="${basedir}/build.hfcd.2">
        <!-- more hfcd tasks... -->

The build.xml code snippet above shows the use of the Apache Ant <parallel> task with the <hfcd> task. If you are able to separate your extremely large project workspace into multiple pieces (e.g. project workspace with a large number of modules), you could use the above technique to distribute the build to multiple HFCD server instances, further improving overall build performance.

I did not mention it then because the above technique was not possible without being able to store the build data sent from multiple HFCD server instances separately. But now, it is possible. In the latest HFCD build (i.e. build 20100420), I added the buildData tag attribute to the <hfcd> task. The tag attribute specifies the directory where build data from a HFCD server instance should be stored.

The latest HFCD build is here:

The HFCD Ant Task Language Reference is here:

Written by Clement Wong

April 20, 2010 at 2:19 pm

HFCD 4 Now Supports Flex and Flash Builder 4 Final!

Last week was an exciting week. Flex 4 and Flash Builder 4 were out FINALLY! I had HFCD 3 going final as well… actually, one business day before the Flex 4 official announcement!

Now that Flex 4 and Flash Builder 4 are available, it’s time to upgrade HFCD 4 from supporting Gumbo beta 2 to the Flex 4 final release. I spent some time last week porting and testing some codes and I’m pleased to announce that HFCD 4 (remains in beta) now supports Flex 4 and Flash Builder 4.

It’s true that HFCD 4 currently remains in beta. I just want to hear some more feedback and work out some more kinks before upgrading its status. If you ask me, I’d rate this update closer to release candidate than early beta w.r.t. quality.

As I mentioned in my previous post, HFCD is now a product of Bytecode Workshop, Inc. You can download the installers there. Several useful links are below:

After using the compiler in Flex 4 for a few days, I can see that the compiler is faster than its Flex 3 counterpart. Congrats to the folks at Adobe on this achievement. But since HFCD uses whatever is improved in Flex and it’s architected differently (and of course, with the use of multi-core technology), HFCD continues to outperform Flex in most medium-to-large project workspace situations. The build performance when combining Flash Builder 4, Flex 4 and HFCD 4 is truly amazing and I had already talked about it awhile back.

My plan is that HFCD 4 will not stay long in the beta status and will move aggressively towards the final release, so please help me by trying it when you get a chance. Thanks!