groovy
  1. groovy
  2. GROOVY-5044

Ant Groovyc compilation error in Gradle

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 2.0-beta-3, 1.8.7
    • Component/s: Ant integration, Compiler
    • Labels:
      None
    • Environment:
      MacOS 10.6.8
    • Number of attachments :
      0

      Description

      I ran the Groovyc Ant task to compile my classes within Gradle. My code uses the @Singleton annotation. The version I set in the classpath is 1.8.1. The following snippet shows the code I use:

      def groovycClasspath = getGroovyClasspath().asPath + System.getProperty('path.separator') + getTestRuntimeClasspath().asPath
      ant.taskdef(name: 'groovyc', classname: 'org.codehaus.groovy.ant.Groovyc', classpath: getGroovyClasspath().asPath)
      
      ant.groovyc(destdir: getClassesDir().canonicalPath, includeAntRuntime: false, classpath: groovycClasspath) {
          getSrcDirs().each { srcDir ->
              src(path: srcDir)
          }
      }
      

      When I run this without the attribute fork: true I get this compilation error:

      Not an ASTTransformation: org.codehaus.groovy.transform.SingletonASTTransformation declared by groovy.lang.Singleton
      

      Running Groovyc as forked process works fine. The compilation finished without an issue. Somebody on the mailing list reported the same error except that he uses Groovyc in Ant.

        Issue Links

          Activity

          CÚdric Champeau made changes -
          Field Original Value New Value
          Assignee Cedric Champeau [ melix ]
          CÚdric Champeau made changes -
          Link This issue relates to GROOVY-3294 [ GROOVY-3294 ]
          CÚdric Champeau made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.0-beta-3 [ 18244 ]
          Fix Version/s 1.8.7 [ 18317 ]
          Resolution Fixed [ 1 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              CÚdric Champeau
              Reporter:
              Benjamin Muschko
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: