2009
07.27

At the 360|Flex BugQuash, I discovered that killing bugs in the Flex framework can actually be easier that trying to decipher some bugs in my own code. How is that possible? Thanks to Adobe’s bug system, some problems are already solved for you, it’s just a matter of initiative to submit the fix to Adobe. Of course it’s not just that easy because there are a few hoops to jump through, but they’re not flaming, and are at ground level. The BugQuash even has a Pre-Event Kit that gets you ready as well. Since Flex 4 is about to go through another cycle, it’s a great time to either fix a nagging bug in Flex 3 (and let it merge down to Flex 4) or, if your feeling feisty, jump into the Flex 4 world. I’m going to put this out in multiple parts so I can hit the details.

The first step is to get familiar with the Flex SDK. If you’re a Flex developer, you’re likely already there, but you haven’t gotten your hands dirty inside the SDK code. Maybe you’ve monkey patched a flex bug. Regardless, working with the SDK is key to the bug fix.

I’m working on a windows client, so I am going to talk windows on the SDK setup. Fortunately, it’s easier to get up and running on OS X thanks to it’s Unix roots.

  1. Download the Source Code. That means getting into the subversion database itself and checking out the latest code there.
    1. Install TortiseSVN, a tool that uses windows explorer as the window to the source control world.
    2. Create a directory (I used C:\osFlexSDK) to svn the source code to.
    3. Download Adobe’s Flex project skeleton and unzip it to the directory. This will give you the trunk, branches, & tags directories
    4. (for Flex 4 work) navigate to the flex\sdk folder and right click on the trunk. Select “SVN Update”
    5. (for Flex 3 work) right click on the branches directory and hover over “Tortoise SVN” and select repo-browser. right click on the 3.x folder and select checkout. Click “OK”.
  2. Now that we have the source, it’s time to make sure we can build it. This is where I tripped up and saw some others tripped up at the BugQuash. Building should be a simple affair, especially since it’s just running ant from the command line. I’m using Adobe’s Setup on Windows guide as a baseline.
    1. Install Cygwin. The key is on the screen where you select the directory. On the bottom right of the screen there is a selection for Default Text File Type. You must select DOS/text.
      Cygwin Install
    2. Install the proper Java SDK for your build 2.4.2_14 into C:\j2sdk1.4.2_14 for Flex 3 and 5.0_13 into C:\Program Files\Java\jdk1.5.0_13 for Flex 4
    3. Install Ant (a straight unzip) for your build 1.6.2 unzipped into C:/apache-ant-1.6.2/ for Flex 3 and 1.7.0 unzipped into C:/apache-ant-1.7.0/ for Flex 4
  3. Now rig up the flash player for development use.
    1. Create the mm.cfg file in the C:\Documents and Settings\ directory if needed and add the following lines to it:
      ?Download mm.cfg
      ErrorReportingEnable=1
      TraceOutputFileEnable=1
    2. navigate to the C:\WINDOWS\system32\Macromed\Flash directory. Create a FlashPlayerTrust directory is there isn’t one there already and create a FlexSDK.cfg file with the following line:
      ?Download FlexSDK.cfg
      C:\

      You can change drives or even directories if you aren’t using the C drive for development, or even have multiple drives. Adobe suggests being as restrictive as possible for security reasons.

  4. Test your setup. This is the “easiest” part since it’s pretty much a pass/fail.
    1. Run cygwin shell and navigate to the folder you want to build. Note: All drives are under /cygdrive so c:\osFlexSDK\flex\sdk\trunk is /cygdrive/c/osFlexSDK/flex/sdk/trunk.
    2. Type “source setup.sh’ to set up the environment variables
    3. Test Java by typing “java -version” and make sure you’re on the right version for your build. If it reports and error, make sure you installed Java in the correct directory.
    4. Test ant by typing “ant-version” and make sure you’re on the right version for your build. If it reports and error, make sure you unzipped ant in the correct directory.
    5. If everything checks out, type “ant” and let the build happen
  5. You should now have a built Flex SDK in the bin directory. Congratulations!

This is continued in part 2

Related Posts (generated):

No Comment.

Add Your Comment

Switch to our mobile site