ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brandon, Raymond" <Raymond.Bran...@nl.compuware.com>
Subject AbstractCvsTask not executing second command???
Date Thu, 16 Jun 2005 14:49:55 GMT
Hi all,

I am using some Ant functionality straight from Java and ran into problems:
The Cvs class (extending AbstractCvsTask) seems to work fine when called in
a build script when I call it directly from Java, the first time it works
ok, but any subsequent call to the execute method does not seem to return
any output from the CVS server. The program below illustrates the problem:
running it should cause 4 files to be created: ant_out1.log, ant_err1.log,
and_out2.log and ant_err2.log. Unfortunately only the first two files are
created in which the ant_out1.log contains the version info. This problem
even reproduces when I create a new instance of the CVS class but then it
still doesn't work. Can anybody help me out here? Debugging the code did not
give me the insight I needed obviously :)

Thanks in advance,

Raymond

public class TestAntCvs {
    public static void main(String[] args) {
        Cvs cvs = new Cvs();
        Project project = new Project();
        project.init();
        cvs.setProject(project);
        cvs.setCvsRoot(":pserver:cvs-user:cvs-user@<hostname
here>:2401:/Repository");
        cvs.setFailOnError(true);
        cvs.setCommand("version");
        cvs.setOutput(new File("c:\\temp\\ant_out1.log"));
        cvs.setError(new File("c:\\temp\\ant_err1.log"));
        cvs.execute(); // Works

        cvs.setCommand("version");
        cvs.setOutput(new File("c:\\temp\\ant_out2.log"));
        cvs.setError(new File("c:\\temp\\ant_err2.log"));
        cvs.execute(); // Does not do anything
    }
}


-- 
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message