Skip navigation
Home/Support/

Forums

3937 Views 6 Replies Latest reply: Jul 9, 2009 11:47 AM by AndrewWestberg RSS
schtoo Calculating status... 4 posts since
Jul 8, 2009
Currently Being Moderated

Jul 8, 2009 5:51 PM

Compiler extension for metadata processing

This is carry over discussion from: http://bugs.adobe.com/jira/browse/SDK-18718

 

I'm looking to do some custom metadata processing in a compiler extension.  There is an old extension mechanism and a newer one.  I think either would work for me but I do have some questions.  I'm hoping to trailblaze metadata processing and make my work public for anyone to use.  I've already heard from one Flex framework developer whose looking for the same functionality.  Ideally, I can come up with capabilities that rival Java's annotation processing and everyone can benefit.

 

First question: Using either of the extension mechanisms, can I report a compilation error complete with line number and error message?

 

Second question: Has anyone put any thought into using these extension mechanisms within FlashBuider.  I'm an experienced Eclipse plug-in developer and these compiler extensions don't make much sense if they can't be added to a FB workbench.  The newer extension mechanism allows you to add a jar for an extension via the compiler arguments, but I'm not sure this makes much sense when running inside Eclipse.  Ideally, the FlashBuilder  compiler code would provide an Eclipse extension point for compiler extensions.

 

I'm eager and willing to do the necessary work to make this possible including providing patches,etc.  Heck I'd even be willing to do the work required to add an extension point in FB.

  • AndrewWestberg Calculating status... 19 posts since
    Aug 16, 2008
    Currently Being Moderated
    1. Jul 8, 2009 7:27 PM (in response to schtoo)
    Re: Compiler extension for metadata processing

    To answer the question about why not a FlashBuilder plugin...

     

    We originally considered that approach.  The problem is that not everybody or every project uses FB.  Quite a few are using FDT, or simply the SDK along with ANT or Maven /w flex-mojos for doing builds.  By making the extension points accessible as a cmd-line option, we open up the functionality to everybody.  Inside the FlashBuilder project properties, it's fairly trivial to modify the cmd-line options.  Most people are familiar with this area for doing other things like setting the pre-loader background color in a Flex project.

     

    If you wanted to create a plugin for your own particular extension point, it probably wouldn't be too hard to modify the cmd-line properties for the user when they add your plugin's nature to the project.  Adding your plugin's nature to a project could also copy the necessary jar file into the project for the user.

     

    I believe other eclipse plugins work this way.  The new Google Appengine plugin does similar things to convert a project into an appengine project.

  • Paul Reilly User 161 posts since
    Nov 8, 2007
    Currently Being Moderated
    3. Jul 9, 2009 8:37 AM (in response to schtoo)
    Re: Compiler extension for metadata processing

    For the logging of errors, you'll want to do something like:

     

      flex2.compiler.util.ThreadLocalToolkit.logError(path, line, errorMessage);

  • AndrewWestberg User 19 posts since
    Aug 16, 2008
    Currently Being Moderated
    4. Jul 9, 2009 9:20 AM (in response to schtoo)
    Re: Compiler extension for metadata processing

    I really like the idea of Adobe making it easier to add extensions to a project inside FB.  Unfortunately, we don't have as much say in the FB project since it's closed-source and we'd have to get this added to their timeline /w a high enough priority.  It might be nice to have an nice pretty project properties screen where you could add/delete/re-order compiler extensions assigned to a given project instead of hacking on the one cmd-line field for each extension you wanted to assign to a project.

  • AndrewWestberg User 19 posts since
    Aug 16, 2008
    Currently Being Moderated
    6. Jul 9, 2009 11:47 AM (in response to schtoo)
    Re: Compiler extension for metadata processing

    I believe it's relative to the current working directory.  It certainly doesn't have to exist inside the project if you put in an absolute path to the jar file.

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points