ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark.St...@dvg.de
Subject [PATCH] ClearCase.java - support for filesets
Date Wed, 04 Dec 2002 12:00:40 GMT

Hello.

We are using ant 1.5.1 and made some changes to
org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase.java. These
changes are for filesets because the original class only supported single
files so far.

[156][a101b79_dev]/ccvobs/projekte/scm/src/java/de/dvg/scm/ant/taskdefs/optional/clearcase>diff
 DVGClearCase.java ClearCase.java
63,67d62
< import org.apache.tools.ant.DirectoryScanner;
< import org.apache.tools.ant.types.FileSet;
< import org.apache.tools.ant.types.PatternSet;
< import java.io.File;
< import java.util.Vector;
69a65
>
83,84d78
<  * @author <a href="mailto:Oliver.Hartmann@dvg.de">Oliver Hartmann</a>
<  * @author <a href="mailto:Mark.Stehr@dvg.de">Mark Stehr</a>
89,92d82
<     protected Vector filesets = new Vector();
<     private int verbosity = Project.MSG_VERBOSE;
<     private boolean quiet = false;
<     private boolean failonerror = true;
137,142d126
<     /**
<      * Adds a set of files (nested fileset attribute).
<      */
<     public void addFileset(FileSet set) {
<         filesets.addElement(set);
<     }
150,188c134,135
<
<             // viewpath only when fileset not set
<             if (filesets.size() == 0) {
<                 cmd.createArgument().setValue(getViewPath());
<                 exe.setCommandline(cmd.getCommandline());
<                 return exe.execute();
<             } else {
<                 int result = 0;
<                 Commandline.Argument fileArg = cmd.createArgument();
<                 for (int i = 0; i < filesets.size(); i++) {
<                     FileSet fs = (FileSet) filesets.elementAt(i);
<
<                     DirectoryScanner ds =
fs.getDirectoryScanner(project);
<                     String[] files = ds.getIncludedFiles();
<                     File basedir = ds.getBasedir();
<                     for (int j = 0; j < files.length; j++) {
<                         File f = new File(basedir, files[j]);
<
<                         fileArg.setValue(f.getAbsolutePath());
< //                         log("Argument: " + fileArg.toString(),
< //                             quiet ? Project.MSG_VERBOSE :
Project.MSG_WARN);
<
< //                         log("Operating on file " + f.getAbsolutePath
(),
< //                             quiet ? Project.MSG_VERBOSE :
Project.MSG_WARN);
<
< //                         log("Commandline " + cmd.toString(),
< //                             quiet ? Project.MSG_VERBOSE :
Project.MSG_WARN);
<
<                         exe.setCommandline(cmd.getCommandline());
<                         result = exe.execute();
<
<                         if (result != 0) {
<                             String msg = "Failed executing: " +
cmd.toString();
<                             throw new BuildException(msg, location);
<                         }
<                     }
<                 }
<                 return 0;
<             }
---
>             exe.setCommandline(cmd.getCommandline());
>             return exe.execute();
[157][a101b79_dev]/ccvobs/projekte/scm/src/java/de/dvg/scm/ant/taskdefs/optional/clearcase>


Mark



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message