You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2001/12/04 21:43:53 UTC

DO NOT REPLY [Bug 5270] New: - Ant task - allow multiple targets

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5270>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5270

Ant task - allow multiple targets

           Summary: Ant task - allow multiple targets
           Product: Ant
           Version: 1.4.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: bdeweese@yahoo.com


I would like for the ant task to allow multiple targets in the same way that I 
can specify multiple targets on the command line when kicking off ant.

I have made the following changes to ant.java in the 1.4.1 release that does 
just that.  Most of this additional logic is cut-n-pasted from Target.java's 
code for parsing the depends attribute so it has the same error checking as 
that.


--------- start of diff -----------------------------
256a257,280
>             Vector targets = new Vector();
>             StringTokenizer tok =
>                 new StringTokenizer(target, ",", true);
>             while (tok.hasMoreTokens()) {
>                 String token = tok.nextToken().trim();
>
>                 //Make sure the target is not empty string
>                 if (token.equals("") || token.equals(","))
>                   continue;
>
>                   targets.addElement(token);
>
>                 //Make sure that target attribute does not
>                 //end in a ,
>                 if (tok.hasMoreTokens()) {
>                     token = tok.nextToken();
>                     if (!tok.hasMoreTokens() || !token.equals(",")) {
>                         throw new BuildException( "Syntax Error: Target 
attribute " +
>                                                   "for task \"" + getTaskName
() +
>                                                   "\" ends with a , 
character" );
>                     }
>                 }
>             }
>
261c285
<                 target.equals(this.getOwningTarget().getName())) {
---
>                 targets.contains(this.getOwningTarget().getName())) {
266c290
<             newProject.executeTarget(target);
---
>             newProject.executeTargets(targets);
-------------------- end of diff ------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>