ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java
Date Tue, 28 Mar 2000 20:40:19 GMT
costin      00/03/28 12:40:18

  Modified:    src/main/org/apache/tools/ant Project.java
               src/main/org/apache/tools/ant/taskdefs Ant.java
  Log:
  Added "output" parameter to Ant - it will allow the redirection of output.
  
  Revision  Changes    Path
  1.16      +4 -0      jakarta-ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Project.java	2000/03/19 20:27:44	1.15
  +++ Project.java	2000/03/28 20:40:16	1.16
  @@ -150,6 +150,10 @@
           return this.out;
       }
   
  +    public void setOutput(PrintStream out) {
  +        this.out=out;
  +    }
  +
       public int getOutputLevel() {
           return this.msgOutputLevel;
       }
  
  
  
  1.6       +15 -0     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Ant.java	2000/02/24 00:57:43	1.5
  +++ Ant.java	2000/03/28 20:40:18	1.6
  @@ -82,6 +82,7 @@
       private String dir = null;
       private String antFile = null;
       private String target = null;
  +    private String output = null;
   
       Vector properties=new Vector();
       Project p1;
  @@ -104,6 +105,16 @@
        */
       public void execute() throws BuildException {
           if( dir==null) dir=".";
  +	
  +	if( output != null ) {
  +	    try {
  +		PrintStream out=new PrintStream(new FileOutputStream(output));
  +		p1.setOutput( out );
  +	    } catch( IOException ex ) {
  +		project.log( "Ant: Can't set output to " + output );
  +	    }
  +	}
  +
   	p1.setBasedir(dir);
           p1.setUserProperty("basedir" , dir);
   
  @@ -137,6 +148,10 @@
   
       public void setTarget(String s) {
           this.target = s;
  +    }
  +
  +    public void setOutput(String s) {
  +        this.output = s;
       }
   
       // XXX replace with createProperty!!
  
  
  

Mime
View raw message