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

Provide ability to pass a callback closure for Grape's grab(..) method

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.8, 2.1.3
    • Fix Version/s: None
    • Component/s: Grape

      Description

      http://jira.codehaus.org/browse/GROOVY-4687 is a first step, granted, but it's crude. Further, it requires external configuration (via the system property groovy.grape.report.downloads), which is inconvenient.

      I'd like to customize the behavior as artifacts are resolved, providing a callback to the grab method, like so:

      def count = 0
      groovy.grape.Grape.grab(group:'com.jidesoft', module:'jide-oss', version:'[2.2.0,)', callback: {
          // update a UI progress bar or do whatever here; 'it' should refer to an object with relevant information
          println "grabbed ${it.group}:${it.module}:${it.version}; ${(int)(((float)++count)/it.moduleCount)*100)}% done"
      })
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              matthewadams Matthew T. Adams
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: