Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6008

Extension methods not recognized by Gradle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.7, 2.1.1
    • 2.1.2
    • Compiler
    • None

    Description

      If you annotate a groovy class with @TypeChecked or @CompileStatic and that the code uses an extension module, then compilation fails as if the type checker doesn't find the extension classes.

      Using

      compileTestGroovy.groovyOptions.useAnt = true

      fixes the problem.
      To reproduce, first step will build and install an extension module into local maven repo.

      $ git clone  https://github.com/swilliams-vmw/gemfire-groovy-extensions.git
      $ cd gemfire-groovy-extensions
      $ ./gradlew install
      

      Second, download this test project: http://dl.dropbox.com/u/20288797/dive...

      $ cd test
      $ ./gradlew clean test
      

      passes. Now open build.gradle, remove the useAnt=true option and the project compilation fails.

      Investigation shows that the type checker should try to load the extension modules from the source unit classpath instead of using the ones from the MetaClassRegistry.

      Attachments

        Issue Links

          Activity

            People

              melix Cédric Champeau
              melix Cédric Champeau
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: