How to build and test
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!)
Selecting what to build
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
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.
Building
When you build, two things happen:
- First the Java source code for the author-time command-line tools, which is located in the 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.
- Then the ActionScript source code for the runtime framework, which is located in the frameworks/projects directory, is compiled using compc to create SWC files in the frameworks/libs and frameworks/locale directories.
To build everything, execute
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:
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!
Testing
To test what you've just built, execute
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
Of course, you can combine building and testing in one Ant command:
Developing
You should now be able to use the SDK that you just built to compile an application:
Cleaning
To get rid of all the output files created by building and testing, execute
Switching branches
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:
If you want to restore JAVA_HOME, ANT_HOME, and PATH to their original settings, start a new shell.
Using Eclipse
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:
Framework Flex Library projects.
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.
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.
Compiler Java projects
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.
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.
Importing projects.
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.
| You must be logged in to comment. |
|