Once you have everything configured, building and testing the SDK is easy and fast --- it takes only a few minutes. (Fortunately, it's only the first-time setup that requires some effort!)
To do a build, first decide whether you want to build the trunk, a branch, or a tag. (Tags are particular releases, such as the 3.0.0.477
release.) Execute
cd flex/sdk/trunk source setup.sh
in Cygwin (on Windows) or Terminal (on Macintosh). The environment variables JAVA_HOME
, ANT_HOME
, and PATH
are now set properly for working with that particular branch.
When you build, two things happen:
modules
directory, is compiled using the J2SDK to create JAR files in the lib
directory. This includes the code for the command-line tools mxmlc
and compc
.frameworks/projects
directory, is compiled using compc
to create SWC files in the frameworks/libs
and frameworks/locale
directories.To build everything, execute
ant -q main
The -q option tells the build scripts to produce less output so that you don't get overwhelmed.
You should see output similar to this:
[javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -deprecation for details. [echo] Building lib/fdb.jar [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -deprecation for details. [echo] Building lib/mxmlc.jar [echo] Building lib/mxmlc_ja.jar [echo] Building lib/compc.jar [echo] Building lib/asdoc.jar [echo] Building lib/fcsh.jar [echo] Building lib/flex-compiler-oem.jar [echo] Building lib/optimizer.jar [echo] Building lib/digest.jar [echo] Building lib/copylocale.jar [java] asDocHelper.abc, 49082 bytes written [java] asDocHelper.exe, 647106 bytes written [echo] Building lib/flexTasks-internal.jar [echo] Building lib/flexTasks.jar [echo] Compiling frameworks/libs/framework.swc [echo] Compiling frameworks/locale/en_US/framework_rb.swc [echo] Compiling frameworks/locale/ja_JP/framework_rb.swc [echo] Compiling frameworks/libs/rpc.swc [echo] Compiling frameworks/locale/en_US/rpc_rb.swc [echo] Compiling frameworks/locale/ja_JP/rpc_rb.swc [echo] Compiling frameworks/libs/air/airframework.swc [echo] Compiling frameworks/locale/en_US/airframework_rb.swc [echo] Compiling frameworks/locale/ja_JP/airframework_rb.swc [echo] Compiling frameworks/libs/flex.swc [echo] Compiling frameworks/libs/utilities.swc [echo] Compiling frameworks/themes/HaloClassic/haloclassic.swc [echo] Compiling frameworks/projects/flash_integration/libs/FlexComponentBa se.swc [echo] ant main target completed on 01/31/2008 12:13:33 AM BUILD SUCCESSFUL Total time: 2 minutes 19 seconds
You can ignore the messages about deprecated APIs. As you can see, various JARs and SWCs got built.
The information above allows you to build the Free Adobe Flex SDK and not the individual pieces such as the Open Source Flex SDK or the Adobe Add-ons for Open Source Flex SDK.
As we're optimizing the build scripts for each SDK package, build scripts and instructions will follow maybe even before you see this note!
To test what you've just built, execute
ant -q checkintests
This will compile two test applications and run them in the standalone Flash Player under our automated testing framework (which we call Mustella).
You'll see a Flash Player window open twice and each application will quickly run as if a very fast user were interacting with it. In the Cygwin or Terminal window, you should see output like
[echo] launching player and swf [echo] compiling checkinapp [echo] launching player and swf BUILD SUCCESSFUL Total time: 39 seconds
Of course, you can combine building and testing in one Ant command:
ant -q main checkintests
You should now be able to use the SDK that you just built to compile an application:
cd dev/MyApp mxmlc MyApp.mxml
To get rid of all the output files created by building and testing, execute
ant -q clean
To work on a different branch, you don't have to open a new shell. Simply cd
to the branch and run its setup.sh
script:
cd flex/sdk/branches/3.0.x source setup.sh
If you want to restore JAVA_HOME
, ANT_HOME
, and PATH
to their original settings, start a new shell.
The SDK svn repository also includes sample Eclipse projects to assist testing, debugging and modifying the framework and compiler source. The SDK framework swcs are represented Flex Library projects, and the various modules of the SDK compiler are represented as Java projects.
Note that these projects require Flex Builder 3 / Eclipse 3.3 (or later). The Java projects require JDK 1.5.0. If Eclipse is used, the framework projects require Flex Builder 3 plugin.
Before importing any projects into a workspace, you must sync the SDK svn repository and check that ant builds successfully. You must also define a few workspace variables so that relative paths resolve to your sync of the SDK.
Note that the framework projects do not rely on the compiler module projects, and the compiler module projects do not rely on the framework projects. However, within each type of project, there may be dependencies (such as the rpc
project depends on the framework
project and so both must be imported in order to use the rpc project). The two types of projects are separated in svn as follows:
development/eclipse/flex development/eclipse/java
Before you import the framework Flex Library projects, you must create a Linked Resource Variable named FLEX_SDK
(that points to the root of your sync of the SDK from svn). Go to the Window menu and select Preferences…, navigate to General > Workspace > Linked Resources, then click the New… button to create a Linked Resource Variable.
e.g.
c:/dev/svn/flex/sdk/trunk FLEX_SDK
To use these projects in Gumbo, you need to also create a Flex SDK named Flex 4
that should point to your the root of your sync of the SDK in svn. Go to the Window menu and select Preferences…, navigate to Flex > Installed Flex SDKs, then click Add… to add a new SDK.
e.g.
Flex 4 c:/dev/svn/flex/sdk/trunk
Before you import the compiler module Java projects, you must create a Linked Resource Variables named FLEX_SDK
(that points to the root of your sync of the SDK from svn). Go to the Window menu and select Preferences…, navigate to General > Workspace > Linked Resources, then click the New… button to create a Linked Resource Variable.
e.g.
c:/dev/svn/flex/sdk/trunk FLEX_SDK
You must also create two Java Classpath Variables named FLEX_SDK
(that points to the root folder of your sync of the SDK from svn) and ANT17_JAR
(that points to the ant.jar file from your installation of ANT 1.7.0). Go to the Window menu and select Preferences…, navigate to Java > Build Path > Classpath Variables, then click the New… button to create a new Classpath Variable.
e.g.
c:/dev/svn/flex/sdk/trunk FLEX_SDK c:/dev/ant1.7.0/lib/ant.jar ANT17_JAR
Once you have setup your Eclipse workspace, all variables and run ant successfully to build the SDK, you can import the SDK projects.
Go to the File menu and select Import…, navigate to General > Existing Projects into Workspace, and then click the Browse… button to navigate to your sync of the /development/eclipse
subdirectory of the SDK from svn. You may include a subset of the projects if you are familiar with the dependencies between them.