@@ -418,60 +418,62 @@ public class ExecuteOn extends ExecTask {
}
}
if (resources != null) {
if (resources != null) {
Iterator iter = resources.iterator();
Iterator iter = resources.iterator();
while (iter.hasNext()) {
while (iter.hasNext()) {
Resource res = (Resource) iter.next();
Resource res = (Resource) iter.next();
if (!res.isExists() && ignoreMissing) {
if (!res.isExists() && ignoreMissing) {
continue;
continue;
}
}
File base = null;
File base = null;
String name = res.getName();
String name = res.getName();
if (res instanceof FileResource) {
if (res instanceof FileResource) {
FileResource fr = (FileResource) res;
FileResource fr = (FileResource) res;
base = fr.getBaseDir();
base = fr.getBaseDir();
if (base == null) {
if (base == null) {
name = fr.getFile().getAbsolutePath();
name = fr.getFile().getAbsolutePath();
}
}
}
}
if (restrict(new String[] {name}, base).length == 0) {
if (restrict(new String[] {name}, base).length == 0) {
continue;
continue;
}
}
if ((!res.isDirectory() || !res.isExists())
if ((!res.isDirectory() || !res.isExists())
&& !FileDirBoth.DIR.equals(type)) {
&& !FileDirBoth.DIR.equals(type)) {
totalFiles++;
totalFiles++;
} else if (res.isDirectory() && !FileDirBoth.FILE.equals(type)) {
} else if (res.isDirectory()
totalDirs++;
&& !FileDirBoth.FILE.equals(type)) {
} else {
totalDirs++;
continue;
} else {
}
continue;
}
baseDirs.add(base);
baseDirs.add(base);
fileNames.add(name);
fileNames.add(name);
if (!parallel) {
if (!parallel) {
String[] command = getCommandline(name, base);
String[] command = getCommandline(name, base);
log(Commandline.describeCommand(command),
log(Commandline.describeCommand(command),
Project.MSG_VERBOSE);
Project.MSG_VERBOSE);
exe.setCommandline(command);
exe.setCommandline(command);
if (redirectorElement != null) {
if (redirectorElement != null) {
setupRedirector();
setupRedirector();
redirectorElement.configure(redirector, name);
redirectorElement.configure(redirector, name);
}
}
if (redirectorElement != null || haveExecuted) {
if (redirectorElement != null || haveExecuted) {
// need to reset the stream handler to restart
// need to reset the stream handler to restart
// reading of pipes;
// reading of pipes;
// go ahead and do it always w/ nested redirectors
// go ahead and do it always w/ nested redirectors
exe.setStreamHandler(redirector.createHandler());
exe.setStreamHandler(redirector.createHandler());
}
runExecute(exe);
haveExecuted = true;
fileNames.removeAllElements();
baseDirs.removeAllElements();
}
}
runExecute(exe);
haveExecuted = true;
fileNames.removeAllElements();
baseDirs.removeAllElements();
}
}
}
}
if (parallel && (fileNames.size() > 0 || !skipEmpty)) {
if (parallel && (fileNames.size() > 0 || !skipEmpty)) {
@@ -486,7 +488,6 @@ public class ExecuteOn extends ExecTask {
+ (totalDirs != 1 ? "ies" : "y") + ".",
+ (totalDirs != 1 ? "ies" : "y") + ".",
verbose ? Project.MSG_INFO : Project.MSG_VERBOSE);
verbose ? Project.MSG_INFO : Project.MSG_VERBOSE);
}
}
}
} catch (IOException e) {
} catch (IOException e) {
throw new BuildException("Execute failed: " + e, e, getLocation());
throw new BuildException("Execute failed: " + e, e, getLocation());
} finally {
} finally {