Groovy
  1. Groovy
  2. GROOVY-1260

Using the Ant task with multiple targets fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-5
    • Fix Version/s: 1.1-rc-2
    • Component/s: Ant integration
    • Labels:
      None
    • Environment:
      Windows and Linux
      Java 1.5
      Ant 1.6.5

      Description

      From the mailing list wrap-up post by Dierk:

      <quote>
      def ant = new AntBuilder()
      ant.ant(antfile:'build.xml'){
      target(name:'one')
      }

      is working but

      def ant = new AntBuilder()
      ant.ant(antfile:'build.xml'){
      target(name:'one')
      target(name:'two')
      }

      is not. The flag 'targetAttributeSet' is set erroneously in org.apache.tools.ant.taskdefs.Ant#addConfiguredTarget.
      (possible Ant bug?)
      </quote>

      (Having looked at the Ant source myself, I can only see targetAttributeSet being set in setTarget, so personally I suspect it's not an Ant bug.)

      To find the mailing list thread, search for a subject of "AntBuilder.ant.target not working?" on Feb 23rd/24th 2006. (Web access to mailing list is down right now, hence the lack of URL.)

        Issue Links

          Activity

          Jon Skeet created issue -
          Guillaume Delcroix made changes -
          Field Original Value New Value
          Assignee Guillaume Laforge [ guillaume ]
          Hide
          Paul King added a comment -

          I don't know when this was fixed, but appears working now.

          This groovy script:

          def ant = new AntBuilder()
          ant.ant(antfile: 'GROOVY-1260.xml') {
              target(name: 'one')
              target(name: 'two')
          }
          

          with this build file:

          <project name="groovy-1260" default="one">
              <target name="one">
                  <echo message="1"/>
              </target>
              <target name="two">
                  <echo message="2"/>
              </target>
          </project>
          

          produces this output:

          one:
               [echo] 1
          
          two:
               [echo] 2
          
          Show
          Paul King added a comment - I don't know when this was fixed, but appears working now. This groovy script: def ant = new AntBuilder() ant.ant(antfile: 'GROOVY-1260.xml') { target(name: 'one') target(name: 'two') } with this build file: <project name= "groovy-1260" default = "one" > <target name= "one" > <echo message= "1" /> </target> <target name= "two" > <echo message= "2" /> </target> </project> produces this output: one: [echo] 1 two: [echo] 2
          Paul King made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Paul King [ paulk ]
          Resolution Fixed [ 1 ]
          Fix Version/s 1.1-rc-2 [ 13792 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Paul King made changes -
          Link This issue is superceded by GROOVY-3763 [ GROOVY-3763 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12730404 ] Default workflow, editable Closed status [ 12740978 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12967503 ] Default workflow, editable Closed status [ 12975216 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          589d 21h 10m 1 Paul King 17/Oct/07 00:45
          Resolved Resolved Closed Closed
          36d 5h 45m 1 Paul King 22/Nov/07 05:30

            People

            • Assignee:
              Paul King
              Reporter:
              Jon Skeet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development