Commit bbcb211d authored by Bill Lynch's avatar Bill Lynch Committed by bill

Added ability to exclude dirs and do an 'ifexists' check.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@471 b35dd754-fafc-0310-a699-88a17e54d16e
parent 36f3fd70
...@@ -13,6 +13,7 @@ package org.jivesoftware.ant; ...@@ -13,6 +13,7 @@ package org.jivesoftware.ant;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import java.io.File; import java.io.File;
...@@ -27,6 +28,7 @@ public class SubDirInfoTask extends Task { ...@@ -27,6 +28,7 @@ public class SubDirInfoTask extends Task {
private String property; private String property;
private String delimiter; private String delimiter;
private String ifexists; private String ifexists;
private String except;
public SubDirInfoTask() { public SubDirInfoTask() {
} }
...@@ -66,6 +68,14 @@ public class SubDirInfoTask extends Task { ...@@ -66,6 +68,14 @@ public class SubDirInfoTask extends Task {
this.ifexists = ifexists; this.ifexists = ifexists;
} }
public String getExcept() {
return except;
}
public void setExcept(String except) {
this.except = except;
}
public void execute() throws BuildException { public void execute() throws BuildException {
// Get the siblings of the given directory, add sub directory names to the property // Get the siblings of the given directory, add sub directory names to the property
File[] subdirs = dir.listFiles(); File[] subdirs = dir.listFiles();
...@@ -85,12 +95,16 @@ public class SubDirInfoTask extends Task { ...@@ -85,12 +95,16 @@ public class SubDirInfoTask extends Task {
add = true; add = true;
} }
} }
if (add) { if (add && !subdir.getName().equals(except)) {
buf.append(sep).append(subdir.getName()); buf.append(sep).append(subdir.getName());
sep = getDelimiter(); sep = getDelimiter();
} }
} }
if (buf.length() == 0) {
log("No tokens found.", Project.MSG_DEBUG);
}
if (buf.length() > 0) { if (buf.length() > 0) {
log("Setting property '" + property + "' to " + buf.toString(), Project.MSG_DEBUG);
getProject().setProperty(property, buf.toString()); getProject().setProperty(property, buf.toString());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment