CodeBrief

Eclipse Problem Markers from Flex Ant Builds

Two of the most popular ways to build flex projects are:

  1. Use Flex Builder
  2. Use the Flex SDK Ant tasks
In our case, we had been using 1 for development and 2 for production for some time. This gave us the best of both worlds: nice IDE features (e.g. problem markers and jumping to definitions) during development time and also the ability to fine-tune and optimize for production deployment.

Recently, however, due to increasing project complexity (project dependencies anyone?) and flex builder bugs, we have been forced to switch over to using  Flex Ant tasks exclusively. This means configuring our Eclipse projects to have an Ant Builder which executes our ant tasks in place of Flex Builder. The one benefit of this is that it increases the transparency of the build process, with only a single code path for building and saving us the headache of having to define compiler settings and modules in more than once place.

Aside from speed, the one major annoyance of this route is that no problem markers are generated during the build process. Consequently, you have to manually examine the console output. Once you manage to locate the error, you still have to parse the output, extract file names and line numbers, and manually open the files... at least until now!

The Solution: FlexMarkers

This morning I finally got fed up with this process and spent the better half of the day developing an eclipse plugin (my first one), FlexMarkers, which solves this problem. It inspects the console output from the Ant Builder as it is produced and creates problem markers for both errors and warnings. With this plugin you see mxmlc and compc errors in the Eclipse Problems view and can double click on them and go directly to the file and line number where the problem occurred. This essentially duplicates the behavior of Flex Builder, without having to use Flex Builder to build your project.

You can find the update site here: http://hempton.com/eclipse/update

So far, I have only tested it on Eclipse 3.4.2. If you use an Eclipse Ant Builder which executes <mxmlc> or <compc> tasks, definitely give it a try!

comments powered by Disqus