To illustrate the trials and tribulations that a developer will endure to make their development environment just a little more palatable, here’s a funny little *Windows-only* hack I came up with this evening to workaround the Flex Builder bug I posted earlier:
Debugging AIR projects…can I view the framework source please?
Anyway, here we go…and believe you me…if you decide to try this at home, it is 100% UNSUPPORTED by myself, most likely Adobe, and positively Microsoft…he he.
First off, when the debugger looks for framework source code – for instance when clicking on a line item in the stack trace – it looks in:
E:\dev\flex_3_beta1\sdk\frameworks\projects\
Well, if you performed a default install of Flex Builder 3 beta 1 standalone or the plugin, the path to those framework source files is:
C:\Program Files\Adobe\Flex Builder 3\sdks\moxie\frameworks\projects
OR
C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\moxie\frameworks\projects\
So, to get around this problem:
1. Make sure that you can free up your E: drive. For instance, if you have a DVD drive at E:\ you’ll need to change the drive letter. This is done through the Disk Management snap-in in Windows Computer Management console:
- Windows Key + R (To get to the Run dialog)
- Run –> compmgmt.msc
- In the Storage node of the navigation tree you’ll see Disk Management
- From there you can right-click on the drive that is occupying E: and select Change Drive Letter and Paths…
- Complete the dialog by using the Change… button, assigning an alternate drive letter then clicking OK, OK, and closing the Computer Management console.
2. Once you’ve verified that you can free up E:, create a directory somewhere on your system and share it: read-only is fine. I created C:\srcshare and shared it. To Share a Directory:
- Right-click the directory select Sharing and Security… and follow the directions that come up
3. Now that you have that folder shared, map it as drive E: Also make sure it reconnects on logon. To map drive E: to the directory you shared:
- In Windows Explorer, open the Tools menu and select Map Network Drive…
- In the Map Network Drive… dialog:
- Drive = E:
- Folder = \\127.0.0.1\srcshare (if you’re using the same share name as me)
- Reconnect at logon = CHECKED
4. Download a handy sysinternals utility called Junction:
http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx
5. Extract junction.exe from the zipfile you downloaded somewhere to your C:\ drive – I extracted mine to C:\sysinternals – then open a command prompt and cd to the directory containing junction.exe:
at the command prompt –> cd {The directory containing junction.exe}
6. Before you can create the junction you’ll need to create the path that the Flex Builder debugger is looking at. If in step 2, you created the share directory as C:\srcshare, then you can create the path at the command prompt like:
mkdir C:\srcshare\dev\flex_3_beta1\sdk\
6. Create a junction to the framework source code. If you installed Flex Builder to the default location and used the same directory names as I did, you can create the junction using the following command at the command prompt:
junction.exe C:\srcshare\dev\flex_3_beta1\sdk\frameworks “C:\Program Files\Adobe\Flex Builder 3\sdks\moxie\frameworks”
7. Now open Flex Builder, set a debugging breakpoint somewhere in your code, and when you hit the breakpoint when debugging your app…no more “source not found”…you’ll be able to get to the Framework source code directly from your stack traces!
One last thing, I’m sure this probably can be done using symlinks on Mac, but since I don’t have a Mac I can’t say for sure. Maybe someone else can post the Mac version of this hacky workaround?