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

Groovy Support for annotations on package declarations and imports

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.7-beta-1
    • ast builder
    • None
    • Patch

    Description

      It would be good to support annotations for package definitions and import statements.
      It would allow scripts like this:

      @Grab(group='commons-lang', module='commons-lang', version='2.4')
      package foo
      
      @Grab(group='com.google.collections', module='google-collections', version='1.0-rc2')
      import com.google.common.collect.HashBiMap
      import static org.apache.commons.lang.WordUtils.*
      
      def fruit = [grape:'purple', lemon:'yellow', orange:'orange'] as HashBiMap
      assert capitalize(fruit.inverse().yellow) == 'Lemon'
      

      Attachments

        1. GROOVY-3593-D.patch
          27 kB
          Paul King
        2. GROOVY-3593-E.patch
          39 kB
          Paul King
        3. GROOVY-3593-G.patch
          56 kB
          paulk_asert

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: