Adobes ‘Set up your Development Environment’
All Ant Binary Downloads
Ant 1.7.1
Macports Guide
Flex SDK Forum
If you don’t have MacPorts, install that. It makes it so you don’t have to install everything from source. Then install git, svn, ant, and flex. The Flex Team uses Ant 1.7.0, so make sure you get that one:
- Mac Leopard MacPorts DMG
- Ant 1.7.0
- TextMate
- Install the TextMate bundles so it’s easier to code:
mkdir ~/Library/Application\ Support/TextMate/Bundlescd ~/Library/Application\ Support/TextMate/Bundlesgit clone git://github.com/textmate/subversion.tmbundle.gitgit clone git://github.com/viatropos/actionscript.tmbundle.gitgit clone git://github.com/viatropos/flex-tmbundle.git
sudo port install git-core +svngit clone git://github.com/viatropos/flex.gitcd flexsource setup.sh# setup flex sdk
Now that you have the basic Development Environment setup, you will need to compile the Flex SDK, run their test suite to make sure it passes, and then load it into Flex Builder.
ant -q main# ant task to compile all of flexant -q checkintests# ant task to run flex test suite, run this when you make changes to make sure everything still works
Other helpful tasks:
ant -q framework-compile# compiles just the “mx” frameworkant -q spark-compile# compiles just spark frameworkcd frameworks/projects/textLayout && ant -q compile# compiles the textLayout framework
Notes:
If ant -q checkintests doesn’t work, you will have to recompile the flex sdk.
Once you have downloaded and installed everything above, you’re ready to use the sdk in Flex:
- Go to Preferences → General → Linked Resources
- Add FLEX_SDK, and the path to the downloaded sdk, and save
- Go to Preferences → Flex → Installed Flex SDKs, and add the path to the downloaded sdk, and name it “Flex 4”.
Create your project! It’s up!
To stay up-to-date with the latest changes, whenever you get a chance, either by checking github, or just by habit, run:
git pull origin masterant -q mainant -q checkintests# only if you want
That’ll update your flex source, recompile it, and run the tests. If you have Flex Builder 3 open when you do this, you will need to refresh your project (but “refresh” doesn’t always work). What I do is make a change to the Flex Project files that you’re working on, and “build”. And make sure you empty the browser cache because it stores the old Flex SDK sometimes.
Here is a helpful command-line alias to get you to that sdk directory:
alias flexsdk="cd ~/Documents/Development/git/flex" # or wherever it is
Cheers!
The best way to learn Git is to watch this Peepcode screencast, and to get the Git book:
Here is a nice overview of the commands:
If you add something to the git cache, and you haven’t committed, and you want to remove everything to start over, do this:
git rm -r —cached . # remove added files
= This is the Unofficial Github port of Adobe Flex
== Notes
Adobe builds Flex with Cygwin on Windows XP Pro SP2.
It requires the following software that is not under source control:
J2SDK 1.5.0_13 (see http://java.sun.com/products/archive/j2se/5.0_13/index.html) Ant 1.7.0 (see http://archive.apache.org/dist/ant/binaries/)The following environment variables must be set:
JAVA_HOME ANT_HOMEThe PATH must include
bin directory of Flex SDK bin directory of Ant bin directory of JavaFor testing, the Flash Player’s mm.cfg file must have the following entries
ErrorReportingEnable=1 TraceOutputFileEnable=1and a FlashPlayerTrust file must allow local SWFs to access local files.
To build and test the SDK, execute
ant main checkintests- Make changes ONLY to the frameworks/projects directory (where the ActionScript source code is). If you want to make changes to the modules directory for the compiler, good luck remembering what you’ve done!
- Merge with the trunk at least once a week:
- svn merge http://opensource.adobe.com/svn/opensource/flex/sdk/trunk http://opensource.adobe.com/svn/opensource/flex/sdk/sandbox/viatropos/trunk
- This command merges your remote repository with the trunk
- svn merge -r currentRevision:HEAD http://opensource.adobe.com/svn/opensource/flex/sdk/trunk .
- This merges the trunk with your local repository
- svn merge http://opensource.adobe.com/svn/opensource/flex/sdk/trunk http://opensource.adobe.com/svn/opensource/flex/sdk/sandbox/viatropos/trunk
- You will likely have a lot of merge conflicts, so find them with this command:
grep -r “<<<<<<<[^<]” ./frameworks/projects - Delete the left and right conflict files, and fix anything. If you know you didn’t touch that file, just go to the adobe site and grab the source for that file and copy/paste it.
- svn update
- This updates you with YOUR REMOTE REPOSITORY, so make sure you have merged your remote repository with the trunk
- If you keep getting errors, and they’re not in the frameworks/projects directory, just delete the whole directory from the root (say the “modules” directory), and do “svn checkout ….” from the trunk.
- svn commit