Stop Coding!

The Unofficial Flex Compiler Blog

HFCD Installation and Configuration

with 7 comments

As promised, I’m going to talk about how to install and configure the HellFire Compiler Daemon, a.k.a. HFCD. Again, if you’ve never heard of HFCD before, please check out the following posts:

  1. The Flex Compiler API… RPC Style
  2. A New Version of HFCD
  3. HFCD Beta Is Now Available

Before you download HFCD, make sure you meet the following system requirements:

  • Java 5 installed (Java 6 highly recommended). BTW, Flex Builder ships with JRE 5. It’s okay to use that, but the point of using HFCD is build Flex apps faster… and Java 6 is *faster* than Java 5…
  • Apache Ant installed. Mac OS X ships with Ant. If you use Windows, go download it at http://ant.apache.org.

Now, go to http://stopcoding.org/. Register and download hfcd_3.zip. The installation consists of 2 parts:

  1. Install the HFCD server and client SDK. In this step, you need hfcd_3.zip.
  2. Install the HFCD for Flex Builder plugin. In this step, you install the plugin via the Eclipse/Flex Builder Update Manager.

It’s highly recommended that you install the HFCD server and client SDK first. Once you’ve downloaded hfcd_3.zip. Unzip it in a directory called hfcd_3. Run ant.

> mkdir hfcd_3
> cp hfcd_3.zip hfcd_3
> cd hfcd_3
> unzip hfcd_3.zip

> ant server client

The ant tasks ’server’ and ‘client’ install the HFCD server and client SDK in the hfcd_3 directory. The tasks download the Flex 3.3.0 SDK automatically from Adobe (For hfcd_4, the tasks copy the Flex 4.0.0 SDK from the Flash Builder home directory). Because of that, the tasks may take a while to finish.

If you intend to run the HFCD server on a second machine, you only need to run ‘ant client’ on your Flex Builder machine. Then, download hfcd_3.zip to your second machine and run ‘ant server’ there. Alternatively, you run ‘ant client server’ on your Flex Builder machine and then simply copy the server directory over to your second machine.

After the ant tasks, please check out the JVM settings for HFCD: Open the ‘hfcd’ script (Mac OS X/Linux) or ‘jvm.config’ (Windows). The ant tasks modify the settings to something like this:

-XX:+UseParNewGC -Xms512m -Xmx1024m

You may change the -Xms and -Xmx settings. You may also change the parallel Young Generation GC to the parallel GC (-XX:+UseParallelGC). I would not add more VM settings until I see it in action. More on tuning later. If you’re happy with the default setting, go ahead and start hfcd. The HFCD server, by default, listen on port 50207 and 50208. Please make sure your firewall setting is properly configured for this.

> cd hfcd_3/server/bin
> hfcd
HellFire Compiler Daemon (hfcd) version 3

Now, you’re ready to install the HFCD for Flex Builder plugin. Note that you do NOT need to install the plugin twice for both HFCD 3 and HFCD 4.

  • Launch Flex Builder.
  • If you have a previous version of HFCD installed, click ‘Help’ –> ‘Software Updates’ –> ‘Manage Configuration’ to uninstall.
  • If you’ve never used HFCD before, click ‘Help’ –> ‘Software Updates’ –> ‘Find and Install…’.
  • Click ‘Search for new features to install’.
  • Click ‘New Remote Site…’.
  • Enter http://stopcoding.org/hfcd/3/download (orhttp://stopcoding.org/hfcd/4/download for HFCD 4) as the update site. You may use the URL as the name.
  • Click ‘Next’.
  • Choose the ‘HellFire Compiler 3.4.1′ feature.
  • Accept the license agreement.
  • Click ‘Next’, ‘Finish’ or whatever comes out. Click ‘Install All’.
  • Restart Flex Builder.

Now, it’s time to configure Flex Builder to use HFCD. There are three pieces in the configuration:

  1. Configure Flex Builder to use the HFCD client SDK.
  2. Change the HFCD hostname.
  3. Sync up source files with HFCD.

