The Flex4Migration branch is almost ready to replace trunk. After a few more hours of work today, I was able to resurrect the Ant-only build process. This required some significant changes to the build script and also an addition to build.properties. A few things I’ve discovered along the way:
- For some reason, you can’t be looking at build.xml when you try to build and run the project. If you are, you get that “out of heap space” error I was yelling about yesterday. I guess this means I owe Adobe an apology, since their compiler apparently isn’t that bloated.
- Adobe added some syntax highlighting niceties to the code editor in FB4. Sadly, they still fall woefully short of where they should be. When I edit a Java file in Eclipse, I get warnings and errors displayed as I type. In FB4, you don’t get anything until you re-compile, and you have to use the Flex builder; the Ant builder won’t do it, despite the fact that you’re using the mxmlc task. This means we have to continue using the “look at ant.out to find out why it failed” method for fixing compile problems.
- Flex Profiler is no longer a hog that takes over the console. Instead, FB4 just empties the console window altogether and says “no consoles to display at this time” after the Ant build finishes which is just as (un)helpful.
- Content Assist is much improved. Like the syntax highlighting though, this still falls short. If you mouse over a field or method, you’ll get a box (as in Java) containing the appropriate ASDoc, but only if the field/method/etc is part of the class of the object. If it’s inherited from an ancestor class, you get nothing.
- The hanging bug reappeared when I returned to a full Ant build. When I began tracking it down, I discovered that setting the compiler for compatibility with version 3 fixed the problem. Curious, I checked Adobe’s documentation to find out precisely what effect this setting has. The only thing on the list that seemed to apply to us is that the default theme in Flex 4 is the “Spark” theme, as opposed to the “Halo” theme in Flex 3. So I changed the build file to eliminate the compatibility setting and tell the compiler to use the Halo theme. Voila! Problem solved. A new theme was what utterly broke the app in a real browser (though it continued to work in the standalone debug player, curiously). Great job, Adobe.
- I neglected to mention the “conditional compilation is broken” issue in my list yesterday. This was a problem with the error highlighting, but since that doesn’t work anymore now that we’re back to a pure Ant build, it’s no longer an issue. Adobe’s documentation for Flex 4 indicates that the system for conditional compilation hasn’t changed, so apparently their syntax checker is just broken or something.
- The new web services system has a significant drawback in comparison to the old system. Since CallResponders are generic and no specific subclasses are generated, all you get when the call returns is a generic ResultEvent with a reference to a generic result object. Bye-bye Type-safetyville, hello Casting City.
What all this boils down to is that the list of remaining issues is now much shorter. All that’s left are some more minor refactorings to organize things better, killing off the old web services code, and updating the test build process. On the administrative end, I need to get a license key for FB4 from Adobe because otherwise the trial expires in 60 days. Adobe says they’ll give anyone who has an FB3 license a key for the FB4 beta, and I’ve found the form on their website, so this shouldn’t be too much of a problem. Once all this is done, I’ll replace trunk with the migrated branch and update the wiki accordingly. I’ve decided that namespace migration will wait until the final version of FB4 (and the Flex 4 SDK) is released; this will be added to the technical to-do list on the wiki when I replace trunk.
The bad news here is that I’ll have spent most of my time this week doing the migration instead of adding new functionality. There’s also going to be downtime at some point, probably next week, so I can upgrade my computer to Windows 7. This means that beta is probably going to get pushed back towards the end of B-term. Also, in case anyone was worried about it, the migration to Flex 4 will bump the minimum required version of Flash that end users will need to Flash 10. I was a little concerned about this, but according to some surveys (admittedly commissioned by Adobe, you can debate whether this biases them if you like), Flash 10 is now present on 90-95% of all computers worldwide, so it shouldn’t be a problem.
Pingback: Flex Sucks: Greatest Hits! « CaptainRichard's Blog