HFCD Installation and Configuration
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:
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:
- Install the HFCD server and client SDK. In this step, you need hfcd_3.zip.
- 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…’.
http://stopcoding.org/hfcd/4/downloadfor 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:
- Configure Flex Builder to use the HFCD client SDK.
- Change the HFCD hostname.
- 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.