To configure Flex Builder to use the HFCD client SDK:

  • Click ‘Preferences…’ –> ‘Flex’ –> ‘Installed Flex SDKs’.
  • Add and choose the hfcd_3/client directory and set this SDK as the default SDK for Flex Builder.

To change the HFCD hostname that Flex Builder connects to:

  • Click ‘Preferences…’ –> ‘HellFire Compiler’.
  • If you intend to run HFCD locally, do nothing. Otherwise, change the hostname setting. You can use either hostname or IP address.
  • Restart Flex Builder.

To sync up your source files with HFCD:

  • Close your Flex projects in your Flex Builder workspace.
  • Reopen them.
  • Clean and Build All.

If everything is fine, you should see output from HFCD.

In the next few posts, I’m going to talk more about HFCD… about what you should expect from using HFCD.

Advertisements

Written by Clement Wong

September 29, 2009 at 11:54 am

7 Responses

Subscribe to comments with RSS.

  1. Hi Clement!! it’s been awhile, I hope your doing well.. So question for you, what about configuring IntelliJ 9 (beta) to use HFCD.. Do you think it would be possible?

    mike nimer

    September 29, 2009 at 10:51 pm

    • Hey Nimer, glad to hear from you again! I’ve not checked with IntelliJ yet, but I would say at this point there is more than just some configuration to make IntelliJ work with HFCD. To be more specific, I need an IntelliJ plugin that detects file changes and transfers the changed files to HFCD. Also, IntelliJ currently uses a fcsh wrapper (not the compiler API) to invoke the compiler.

      I think adding support for IntelliJ is pretty straightforward. The logic applies to the other IDEs as well. Perhaps the best approach is for me to publish the HFCD plugin API so those who are familiar with these IDE can do their own integration.

      Clement Wong

      September 30, 2009 at 11:14 am

  2. Hi,

    I tried using HFCD 4 with my project.
    But when i choose HFCD as default SDK for my project, it displays an error. There is no description for error, it just displays main application file name.
    While the problems window shows that there is internal error.
    please let me know what is to be done.

    Yogesh

    October 29, 2009 at 7:21 am

  3. I just checked the log file in metadata folder and found that it is not able to locate the main file.

    java.io.FileNotFoundException: D:\temp\myproject\src\myapp.mxml
    at hellfire.compiler.client.BuilderApplicationStub.init(BuilderApplicationStub.java:120)

    Though the file exists at the path, it still throwing an error, can you please tell me where i am going wrong.

    Yogesh

    October 29, 2009 at 7:53 am

    • Hi, make sure you close and open your projects after switching to HFCD. After reopening the projects, if you still see those “unable to open …” error messages, you will need to specify those files that are not managed by Flex/Flash Builder in the “HFCD FileSet” view. This post (How To Setup Your Projects for HFCD) should help. Please take a look. Also, use the latest update I made available earlier today. That fixed a couple of showstoppers.

      Clement Wong

      October 29, 2009 at 4:22 pm

  4. Just a small thing, that I haven’t testet or anything that I am 100% sure about. But I think that after I installed the HFCD plugin for FB3 my workspace stopped build automatically, and whenever I enabled it, closed FB and reopened it, it wasn’t checked to build automatically anymore, and sometimes the refresh workspace was also unchecked. Tried with different workspaces with same result. After uninstalling the plugin and remove my previous workspaces, I don’t have the issue anymore.

    I used the HFCD version 3.4.1.10084.

    Fedlarm

    November 20, 2009 at 5:18 am

    • Yeah, the plugin disables “Build Automatically” when FB3 starts because HFCD works best when “Build Automatically” is disabled. The plugin should have used a dialog box to notify users of the setting change… shouldn’t just do it silently.

      HFCD always attempts to build incrementally in the background, so technically speaking, it’s like “Build Automatically” on the HFCD side and that’s why there is no need to “Build Automatically” on the FB3 side. When “Build Automatically” is disabled in FB3, you’re free to make and save code changes while HFCD is building in the background.

      Clement Wong

      November 20, 2009 at 10:07 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: