Skip navigation
schtoo
Currently Being Moderated

Compiler extension for metadata processing

Jul 8, 2009 5:51 PM

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.

  • Currently Being Moderated
    Community Member
    Jul 8, 2009 7:27 PM

    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.

    |
    Mark as:
  • Currently Being Moderated
    Jul 9, 2009 8:37 AM

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

     

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

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jul 9, 2009 9:20 AM

    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.

    |
    Mark as:
  • Currently Being Moderated
    Community Member
    Jul 9, 2009 11:47 AM

    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.

    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

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