From be91e2871f1367fb3667ebef7d1f1caa0be7d162 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 27 Feb 2004 14:54:58 +0000 Subject: [PATCH] with nested didn't check out-of-dateness. PR: 26985 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276168 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ .../apache/tools/ant/taskdefs/ExecuteOn.java | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index 21a7bc29d..4a1022773 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -64,6 +64,9 @@ Fixed bugs: * Throw build exception if target repeated in build file, but allow targets to be repeated in imported files. +* didn't compare timestamps of source and targetfiles when + using a nested . Bugzilla Report 26985. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java index 97c453a38..b6fd2c9fe 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java @@ -312,7 +312,7 @@ public class ExecuteOn extends ExecTask { for (int i = 0; i < filelists.size(); i++) { FileList list = (FileList) filelists.elementAt(i); File base = list.getDir(getProject()); - String[] names = list.getFiles(getProject()); + String[] names = getFilesAndDirs(list); for (int j = 0; j < names.length; j++) { File f = new File(base, names[j]); @@ -536,6 +536,23 @@ public class ExecuteOn extends ExecTask { } } + /** + * Return the list of files or directories from this FileList that + * should be included on the command line. + * + * @since Ant 1.6.2 + */ + protected String[] getFilesAndDirs(FileList list) { + if (mapper != null) { + SourceFileScanner sfs = new SourceFileScanner(this); + return sfs.restrict(list.getFiles(getProject()), + list.getDir(getProject()), destDir, + mapper); + } else { + return list.getFiles(getProject()); + } + } + /** * Runs the command in "parallel" mode, making sure that at most * maxParallel sourcefiles get passed on the command line.