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

AntBuilder should be able to access properties defined outside of its closures

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0-beta-4
    • None
    • None

    Description

      Here's an example:

      path = [ "C:/dev", "C:/java" ]

      ant = new AntBuilder();
      ant.echo(path);

      ant.javac(srcdir:"src",
      destdir:"classes") {
      classpath {
      for (p in path)

      { pathelement(location:p) }

      }
      }

      What I'm trying to do is create a generic build script where I'm passing variables in from Java code, but executing the code gives me a error saying that the method 'classpath' does not exist (which isn't true, the actual error is that the property 'path' doesn't exist).

      As a workaround, I subclassed AntBuilder and override getProperty() to return values from the script object. This solution doesn't seem to work in the current CVS version.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cyu Calvin Yu
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: