ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r326980 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
Date Thu, 20 Oct 2005 19:15:53 GMT
Author: bodewig
Date: Thu Oct 20 12:15:49 2005
New Revision: 326980

URL: http://svn.apache.org/viewcvs?rev=326980&view=rev
Log:
make <apply parallel="true"> work again even if only filesets but no other resource
collections have been specified

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java?rev=326980&r1=326979&r2=326980&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java Thu Oct 20 12:15:49
2005
@@ -418,60 +418,62 @@
             }
         
             if (resources != null) {
-            Iterator iter = resources.iterator();
-            while (iter.hasNext()) {
-                Resource res = (Resource) iter.next();
+                Iterator iter = resources.iterator();
+                while (iter.hasNext()) {
+                    Resource res = (Resource) iter.next();
 
-                if (!res.isExists() && ignoreMissing) {
-                    continue;
-                }
+                    if (!res.isExists() && ignoreMissing) {
+                        continue;
+                    }
 
-                File base = null;
-                String name = res.getName();
-                if (res instanceof FileResource) {
-                    FileResource fr = (FileResource) res;
-                    base = fr.getBaseDir();
-                    if (base == null) {
-                        name = fr.getFile().getAbsolutePath();
+                    File base = null;
+                    String name = res.getName();
+                    if (res instanceof FileResource) {
+                        FileResource fr = (FileResource) res;
+                        base = fr.getBaseDir();
+                        if (base == null) {
+                            name = fr.getFile().getAbsolutePath();
+                        }
                     }
-                }
 
-                if (restrict(new String[] {name}, base).length == 0) {
-                    continue;
-                }
+                    if (restrict(new String[] {name}, base).length == 0) {
+                        continue;
+                    }
 
-                if ((!res.isDirectory() || !res.isExists())
-                    && !FileDirBoth.DIR.equals(type)) {
-                    totalFiles++;
-                } else if (res.isDirectory() && !FileDirBoth.FILE.equals(type)) {
-                    totalDirs++;
-                } else {
-                    continue;
-                }
+                    if ((!res.isDirectory() || !res.isExists())
+                        && !FileDirBoth.DIR.equals(type)) {
+                        totalFiles++;
+                    } else if (res.isDirectory()
+                               && !FileDirBoth.FILE.equals(type)) {
+                        totalDirs++;
+                    } else {
+                        continue;
+                    }
 
-                baseDirs.add(base);
-                fileNames.add(name);
+                    baseDirs.add(base);
+                    fileNames.add(name);
 
-                if (!parallel) {
-                    String[] command = getCommandline(name, base);
-                    log(Commandline.describeCommand(command),
-                        Project.MSG_VERBOSE);
-                    exe.setCommandline(command);
-
-                    if (redirectorElement != null) {
-                        setupRedirector();
-                        redirectorElement.configure(redirector, name);
+                    if (!parallel) {
+                        String[] command = getCommandline(name, base);
+                        log(Commandline.describeCommand(command),
+                            Project.MSG_VERBOSE);
+                        exe.setCommandline(command);
+
+                        if (redirectorElement != null) {
+                            setupRedirector();
+                            redirectorElement.configure(redirector, name);
+                        }
+                        if (redirectorElement != null || haveExecuted) {
+                            // need to reset the stream handler to restart
+                            // reading of pipes;
+                            // go ahead and do it always w/ nested redirectors
+                            exe.setStreamHandler(redirector.createHandler());
+                        }
+                        runExecute(exe);
+                        haveExecuted = true;
+                        fileNames.removeAllElements();
+                        baseDirs.removeAllElements();
                     }
-                    if (redirectorElement != null || haveExecuted) {
-                        // need to reset the stream handler to restart
-                        // reading of pipes;
-                        // go ahead and do it always w/ nested redirectors
-                        exe.setStreamHandler(redirector.createHandler());
-                    }
-                    runExecute(exe);
-                    haveExecuted = true;
-                    fileNames.removeAllElements();
-                    baseDirs.removeAllElements();
                 }
             }
             if (parallel && (fileNames.size() > 0 || !skipEmpty)) {
@@ -485,7 +487,6 @@
                     + totalDirs + " director"
                     + (totalDirs != 1 ? "ies" : "y") + ".",
                     verbose ? Project.MSG_INFO : Project.MSG_VERBOSE);
-            }
             }
         } catch (IOException e) {
             throw new BuildException("Execute failed: " + e, e, getLocation());



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


Mime
View raw message