cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2005-01-25 Thread peterreilly
peterreilly2005/01/25 03:22:24

  Modified:src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  javadoc on exceptions
  
  Revision  ChangesPath
  1.60  +5 -1  ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- ExecuteOn.java24 Jan 2005 21:55:44 -  1.59
  +++ ExecuteOn.java25 Jan 2005 11:22:24 -  1.60
  @@ -243,6 +243,7 @@
* Create a nested Mapper element to use for mapping
* source files to target files.
* @return codeMapper/code.
  + * @throws BuildException if more than one mapper is defined.
*/
   public Mapper createMapper() throws BuildException {
   if (mapperElement != null) {
  @@ -294,6 +295,7 @@
* Create the ExecuteStreamHandler instance that will be used
* during execution.
* @return codeExecuteStreamHandler/code.
  + * @throws BuildException on error.
*/
   protected ExecuteStreamHandler createHandler() throws BuildException {
   //if we have a RedirectorElement, return a decoy
  @@ -312,6 +314,7 @@
   /**
* Run the specified Execute object.
* @param exe the Execute instance representing the external process.
  + * @throws BuildException on error
*/
   protected void runExec(Execute exe) throws BuildException {
   int totalFiles = 0;
  @@ -642,7 +645,8 @@
* @param exe the Executable to use.
* @param fileNames the Vector of filenames.
* @param baseDirs the Vector of base directories corresponding to 
fileNames.
  - *
  + * @throws IOException  on I/O errors.
  + * @throws BuildException on other errors.
* @since Ant 1.6
*/
   protected void runParallel(Execute exe, Vector fileNames,
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2005-01-24 Thread mbenson
mbenson 2005/01/24 13:55:44

  Modified:src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Javadoc
  
  Revision  ChangesPath
  1.59  +80 -51ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- ExecuteOn.java6 Dec 2004 19:27:13 -   1.58
  +++ ExecuteOn.java24 Jan 2005 21:55:44 -  1.59
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation.
  + * Copyright  2000-2005 The Apache Software Foundation.
*
*  Licensed under the Apache License, Version 2.0 (the License);
*  you may not use this file except in compliance with the License.
  @@ -68,14 +68,15 @@
   protected boolean srcIsFirst = true;
   
   /**
  - * Source files to operate upon.
  + * Add a set of files upon which to operate.
  + * @param set the FileSet to add.
*/
   public void addFileset(FileSet set) {
   filesets.addElement(set);
   }
   
   /**
  - * Adds directories to operate on.
  + * Add a set of directories upon which to operate.
*
* @param  set the DirSet to add.
*
  @@ -84,18 +85,21 @@
   public void addDirset(DirSet set) {
   filesets.addElement(set);
   }
  +
   /**
  - * Source files to operate upon.
  + * Add a list of source files upon which to operate.
  + * @param list the FileList to add.
*/
   public void addFilelist(FileList list) {
   filelists.addElement(list);
   }
   
   /**
  - * Whether the filenames should be passed on the command line as
  + * Set whether the filenames should be passed on the command line as
* absolute or relative pathnames. Paths are relative to the base
* directory of the corresponding fileset for source files or the
* dest attribute for target files.
  + * @param relative whether to pass relative pathnames.
*/
   public void setRelative(boolean relative) {
   this.relative = relative;
  @@ -103,38 +107,45 @@
   
   
   /**
  + * Set whether to execute in parallel mode.
* If true, run the command only once, appending all files as arguments.
* If false, command will be executed once for every file. Defaults to 
false.
  + * @param parallel whether to run in parallel.
*/
   public void setParallel(boolean parallel) {
   this.parallel = parallel;
   }
   
   /**
  - * Whether the command works only on files, directories or both?
  + * Set whether the command works only on files, directories or both.
  + * @param type a FileDirBoth EnumeratedAttribute.
*/
   public void setType(FileDirBoth type) {
   this.type = type.getValue();
   }
   
   /**
  - * If no source files have been found or are newer than their
  - * corresponding target files, do not run the command.
  + * Set whether empty filesets will be skipped.  If true and
  + * no source files have been found or are newer than their
  + * corresponding target files, the command will not be run.
  + * @param skip whether to skip empty filesets.
*/
   public void setSkipEmptyFilesets(boolean skip) {
   skipEmpty = skip;
   }
   
   /**
  - * The directory where target files are to be placed.
  + * Specify the directory where target files are to be placed.
  + * @param destDir the File object representing the destination directory.
*/
   public void setDest(File destDir) {
   this.destDir = destDir;
   }
   
   /**
  - * The source and target file names on Windows and OS/2 must use
  - * forward slash as file separator.
  + * Set whether the source and target file names on Windows and OS/2
  + * must use the forward slash as file separator.
  + * @param forwardSlash whether the forward slash will be forced.
*/
   public void setForwardslash(boolean forwardSlash) {
   this.forwardSlash = forwardSlash;
  @@ -146,6 +157,9 @@
*
* pSet to lt;= 0 for unlimited - this is the default./p
*
  + * @param max codeint/code maximum number of sourcefiles
  + *passed to the executable.
  + *
* @since Ant 1.6
*/
   public void setMaxParallel(int max) {
  @@ -153,10 +167,12 @@
   }
   
   /**
  - * Whether to send the source file name on the command line.
  + * Set whether to send the source file name on the command line.
*
* pDefaults to codetrue/code.
*
  + * @param b whether to add the source file to the command line.
  + *
* @since Ant 1.6
*/
   public void 

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-11-16 Thread mbenson
mbenson 2004/11/16 13:46:46

  Modified:.WHATSNEW
   src/testcases/org/apache/tools/ant/taskdefs
ExecuteOnTest.java
   docs/manual/CoreTasks apply.html
   src/etc/testcases/taskdefs/exec apply.xml
   src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Change apply's overwrite attribute name to force.  Also commit missing
  Java changes.  Oops.
  
  Revision  ChangesPath
  1.685 +1 -1  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.684
  retrieving revision 1.685
  diff -u -r1.684 -r1.685
  --- WHATSNEW  16 Nov 2004 20:58:22 -  1.684
  +++ WHATSNEW  16 Nov 2004 21:46:46 -  1.685
  @@ -86,7 +86,7 @@
   * Junit task -- display suite first.
 Bugzilla report 31962.
   
  -* apply has a new overwrite attribute that, when true, disables
  +* apply has a new force attribute that, when true, disables
 checking of target files.
   
   Changes from Ant 1.6.2 to current Ant 1.6 CVS version
  
  
  
  1.8   +2 -2  
ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
  
  Index: ExecuteOnTest.java
  ===
  RCS file: 
/home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ExecuteOnTest.java16 Nov 2004 20:58:22 -  1.7
  +++ ExecuteOnTest.java16 Nov 2004 21:46:46 -  1.8
  @@ -554,8 +554,8 @@
   executeTarget(ignoremissing);
   }
   
  -public void testOverwrite() {
  -executeTarget(overwrite);
  +public void testForce() {
  +executeTarget(force);
   }
   
   //borrowed from TokenFilterTest
  
  
  
  1.33  +1 -1  ant/docs/manual/CoreTasks/apply.html
  
  Index: apply.html
  ===
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/apply.html,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- apply.html16 Nov 2004 20:58:22 -  1.32
  +++ apply.html16 Nov 2004 21:46:46 -  1.33
  @@ -256,7 +256,7 @@
   td align=center valign=topNo, default is itrue/i/td
 /tr
 tr
  -td valign=topoverwrite/td
  +td valign=topforce/td
   td valign=topWhether to bypass timestamp comparisons
 for target files.  emSince Ant 1.7./em/td
   td align=center valign=topNo, default is ifalse/i/td
  
  
  
  1.7   +2 -2  ant/src/etc/testcases/taskdefs/exec/apply.xml
  
  Index: apply.xml
  ===
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/exec/apply.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apply.xml 16 Nov 2004 20:58:22 -  1.6
  +++ apply.xml 16 Nov 2004 21:46:46 -  1.7
  @@ -378,7 +378,7 @@
   /fail
   /target
   
  -target name=overwrite depends=init,xyz,pad if=echo.can.run
  +target name=force depends=init,xyz,pad if=echo.can.run
   presetdef name=ekko
   apply executable=echo append=true dest=${basedir}
   filelist refid=xyzlist /
  @@ -393,7 +393,7 @@
   /pathconvert
   
   ekko outputproperty=foo /
  -ekko outputproperty=bar overwrite=true /
  +ekko outputproperty=bar force=true /
   fail
   condition
   not
  
  
  
  1.57  +18 -22ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- ExecuteOn.java16 Aug 2004 21:56:24 -  1.56
  +++ ExecuteOn.java16 Nov 2004 21:46:46 -  1.57
  @@ -60,6 +60,7 @@
   private boolean addSourceFile = true;
   private boolean verbose = false;
   private boolean ignoreMissing = true;
  +private boolean force = false;
   
   /**
* Has lt;srcfilegt; been specified before lt;targetfilegt;
  @@ -181,6 +182,15 @@
   }
   
   /**
  + * Whether to bypass timestamp comparisons for target files.
  + *
  + * @since Ant 1.7
  + */
  +public void setForce(boolean b) {
  +force = b;
  +}
  +
  +/**
* Marker that indicates where the name of the source file should
* be put on the command line.
*/
  @@ -563,13 +573,7 @@
* be included on the command line.
*/
   protected String[] getFiles(File baseDir, DirectoryScanner ds) {
  -if (mapper != null) {
  -SourceFileScanner sfs = new 

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-08-16 Thread mbenson
mbenson 2004/08/16 14:56:24

  Modified:src/main/org/apache/tools/ant DirectoryScanner.java
   src/main/org/apache/tools/ant/types/optional/depend
DependScanner.java
   src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  apply differentiating between empty and up to date broke classfilesets.
  PR: 30567
  
  Revision  ChangesPath
  1.73  +20 -0 ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- DirectoryScanner.java 13 May 2004 07:06:49 -  1.72
  +++ DirectoryScanner.java 16 Aug 2004 21:56:24 -  1.73
  @@ -1054,6 +1054,16 @@
   }
   
   /**
  + * Return the count of included files.
  + * @return CODEint/CODE.
  + * @since Ant 1.6.3
  + */
  +public int getIncludedFilesCount() {
  +if (filesIncluded == null) throw new IllegalStateException();
  +return filesIncluded.size();
  +}
  +
  +/**
* Returns the names of the files which matched none of the include
* patterns. The names are relative to the base directory. This involves
* performing a slow scan if one has not already been completed.
  @@ -1119,6 +1129,16 @@
   dirsIncluded.copyInto(directories);
   Arrays.sort(directories);
   return directories;
  +}
  +
  +/**
  + * Return the count of included directories.
  + * @return CODEint/CODE.
  + * @since Ant 1.6.3
  + */
  +public int getIncludedDirsCount() {
  +if (dirsIncluded == null) throw new IllegalStateException();
  +return dirsIncluded.size();
   }
   
   /**
  
  
  
  1.20  +11 -0 
ant/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java
  
  Index: DependScanner.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DependScanner.java10 Aug 2004 17:55:41 -  1.19
  +++ DependScanner.java16 Aug 2004 21:56:24 -  1.20
  @@ -89,6 +89,12 @@
   return files;
   }
   
  +//inherit doc
  +public int getIncludedFilesCount() {
  +if (included == null) throw new IllegalStateException();
  +return included.size();
  +}
  +
   /**
* Scans the base directory for files that baseClass depends on
*
  @@ -157,6 +163,11 @@
*/
   public String[] getIncludedDirectories() {
   return new String[0];
  +}
  +
  +//inherit doc
  +public int getIncludedDirsCount() {
  +return 0;
   }
   
   /**
  
  
  
  1.56  +2 -17 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- ExecuteOn.java24 Jun 2004 19:44:02 -  1.55
  +++ ExecuteOn.java16 Aug 2004 21:56:24 -  1.56
  @@ -43,18 +43,6 @@
*/
   public class ExecuteOn extends ExecTask {
   
  -private class ExtendedDirectoryScanner extends DirectoryScanner {
  -public int getIncludedFilesCount() {
  -if (filesIncluded == null) throw new IllegalStateException();
  -return filesIncluded.size();
  -}
  -
  -public int getIncludedDirsCount() {
  -if (dirsIncluded == null) throw new IllegalStateException();
  -return dirsIncluded.size();
  -}
  -}
  -
   protected Vector filesets = new Vector(); // contains AbstractFileSet
 // (both DirSet and FileSet)
   private Vector filelists = new Vector();
  @@ -293,10 +281,7 @@
   }
   File base = fs.getDir(getProject());
   
  -ExtendedDirectoryScanner ds = new ExtendedDirectoryScanner();
  -fs.setupDirectoryScanner(ds, getProject());
  -ds.setFollowSymlinks(fs.isFollowSymlinks());
  -ds.scan();
  +DirectoryScanner ds = fs.getDirectoryScanner(getProject());
   
   if (!dir.equals(currentType)) {
   String[] s = getFiles(base, ds);
  @@ -379,7 +364,7 @@
   }
   
   if (fileNames.size() == 0  skipEmpty) {
  -ExtendedDirectoryScanner ds = new 
ExtendedDirectoryScanner();
  +DirectoryScanner ds = new 

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-06-24 Thread mbenson
mbenson 2004/06/24 12:44:02

  Modified:src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  ignoremissing is merged!
  
  Revision  ChangesPath
  1.55  +1 -1  ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- ExecuteOn.java16 Jun 2004 16:41:38 -  1.54
  +++ ExecuteOn.java24 Jun 2004 19:44:02 -  1.55
  @@ -186,7 +186,7 @@
   /**
* Whether to ignore nonexistent files from filelists.
*
  - * @since Ant 1.7
  + * @since Ant 1.6.2
*/
   public void setIgnoremissing(boolean b) {
   ignoreMissing = b;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-06-16 Thread mbenson
mbenson 2004/06/16 09:41:38

  Modified:.WHATSNEW
   src/testcases/org/apache/tools/ant/taskdefs
ExecuteOnTest.java
   src/etc/testcases/taskdefs/exec apply.xml
   docs/manual/CoreTasks apply.html
   src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Add ignoremissing attribute to apply.
  PR:  29585
  
  Revision  ChangesPath
  1.624 +6 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.623
  retrieving revision 1.624
  diff -u -r1.623 -r1.624
  --- WHATSNEW  14 Jun 2004 12:23:49 -  1.623
  +++ WHATSNEW  16 Jun 2004 16:41:38 -  1.624
  @@ -33,6 +33,10 @@
   * A new base class DispatchTask has been added to facilitate elegant 
 creation of tasks with multiple actions.
   
  +* apply has a new ignoremissing attribute (default true for BC)
  +  which will allow nonexistent files specified via filelists to
  +  be passed to the executable.  Bugzilla Report 29585.
  +
   Changes from Ant 1.6.1 to current Ant 1.6 CVS version
   =
   
  @@ -228,6 +232,8 @@
   * Add implicit nested element to macrodef. Bugzilla Report 25633.
   
   * Add deleteonexit attribute to delete.
  +
  +* Added Target.getIf/Unless().  Bugzilla Report 29320.
   
   Changes from Ant 1.6.0 to Ant 1.6.1
   =
  
  
  
  1.6   +4 -0  
ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
  
  Index: ExecuteOnTest.java
  ===
  RCS file: 
/home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ExecuteOnTest.java27 Mar 2004 21:22:59 -  1.5
  +++ ExecuteOnTest.java16 Jun 2004 16:41:38 -  1.6
  @@ -550,6 +550,10 @@
   assertNull(unexpected redirector.err content, 
getFileString(redirector.err));
   }
   
  +public void testIgnoreMissing() {
  +executeTarget(ignoremissing);
  +}
  +
   //borrowed from TokenFilterTest
   private String getFileString(String filename) throws IOException {
   String result = null;
  
  
  
  1.3   +41 -0 ant/src/etc/testcases/taskdefs/exec/apply.xml
  
  Index: apply.xml
  ===
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/exec/apply.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apply.xml 27 Mar 2004 21:22:58 -  1.2
  +++ apply.xml 16 Jun 2004 16:41:38 -  1.3
  @@ -303,6 +303,47 @@
   /apply
   /target
   
  +target name=ignoremissing
  +filelist id=xylist dir=${basedir} files=x,y /
  +filelist id=xyzlist dir=${basedir} files=x,y,z /
  +
  +touch file=x /
  +touch file=y /
  +
  +pathconvert property=xy pathsep=${line.separator}
  +path
  +filelist refid=xylist /
  +/path
  +/pathconvert
  +
  +pathconvert property=xyz pathsep=${line.separator}
  +path
  +filelist refid=xyzlist /
  +/path
  +/pathconvert
  +
  +apply executable=echo ignoremissing=true
  +   outputproperty=ignoretrue append=true
  +filelist refid=xyzlist /
  +/apply
  +
  +apply executable=echo ignoremissing=false
  +   outputproperty=ignorefalse append=true
  +filelist refid=xyzlist /
  +/apply
  +
  +fail
  +condition
  +not
  +and
  +equals arg1=${xy} arg2=${ignoretrue} /
  +equals arg1=${xyz} arg2=${ignorefalse} /
  +/and
  +/not
  +/condition
  +/fail
  +/target
  +
   target name=cleanup
   delete
   fileset refid=xyz /
  
  
  
  1.30  +6 -0  ant/docs/manual/CoreTasks/apply.html
  
  Index: apply.html
  ===
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/apply.html,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- apply.html23 Apr 2004 14:44:43 -  1.29
  +++ apply.html16 Jun 2004 16:41:38 -  1.30
  @@ -248,6 +248,12 @@
 Defaults to codefalse/code.  emSince Ant 1.6./em/td
   td align=center valign=topNo/td
 /tr
  +  tr
  +td valign=topignoremissing/td
  +td valign=topWhether to ignore nonexistent files specified
  +  via filelists.  emSince Ant 1.7./em/td
  +td align=center valign=topNo, default is itrue/i/td
  +  /tr
   /table
   

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-04-23 Thread mbenson
mbenson 2004/04/23 12:33:02

  Modified:src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Make apply differentiate between empty and up-to-date filesets/lists.
  PR: 23734
  
  Revision  ChangesPath
  1.53  +36 -5 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- ExecuteOn.java27 Mar 2004 21:22:58 -  1.52
  +++ ExecuteOn.java23 Apr 2004 19:33:02 -  1.53
  @@ -43,6 +43,18 @@
*/
   public class ExecuteOn extends ExecTask {
   
  +private class ExtendedDirectoryScanner extends DirectoryScanner {
  +public int getIncludedFilesCount() {
  +if (filesIncluded == null) throw new IllegalStateException();
  +return filesIncluded.size();
  +}
  +
  +public int getIncludedDirsCount() {
  +if (dirsIncluded == null) throw new IllegalStateException();
  +return dirsIncluded.size();
  +}
  +}
  +
   protected Vector filesets = new Vector(); // contains AbstractFileSet
 // (both DirSet and FileSet)
   private Vector filelists = new Vector();
  @@ -270,7 +282,11 @@
   }
   }
   File base = fs.getDir(getProject());
  -DirectoryScanner ds = fs.getDirectoryScanner(getProject());
  +
  +ExtendedDirectoryScanner ds = new ExtendedDirectoryScanner();
  +fs.setupDirectoryScanner(ds, getProject());
  +ds.setFollowSymlinks(fs.isFollowSymlinks());
  +ds.scan();
   
   if (!dir.equals(currentType)) {
   String[] s = getFiles(base, ds);
  @@ -291,8 +307,15 @@
   }
   
   if (fileNames.size() == 0  skipEmpty) {
  -log(Skipping fileset for directory 
  -+ base + . It is empty., Project.MSG_INFO);
  +int includedCount
  += ((!dir.equals(currentType))
  +? ds.getIncludedFilesCount() : 0)
  ++ ((!file.equals(currentType))
  +? ds.getIncludedDirsCount() : 0);
  +
  +log(Skipping fileset for directory  + base + . It is 
  ++ ((includedCount  0) ? up to date. : empty.),
  +Project.MSG_INFO);
   continue;
   }
   
  @@ -346,8 +369,16 @@
   }
   
   if (fileNames.size() == 0  skipEmpty) {
  -log(Skipping filelist for directory 
  -+ base + . It is empty., Project.MSG_INFO);
  +ExtendedDirectoryScanner ds = new 
ExtendedDirectoryScanner();
  +ds.setBasedir(base);
  +ds.setIncludes(list.getFiles(getProject()));
  +ds.scan();
  +int includedCount
  += ds.getIncludedFilesCount() + 
ds.getIncludedDirsCount();
  +
  +log(Skipping filelist for directory  + base + . It is 

  ++ ((includedCount  0) ? up to date. : empty.),
  +Project.MSG_INFO);
   continue;
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-02-27 Thread bodewig
bodewig 2004/02/27 06:57:32

  Modified:.Tag: ANT_16_BRANCH WHATSNEW
   src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
ExecuteOn.java
  Log:
  Merge
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.503.2.49 +3 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.48
  retrieving revision 1.503.2.49
  diff -u -r1.503.2.48 -r1.503.2.49
  --- WHATSNEW  27 Feb 2004 11:54:53 -  1.503.2.48
  +++ WHATSNEW  27 Feb 2004 14:57:32 -  1.503.2.49
  @@ -22,6 +22,9 @@
   * Throw build exception if target repeated in build file, but allow targets
 to be repeated in imported files. 
   
  +* apply didn't compare timestamps of source and targetfiles when
  +  using a nested filelist.  Bugzilla Report 26985.
  +
   Other changes:
   --
   
  
  
  
  No   revision
  No   revision
  1.46.2.4  +18 -1 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.46.2.3
  retrieving revision 1.46.2.4
  diff -u -r1.46.2.3 -r1.46.2.4
  --- ExecuteOn.java9 Feb 2004 22:12:18 -   1.46.2.3
  +++ ExecuteOn.java27 Feb 2004 14:57:32 -  1.46.2.4
  @@ -312,7 +312,7 @@
   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]);
  @@ -533,6 +533,23 @@
   mapper);
   } else {
   return ds.getIncludedDirectories();
  +}
  +}
  +
  +/**
  + * 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());
   }
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-02-27 Thread Matt Benson
--- [EMAIL PROTECTED] wrote:
   +* apply didn't compare timestamps of source and
 targetfiles when
   +  using a nested filelist.  Bugzilla Report
 26985.


Damn it, Stefan... now I have to merge changes
together... :)


__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2004-02-27 Thread Stefan Bodewig
On Fri, 27 Feb 2004, Matt Benson [EMAIL PROTECTED] wrote:

 now I have to merge changes together... :)

you have my sympathy. 8-)

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2003-06-25 Thread bodewig
bodewig 2003/06/25 05:13:52

  Modified:src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Remove paste error
  
  Revision  ChangesPath
  1.41  +0 -4  ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- ExecuteOn.java24 Jun 2003 09:16:10 -  1.40
  +++ ExecuteOn.java25 Jun 2003 12:13:52 -  1.41
  @@ -115,10 +115,6 @@
   /**
* Adds directories to operate on.
*
  - * pemNote that the directories will be added to the build
  - * path in no particular order, so if order is significant, one
  - * should use a file list instead!/em/p
  - *
* @param  set the DirSet to add.
*
* @since Ant 1.6
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2003-06-24 Thread bodewig
bodewig 2003/06/24 02:16:11

  Modified:.WHATSNEW
   docs/manual/CoreTasks apply.html chmod.html
   docs/manual/OptionalTasks attrib.html chgrp.html chown.html
   src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Add support for nested dirsets to apply and thus to a couple of
  subclass-tasks as well.
  
  PR: 20687
  Submitted by: Gus Heck gus dot heck at olin dot edu
  
  Revision  ChangesPath
  1.443 +7 -7  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.442
  retrieving revision 1.443
  diff -u -r1.442 -r1.443
  --- WHATSNEW  24 Jun 2003 08:44:02 -  1.442
  +++ WHATSNEW  24 Jun 2003 09:16:10 -  1.443
  @@ -335,13 +335,13 @@
   * mail has a new attribute encoding. Bugzilla Report 15434.
   
   * mail has new attributes user and password for SMTP auth.
  -maillogger can also use this.
  -The implementation only with JavaMail (encoding=MIME).
  -Implementation with plain mail remains to do.
  -Bugzilla Report 5969.
  +  maillogger can also use this.
  +  The implementation only works with JavaMail (encoding=MIME).
  +  Implementation with plain mail remains to do.
  +  Bugzilla Report 5969.
   
   * mail and mailloger support SMTP over TLS/SSL
  -Bugzilla Report 19180.
  +  Bugzilla Report 19180.
   
   * zipfileset can now be defined in the main body of a project
 and referred to with refid=xyz. Bugzilla Report 17007.
  @@ -404,8 +404,8 @@
   * With the new addsourcefile attribute, you can make apply ommit the
 source file names from the command line.  Bugzilla Report 13654.
   
  -* apply and chmod now support nested filelists as well.
  -  Bugzilla Report 15929.
  +* apply and chmod now support nested filelists as well as dirsets.
  +  Bugzilla Reports 15929 and 20687.
   
   * apply and chmod will display a summary if you set the new
 verbose attribute to true.  Bugzilla Report 19883.
  
  
  
  1.22  +13 -4 ant/docs/manual/CoreTasks/apply.html
  
  Index: apply.html
  ===
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/apply.html,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- apply.html19 May 2003 12:18:08 -  1.21
  +++ apply.html24 Jun 2003 09:16:10 -  1.22
  @@ -15,9 +15,10 @@
   the command is only executed when Ant is run on one of the specified 
operating
   systems./p
   pThe files and/or directories of a number of a
  -href=../CoreTypes/fileset.htmlFileSet/as or a
  -href=../CoreTypes/filelist.htmlFileList/as are passed as arguments
  -to the system command./p
  +href=../CoreTypes/fileset.htmlFileSet/as, a
  +href=../CoreTypes/dirset.htmlDirSet/as (emsince Ant 1.6/em)
  +or a href=../CoreTypes/filelist.htmlFileList/as (emsince Ant
  +1.6/em) are passed as arguments to the system command./p
   pIf you specify a nested a
   href=../CoreTypes/mapper.htmlmapper/a and the idest/i attribute,
   the timestamp of each source file is compared to the timestamp of a
  @@ -137,7 +138,10 @@
   td valign=topOne of ifile/i, idir/i or
 iboth/i. If set to ifile/i, only the names of plain
 files will be sent to the command. If set to idir/i, only
  -  the names of directories are considered./td
  +  the names of directories are considered.br
  +  strongNote:/strong The type attribute does not apply to
  +  nested idirset/is - idirset/is always implicitly
  +  assume type to be idir/i./td
   td align=center valign=topNo, default is ifile/i/td
 /tr
 tr
  @@ -191,6 +195,11 @@
   pYou can use any number of nested codelt;filelistgt;/code
   elements to define the files for this task and refer to
   codelt;filelistgt;/codes defined elsewhere./p
  +h4dirset/h4
  +pemSince Ant 1.6/em/p
  +pYou can use any number of nested codelt;dirsetgt;/code
  +elements to define the directories for this task and refer to
  +codelt;dirsetgt;/codes defined elsewhere./p
   h4arg/h4
   pCommand line arguments should be specified as nested
   codelt;arggt;/code elements. See a
  
  
  
  1.14  +35 -8 ant/docs/manual/CoreTasks/chmod.html
  
  Index: chmod.html
  ===
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/chmod.html,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- chmod.html23 May 2003 13:40:36 -  1.13
  +++ chmod.html24 Jun 2003 09:16:10 -  1.14
  @@ -15,10 +15,12 @@
   pSee the section on a 
href=../dirtasks.html#directorybasedtasksdirectory based
   tasks/a, on how the inclusion/exclusion of files works, and how to
   write patterns./p
  -pThis task holds an implicit a 
href=../CoreTypes/fileset.htmlFileSet/a and
  -supports all of FileSet's attributes and nested elements
  

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java

2003-03-27 Thread bodewig
bodewig 2003/03/27 05:14:31

  Modified:.WHATSNEW
   docs/manual/CoreTasks apply.html
   src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Add a forwardslash attribute to apply
  
  Submitted by: Zdenek Wagner wagner at cesnet dot cz
  
  Revision  ChangesPath
  1.374 +5 -0  ant/WHATSNEW
  
  Index: WHATSNEW
  ===
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.373
  retrieving revision 1.374
  diff -u -r1.373 -r1.374
  --- WHATSNEW  27 Mar 2003 10:02:02 -  1.373
  +++ WHATSNEW  27 Mar 2003 13:14:31 -  1.374
  @@ -179,6 +179,11 @@
   
   * New task sync that synchronizes two directory trees.
   
  +* apply has new forwardslash attribute that can force filenames to
  +  use forward slashes (/) as file separators even on platforms with a
  +  different separator.  This is useful if you want to run certain
  +  ported Unix tools.
  +
   Changes from Ant 1.5.2 to Ant 1.5.3
   ===
   
  
  
  
  1.19  +9 -1  ant/docs/manual/CoreTasks/apply.html
  
  Index: apply.html
  ===
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/apply.html,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- apply.html26 Sep 2002 13:55:28 -  1.18
  +++ apply.html27 Mar 2003 13:14:31 -  1.19
  @@ -58,6 +58,14 @@
   td align=center valign=topNo, default is ifalse/i/td
 /tr
 tr
  +td valign=topforwardslash/td
  +td valign=topwhether the absolute file names should be passed
  +  with forward slashes even if the operating system requires other
  +  file separator. The option is ignored if the system file separator
  +  is a forward slash./td
  +td align=center valign=topNo, default is ifalse/i/td
  +  /tr
  +  tr
   td valign=topos/td
   td valign=toplist of Operating Systems on which the command may be
 executed./td
  @@ -220,7 +228,7 @@
   code.o/code, replacing TARGETFILE with the absolute filename of
   the code.o/code and SOURCEFILE with the absolute name of the
   code.c/code file./p
  -hrp align=centerCopyright copy; 2000-2002 Apache Software Foundation. 
All rights
  +hrp align=centerCopyright copy; 2000-2003 Apache Software Foundation. 
All rights
   Reserved./p
   
   /body
  
  
  
  1.38  +18 -1 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- ExecuteOn.java7 Mar 2003 11:23:01 -   1.37
  +++ ExecuteOn.java27 Mar 2003 13:14:31 -  1.38
  @@ -1,7 +1,7 @@
   /*
* The Apache Software License, Version 1.1
*
  - * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights 
* reserved.
*
* Redistribution and use in source and binary forms, with or without
  @@ -83,6 +83,7 @@
   protected Vector filesets = new Vector();
   private boolean relative = false;
   private boolean parallel = false;
  +private boolean forwardSlash = false;
   protected String type = file;
   protected Commandline.Marker srcFilePos = null;
   private boolean skipEmpty = false;
  @@ -145,6 +146,14 @@
   }
   
   /**
  + * The source and target file names on Windows and OS/2 must use
  + * forward slash as file separator.
  + */
  +public void setForwardslash(boolean forwardSlash) {
  +this.forwardSlash = forwardSlash;
  +}
  +
  +/**
* Marker that indicates where the name of the source file should
* be put on the command line.
*/
  @@ -284,6 +293,7 @@
* @param baseDir filenames are relative to this dir
*/
   protected String[] getCommandline(String[] srcFiles, File[] baseDirs) {
  +final char fileSeparator = File.separatorChar;
   Vector targets = new Vector();
   if (targetFilePos != null) {
   Hashtable addedFiles = new Hashtable();
  @@ -297,6 +307,9 @@
   } else {
   name = subTargets[j];
   }
  +if (forwardSlash  fileSeparator != '/') {
  +name = name.replace(fileSeparator, '/');
  +}
   if (!addedFiles.contains(name)) {
   targets.addElement(name);
   addedFiles.put(name, name);
  @@ -379,6 +392,10 @@
   (new File(baseDirs[i], srcFiles[i])).getAbsolutePath();
   } else {