Browse Source

Added nested <filesetref> element to <execon>.

Using

<execon ...>
  <filesetref refid="otherfileset" />
</execon>

you can reference a fileset with ID="otherfileset" defined anywhere
else in the build file.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267856 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
78b414381f
1 changed files with 23 additions and 1 deletions
  1. +23
    -1
      src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java

+ 23
- 1
src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java View File

@@ -79,6 +79,13 @@ public class ExecuteOn extends ExecTask {
filesets.addElement(set);
}

/**
* Adds a reference to a set of files (nested filesetref element).
*/
public void addFilesetref(Reference ref) {
filesets.addElement(ref);
}

/**
* Shall the command work on all specified files in parallel?
*/
@@ -98,7 +105,22 @@ public class ExecuteOn extends ExecTask {

Vector v = new Vector();
for (int i=0; i<filesets.size(); i++) {
FileSet fs = (FileSet) filesets.elementAt(i);

Object o = filesets.elementAt(i);
FileSet fs = null;
if (o instanceof FileSet) {
fs = (FileSet) o;
} else {
Reference r = (Reference) o;
o = r.getReferencedObject(project);
if (o instanceof FileSet) {
fs = (FileSet) o;
} else {
String msg = r.getRefId()+" doesn\'t denote a fileset";
throw new BuildException(msg, location);
}
}
DirectoryScanner ds = fs.getDirectoryScanner(project);
String[] s = ds.getIncludedFiles();
for (int j=0; j<s.length; j++) {


Loading…
Cancel
Save