Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0-rc-4
    • Fix Version/s: 1.0-rc-5
    • Component/s: compile
    • Labels:
      None
    • Number of attachments :
      1

      Description

      Transforms don't work at all for applications compiled with GMaven. GMaven provides a custom class loader to avoid pollution of the compile class path. As far as I remember, this class loader doesn't satisfy the assumption made by the transform implementation that it can load a transform and cast it to ASTTransformation (i.e. the instanceof check fails). I tried to address the root problem in http://jira.codehaus.org/browse/GROOVY-3169, but it was decided that it was too late for such a major change to make it into 1.6. However, some workaround has to be found so that transforms do work under GMaven by the time Groovy 1.6 is released. Otherwise, many Groovy projects won't be able to use transforms, possibly for a long time to come.

        Issue Links

          Activity

          Hide
          Jason Dillon added a comment -

          Have you been following this? Any easy fix for now in sight?

          Show
          Jason Dillon added a comment - Have you been following this? Any easy fix for now in sight?
          Hide
          Peter Niederwieser added a comment -

          By now I'm convinced that the best solution is to let CompilationUnit optionally accept a dedicated classloader for transforms. GMaven would then pass in a suitable classloader for transforms just as it does for the compile classpath. A separate classloader for transforms makes sense for a number of reasons and would be fairly easy to implement (especially because I've already done it before as part of http://jira.codehaus.org/browse/GROOVY-3169), but the big question is how to get a patch approved for 1.6.x.

          Show
          Peter Niederwieser added a comment - By now I'm convinced that the best solution is to let CompilationUnit optionally accept a dedicated classloader for transforms. GMaven would then pass in a suitable classloader for transforms just as it does for the compile classpath. A separate classloader for transforms makes sense for a number of reasons and would be fairly easy to implement (especially because I've already done it before as part of http://jira.codehaus.org/browse/GROOVY-3169 ), but the big question is how to get a patch approved for 1.6.x.
          Hide
          Jason Dillon added a comment -

          Do you have any pointers to mailing list items that relate to this problem? I'm not sure there is much I can do about this right now. I've yet to even use a transform, so I have no use case yet. I recall some talk about this... but not sure what the results were. Since Groovy 1.6 is close to a release, probably could get the fix into 1.7 or 1.6.1 or something?

          Show
          Jason Dillon added a comment - Do you have any pointers to mailing list items that relate to this problem? I'm not sure there is much I can do about this right now. I've yet to even use a transform, so I have no use case yet. I recall some talk about this... but not sure what the results were. Since Groovy 1.6 is close to a release, probably could get the fix into 1.7 or 1.6.1 or something?
          Hide
          Peter Niederwieser added a comment -

          Since this is primarily a problem with groovyc, let's move discussion to http://jira.codehaus.org/browse/GROOVY-3294.

          Show
          Peter Niederwieser added a comment - Since this is primarily a problem with groovyc, let's move discussion to http://jira.codehaus.org/browse/GROOVY-3294 .
          Hide
          Peter Niederwieser added a comment -

          Here is a new GMaven patch which incorporates Jochen's changes on the Groovy side.

          Show
          Peter Niederwieser added a comment - Here is a new GMaven patch which incorporates Jochen's changes on the Groovy side.

            People

            • Assignee:
              Jason Dillon
              Reporter:
              Peter Niederwieser
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: