Mac & PC Flex Compiler Differences

This is my first post in a long while.  I have been head down creating a new application for AOL Personal Media.  Along the way I have had a lot of experiences that I will be blogging about.  One such experience is the difference between Flex on the Mac and PC.  To reduce file size when creating Flex applications with Modules, we create libraries of class files and exclude these files from the Modules to make the smaller.   In Flex you generate a link report listing classes compiled in the main SWF file that you want to exclude from other SWF files that use the same classes.  In the PC Flex world you normally write your link report like this:

–link-report=C:/appclasses.rpt

This will write a link report to the root level of your C drive.  And to exclude the classes in a Module we load the report as follows:

–load-externs=C:/appclasses.rpt

This was all well and good until I received my new Mac laptop.  We use a CVS system to maintain our Flex code, but we mostly check in/out our code using Flex Builder on my PC.   I used our CVS system to check out our code on my Mac laptop and tried to compile it.   All sorts of mayhem ensued.   The problem is that on a Mac there is no reference to the “C” drive, and the “/” slash becomes a “\”.    Here in the following snapshots is the difference between the Flex Build Paths for the same project on PC (left) and Mac (right):

 

 

 

The main difference is the “\” and “/” in locating the external libraries and the path to the Cairngorm.swc file. I had to update this for every application and module that I checked out of CVS.  To get the project to compile at this point, I had to remove the link additional compile arguments.   I couldn’t figure out how to reference the link report on a Mac.   I eventually asked one of my co-workers who is a Mac regular to help me out.   On the Mac you need to create a folder in your user folder (Macintosh HD –> Users –> Username).  In this case, we created a folder called “flexWork”.   In the link reports we reference this folder path. The following shows the difference between the compiler accruements (for both creating and loading the reports) for PC (top) and Mac (bottom):

 

 

Once you have this setup correctly, you should be able to compile your project using the link reports.   Just remember not to overwrite your Flex property files when you check your code out of CVS again, this will undo all your work on the Mac, or vice versa if you check those into the CVS system and then check them out again on the PC.   I am still looking for one setup that will work with both PC and Mac, so they can happily share the same CVS system. 

– Mister