Stop Coding!

The Unofficial Flex Compiler Blog

Flex Compiler Code For HFCD Now Available Under MPL

I think all of you know that the Flex compiler code is licensed under Mozilla Public License. That means if you change the code and use it in your product, you have to make your change available under MPL. Just a moment ago, I put my source code changes (as a zip file) into the RC2 installers. If you have previously downloaded the RC2 installer and are not interested in the source code, please disregard this notice. If you are interested in the code change, especially if you’ve also made changes to the compiler code yourself for your work and want to use HFCD, please download the RC2 installers again.

The following is only applicable to HFCD 3.

In the HFCD/3.x.x directory, you should find ‘server_sdk_diff.zip’. Unzip this file and you should see these source files:

modules/compiler/src/java/flex2/compiler/Source.java
modules/compiler/src/java/flex2/compiler/as3/BytecodeEmitter.java
modules/compiler/src/java/flex2/compiler/io/FileUtil.java
modules/compiler/src/java/flex2/tools/flexbuilder/BuilderApplication.java
modules/compiler/src/java/flex2/tools/flexbuilder/BuilderConfiguration.java
modules/compiler/src/java/flex2/tools/flexbuilder/BuilderLibrary.java
modules/compiler/src/java/flex2/tools/oem/Application.java
modules/compiler/src/java/flex2/tools/oem/Builder.java
modules/compiler/src/java/flex2/tools/oem/Configuration.java
modules/compiler/src/java/flex2/tools/oem/Library.java
modules/compiler/src/java/flex2/tools/oem/PathResolver.java
modules/compiler/src/java/flex2/tools/oem/Toolkit.java
modules/compiler/src/java/flex2/tools/oem/VirtualLocalFile.java
modules/compiler/src/java/flex2/tools/oem/VirtualLocalFileSystem.java
modules/compiler/src/java/flex2/tools/oem/internal/ApplicationCompilerConfiguration.java
modules/compiler/src/java/flex2/tools/oem/internal/OEMConfiguration.java
modules/compiler/src/java/flex2/tools/oem/internal/OEMPathResolver.java
modules/compiler/src/java/flex2/tools/oem/internal/OEMReport.java
modules/compiler/src/java/flex2/tools/oem/internal/OEMUtil.java
modules/swfutils/src/java/flash/swf/SwfEncoder.java

Copy all of these files on top of a fresh copy of Flex SDK compiler. Apply your own compiler changes on top of my changes and rebuilt mxmlc.jar, flex-compiler-oem.jar and swfutils.jar. Put these three jar files into HFCD/3.x.x/server/lib and you’re all set.

Note:

  1. Uninstall HFCD before you run the installer again.
  2. You don’t rebuild the jars if you’ve never modified the compiler for your work.
  3. The change works for HFCD but it may not work for your other situations. Don’t use it for anything other than incorporating your compiler changes into HFCD.

Happy hacking.

About these ads

Written by Clement Wong

March 12, 2010 at 3:44 pm

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: