groovy
  1. groovy
  2. GROOVY-2900

Allow Ant targets declaration by AntBuilder without immediate execution.

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6-beta-1
    • Fix Version/s: 2.4.0-beta-1
    • Component/s: Ant integration
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently it is not possible to use AntBuilder to declare targets without invoking them.
      When antBuilder.target(..)

      {...}

      is invoked, the target is executed immediately.
      This also makes difficult to declare targets complex with dependencies.

      It would be great if antBuilder.target

      {..}

      only created target without invoking it.
      Then it would be possible to invoke target after all configuration is done.

        Activity

        Hide
        Pascal Schumacher added a comment -

        As this issue has not seen any updates for over four years I'm closing it. If it is still relevant please reopen. Thanks!

        Show
        Pascal Schumacher added a comment - As this issue has not seen any updates for over four years I'm closing it. If it is still relevant please reopen. Thanks!
        Hide
        Sergey Bondarenko added a comment -

        I am still interested in resolving this issue. It seems more convenient to follow Ant behavior and not to execute a target when it is declared.

        If the user simply wants to execute set of Ant tasks, he will not need a target. If he needs a target, he 100% does not need to execute it immediately - the user wants to define a graph of targets first.

        Show
        Sergey Bondarenko added a comment - I am still interested in resolving this issue. It seems more convenient to follow Ant behavior and not to execute a target when it is declared. If the user simply wants to execute set of Ant tasks, he will not need a target. If he needs a target, he 100% does not need to execute it immediately - the user wants to define a graph of targets first.
        Hide
        Pascal Schumacher added a comment -

        You are welcome to suggest solutions and create pull request if you have any ideas how to solve this.

        Show
        Pascal Schumacher added a comment - You are welcome to suggest solutions and create pull request if you have any ideas how to solve this.
        Hide
        Paul King added a comment -

        Proposed fix:
        https://github.com/groovy/groovy-core/pull/438

        This leaves "target" as executed immediately (for backwards compatibility) but if you use "defineTarget", execution is deferred. See the test case for an example.

        Show
        Paul King added a comment - Proposed fix: https://github.com/groovy/groovy-core/pull/438 This leaves "target" as executed immediately (for backwards compatibility) but if you use "defineTarget", execution is deferred. See the test case for an example.
        Hide
        Pascal Schumacher added a comment -

        @Paul: Your pull request was merged, so I'm resolving this.

        Show
        Pascal Schumacher added a comment - @Paul: Your pull request was merged, so I'm resolving this.
        Hide
        Paul King added a comment -

        Thanks!

        Show
        Paul King added a comment - Thanks!

          People

          • Assignee:
            Paul King
            Reporter:
            Sergey Bondarenko
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: