svn commit: r597455 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java

2007-11-22 Thread stevel
Author: stevel
Date: Thu Nov 22 09:11:26 2007
New Revision: 597455

URL: http://svn.apache.org/viewvc?rev=597455&view=rev
Log:
Bugzilla Bug 43624
symlink task failonerror="false" does not stop build from failing when 'ln' 
command returns non-zero

Modified:
ant/core/trunk/WHATSNEW

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=597455&r1=597454&r2=597455&view=diff
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Nov 22 09:11:26 2007
@@ -46,6 +46,9 @@
 
  *  task couldn't overwrite files that were in the way of the symlink.
Bugzilla report 43426.
+   
+ *  task failonerror="false" does not stop build from failing when 
'ln' 
+   command returns non-zero. Bugzilla report 43624  
 
  *  task couldn't differentiate between "no resources specified" and 
"no resources
matched."  Bugzilla report 43799.

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=597455&r1=597454&r2=597455&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
 Thu Nov 22 09:11:26 2007
@@ -443,6 +443,7 @@
  *
  * @param properties The properties object to be written.
  * @param dirThe directory for which we are writing the links.
+ * @throws BuildException if the property file could not be written
  */
 private void writePropertyFile(Properties properties, File dir)
 throws BuildException {
@@ -498,7 +499,16 @@
 }
 }
 String[] cmd = new String[] {"ln", options, res, lnk};
-Execute.runCommand(this, cmd);
+try {
+Execute.runCommand(this, cmd);
+} catch (BuildException failedToExecute) {
+if(failonerror) {
+throw failedToExecute;
+} else {
+//log at the info level, and keep going.
+log(failedToExecute.getMessage(), failedToExecute, 
Project.MSG_INFO);
+}
+}
 }
 
 /**



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



svn commit: r597453 - /ant/core/trunk/WHATSNEW

2007-11-22 Thread stevel
Author: stevel
Date: Thu Nov 22 09:08:11 2007
New Revision: 597453

URL: http://svn.apache.org/viewvc?rev=597453&view=rev
Log:
43936:  errors are unhelpful

Modified:
ant/core/trunk/WHATSNEW

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=597453&r1=597452&r2=597453&view=diff
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Nov 22 09:08:11 2007
@@ -49,6 +49,8 @@
 
  *  task couldn't differentiate between "no resources specified" and 
"no resources
matched."  Bugzilla report 43799.
+   
+   
 
 
 Other changes:
@@ -59,6 +61,10 @@
to provide filenames, rather than require that all resources
are instances or subclasses of FileResource
Bugzilla report 43348
+   
+ * Fixcrlf now gives better error messages on bad directory attributes.
+   Bugzilla report 43936
+   
 
 
 Changes from Ant 1.7.0 TO Ant 1.7.1



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



svn commit: r597452 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java

2007-11-22 Thread stevel
Author: stevel
Date: Thu Nov 22 09:05:51 2007
New Revision: 597452

URL: http://svn.apache.org/viewvc?rev=597452&view=rev
Log:
bit of tuning

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java?rev=597452&r1=597451&r2=597452&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
 Thu Nov 22 09:05:51 2007
@@ -165,6 +165,8 @@
 /** [EMAIL PROTECTED] */
 public static final String SKIPPING_TESTS
 = "Condition failed -skipping tests";
+public static final String APPLICATION_EXCEPTION = "Application Exception";
+public static final String TEARDOWN_EXCEPTION = "Teardown Exception";
 
 /**
  * Log if the definition is overriding something
@@ -355,6 +357,7 @@
 /**
  * Create a newly bound parallel instance with one child
  * @param parallelTimeout timeout
+ * @param child task
  * @return a bound and initialised parallel instance.
  */
 private Parallel newParallel(long parallelTimeout, Task child) {
@@ -463,16 +466,7 @@
 }
 applicationException = worker.getBuildException();
 
-/**Now faults are analysed
-the priority is
-  -testexceptions, except those indicating a build timeout when the 
application itself
-failed.
-(because often it is the application fault that is more 
interesting than the probe
- failure, which is usually triggered by the application not 
starting
-  -application exceptions (above test timeout exceptions)
-  -teardown exceptions -except when they are being ignored
-  -any
-*/
+//Now faults are analysed
 
 processExceptions();
 }
@@ -502,9 +496,7 @@
 if (taskException == null || taskException instanceof 
BuildTimeoutException) {
 taskException = applicationException;
 } else {
-log("Application Exception:" + applicationException.toString(),
-applicationException,
-Project.MSG_WARN);
+ignoringThrowable(APPLICATION_EXCEPTION, applicationException);
 }
 }
 
@@ -514,9 +506,7 @@
 taskException = teardownException;
 } else {
 //don't let the cleanup exception get in the way of any other 
failure
-log("teardown exception" + teardownException.toString(),
-teardownException,
-Project.MSG_WARN);
+ignoringThrowable(TEARDOWN_EXCEPTION, teardownException);
 }
 }
 
@@ -535,5 +525,16 @@
 if (taskException != null) {
 throw taskException;
 }
+}
+
+/**
+ * log that we are ignoring something rather than rethrowing it.
+ * @param type name of exception
+ * @param thrown what was thrown
+ */
+protected void ignoringThrowable(String type, Throwable thrown) {
+log(type + ": "+ thrown.toString(),
+thrown,
+Project.MSG_WARN);
 }
 }



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



svn commit: r597397 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java

2007-11-22 Thread stevel
Author: stevel
Date: Thu Nov 22 04:43:25 2007
New Revision: 597397

URL: http://svn.apache.org/viewvc?rev=597397&view=rev
Log:
Bug 43936:  errors are unhelpful

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java?rev=597397&r1=597396&r2=597397&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Thu Nov 
22 04:43:25 2007
@@ -83,9 +83,10 @@
 
 public class FixCRLF extends MatchingTask implements ChainableReader {
 
+private static final String FIXCRLF_ERROR = " error: ";
 /** error string for using srcdir and file */
 public static final String ERROR_FILE_AND_SRCDIR
-= "srcdir and file are mutually exclusive";
+=FIXCRLF_ERROR+"srcdir and file are mutually exclusive";
 
 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
 
@@ -106,6 +107,7 @@
  */
 private String outputEncoding = null;
 
+
 /**
  * Chain this task as a reader.
  * @param rdr Reader to chain.
@@ -312,20 +314,20 @@
 srcDir = file.getParentFile();
 }
 if (srcDir == null) {
-throw new BuildException("srcdir attribute must be set!");
+throw new BuildException(FIXCRLF_ERROR +"srcdir attribute must be 
set!");
 }
 if (!srcDir.exists()) {
-throw new BuildException("srcdir does not exist!");
+throw new BuildException(FIXCRLF_ERROR +"srcdir does not exist: 
'"+srcDir+"'");
 }
 if (!srcDir.isDirectory()) {
-throw new BuildException("srcdir is not a directory!");
+throw new BuildException(FIXCRLF_ERROR +"srcdir is not a 
directory: '"+srcDir+"'");
 }
 if (destDir != null) {
 if (!destDir.exists()) {
-throw new BuildException("destdir does not exist!");
+throw new BuildException(FIXCRLF_ERROR +"destdir does not 
exist: '" + destDir + "'");
 }
 if (!destDir.isDirectory()) {
-throw new BuildException("destdir is not a directory!");
+throw new BuildException(FIXCRLF_ERROR +"destdir is not a 
directory: '" + destDir + "'");
 }
 }
 }



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



svn commit: r597087 - in /ant/core/trunk/src/main/org/apache/tools/tar: TarBuffer.java TarInputStream.java TarOutputStream.java

2007-11-21 Thread stevel
Author: stevel
Date: Wed Nov 21 05:51:00 2007
New Revision: 597087

URL: http://svn.apache.org/viewvc?rev=597087&view=rev
Log:
pulling out unneeded this. references in everything but the 
constructors/initialisers. No other changes.

Modified:
ant/core/trunk/src/main/org/apache/tools/tar/TarBuffer.java
ant/core/trunk/src/main/org/apache/tools/tar/TarInputStream.java
ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java

Modified: ant/core/trunk/src/main/org/apache/tools/tar/TarBuffer.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/tar/TarBuffer.java?rev=597087&r1=597086&r2=597087&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/tar/TarBuffer.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/tar/TarBuffer.java Wed Nov 21 
05:51:00 2007
@@ -171,7 +171,7 @@
  * @return true if the record data is an End of Archive
  */
 public boolean isEOFRecord(byte[] record) {
-for (int i = 0, sz = this.getRecordSize(); i < sz; ++i) {
+for (int i = 0, sz = getRecordSize(); i < sz; ++i) {
 if (record[i] != 0) {
 return false;
 }
@@ -185,22 +185,22 @@
  * @throws IOException on error
  */
 public void skipRecord() throws IOException {
-if (this.debug) {
-System.err.println("SkipRecord: recIdx = " + this.currRecIdx
-   + " blkIdx = " + this.currBlkIdx);
+if (debug) {
+System.err.println("SkipRecord: recIdx = " + currRecIdx
+   + " blkIdx = " + currBlkIdx);
 }
 
-if (this.inStream == null) {
+if (inStream == null) {
 throw new IOException("reading (via skip) from an output buffer");
 }
 
-if (this.currRecIdx >= this.recsPerBlock) {
-if (!this.readBlock()) {
+if (currRecIdx >= recsPerBlock) {
+if (!readBlock()) {
 return;// UNDONE
 }
 }
 
-this.currRecIdx++;
+currRecIdx++;
 }
 
 /**
@@ -210,28 +210,28 @@
  * @throws IOException on error
  */
 public byte[] readRecord() throws IOException {
-if (this.debug) {
-System.err.println("ReadRecord: recIdx = " + this.currRecIdx
-   + " blkIdx = " + this.currBlkIdx);
+if (debug) {
+System.err.println("ReadRecord: recIdx = " + currRecIdx
+   + " blkIdx = " + currBlkIdx);
 }
 
-if (this.inStream == null) {
+if (inStream == null) {
 throw new IOException("reading from an output buffer");
 }
 
-if (this.currRecIdx >= this.recsPerBlock) {
-if (!this.readBlock()) {
+if (currRecIdx >= recsPerBlock) {
+if (!readBlock()) {
 return null;
 }
 }
 
-byte[] result = new byte[this.recordSize];
+byte[] result = new byte[recordSize];
 
-System.arraycopy(this.blockBuffer,
- (this.currRecIdx * this.recordSize), result, 0,
- this.recordSize);
+System.arraycopy(blockBuffer,
+ (currRecIdx * recordSize), result, 0,
+ recordSize);
 
-this.currRecIdx++;
+currRecIdx++;
 
 return result;
 }
@@ -240,21 +240,21 @@
  * @return false if End-Of-File, else true
  */
 private boolean readBlock() throws IOException {
-if (this.debug) {
-System.err.println("ReadBlock: blkIdx = " + this.currBlkIdx);
+if (debug) {
+System.err.println("ReadBlock: blkIdx = " + currBlkIdx);
 }
 
-if (this.inStream == null) {
+if (inStream == null) {
 throw new IOException("reading from an output buffer");
 }
 
-this.currRecIdx = 0;
+currRecIdx = 0;
 
 int offset = 0;
-int bytesNeeded = this.blockSize;
+int bytesNeeded = blockSize;
 
 while (bytesNeeded > 0) {
-long numBytes = this.inStream.read(this.blockBuffer, offset,
+long numBytes = inStream.read(blockBuffer, offset,
bytesNeeded);
 
 //
@@ -291,16 +291,16 @@
 offset += numBytes;
 bytesNeeded -= numBytes;
 
-if (numBytes != this.blockSize) {
-if (this.debug) {
+if (numBytes != blockSize) {
+if (debug) {
 System.err.println("ReadBlock: INCOMPLETE READ "
- 

svn commit: r597084 - /ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java

2007-11-21 Thread stevel
Author: stevel
Date: Wed Nov 21 05:41:27 2007
New Revision: 597084

URL: http://svn.apache.org/viewvc?rev=597084&view=rev
Log:
pulling out unneeded this. references in everything but the constructors

Modified:
ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java

Modified: ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java?rev=597084&r1=597083&r2=597084&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java Wed Nov 21 
05:41:27 2007
@@ -181,7 +181,7 @@
 }
 
 /**
- * Construct an entry with a name an a link flag.
+ * Construct an entry with a name and a link flag.
  *
  * @param name the entry name
  * @param linkFlag the entry link flag.
@@ -267,7 +267,7 @@
  */
 public TarEntry(byte[] headerBuf) {
 this();
-this.parseTarHeader(headerBuf);
+parseTarHeader(headerBuf);
 }
 
 /**
@@ -278,7 +278,7 @@
  * @return True if the entries are equal.
  */
 public boolean equals(TarEntry it) {
-return this.getName().equals(it.getName());
+return getName().equals(it.getName());
 }
 
 /**
@@ -313,7 +313,7 @@
  * @return True if entry is a descendant of this.
  */
 public boolean isDescendent(TarEntry desc) {
-return desc.getName().startsWith(this.getName());
+return desc.getName().startsWith(getName());
 }
 
 /**
@@ -322,7 +322,7 @@
  * @return This entry's name.
  */
 public String getName() {
-return this.name.toString();
+return name.toString();
 }
 
 /**
@@ -349,7 +349,7 @@
  * @return This entry's link name.
  */
 public String getLinkName() {
-return this.linkName.toString();
+return linkName.toString();
 }
 
 /**
@@ -358,7 +358,7 @@
  * @return This entry's user id.
  */
 public int getUserId() {
-return this.userId;
+return userId;
 }
 
 /**
@@ -376,7 +376,7 @@
  * @return This entry's group id.
  */
 public int getGroupId() {
-return this.groupId;
+return groupId;
 }
 
 /**
@@ -394,7 +394,7 @@
  * @return This entry's user name.
  */
 public String getUserName() {
-return this.userName.toString();
+return userName.toString();
 }
 
 /**
@@ -412,7 +412,7 @@
  * @return This entry's group name.
  */
 public String getGroupName() {
-return this.groupName.toString();
+return groupName.toString();
 }
 
 /**
@@ -431,8 +431,8 @@
  * @param groupId This entry's new group id.
  */
 public void setIds(int userId, int groupId) {
-this.setUserId(userId);
-this.setGroupId(groupId);
+setUserId(userId);
+setGroupId(groupId);
 }
 
 /**
@@ -442,8 +442,8 @@
  * @param groupName This entry's new group name.
  */
 public void setNames(String userName, String groupName) {
-this.setUserName(userName);
-this.setGroupName(groupName);
+setUserName(userName);
+setGroupName(groupName);
 }
 
 /**
@@ -453,7 +453,7 @@
  * @param time This entry's new modification time.
  */
 public void setModTime(long time) {
-this.modTime = time / MILLIS_PER_SECOND;
+modTime = time / MILLIS_PER_SECOND;
 }
 
 /**
@@ -462,7 +462,7 @@
  * @param time This entry's new modification time.
  */
 public void setModTime(Date time) {
-this.modTime = time.getTime() / MILLIS_PER_SECOND;
+modTime = time.getTime() / MILLIS_PER_SECOND;
 }
 
 /**
@@ -471,7 +471,7 @@
  * @return time This entry's new modification time.
  */
 public Date getModTime() {
-return new Date(this.modTime * MILLIS_PER_SECOND);
+return new Date(modTime * MILLIS_PER_SECOND);
 }
 
 /**
@@ -480,7 +480,7 @@
  * @return This entry's file.
  */
 public File getFile() {
-return this.file;
+return file;
 }
 
 /**
@@ -489,7 +489,7 @@
  * @return This entry's mode.
  */
 public int getMode() {
-return this.mode;
+return mode;
 }
 
 /**
@@ -498,7 +498,7 @@
  * @return This entry's file size.
  */
 public long getSize() {
-return this.size;
+return size;
 }
 
 /**
@@ -527,15 +527,15 @@
  * @return True if this entry is a directory.
  */
 public boolean isDirectory() {
-if (this.file != null) {
-return this.file.isDirectory();
+if (file != null) {
+return file.isDirectory();
 }
 
-if (this.linkFlag == LF_DIR) {

svn commit: r591304 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic: DefaultRmicAdapter.java SunRmic.java WLRmic.java

2007-11-02 Thread stevel
Author: stevel
Date: Fri Nov  2 04:13:39 2007
New Revision: 591304

URL: http://svn.apache.org/viewvc?rev=591304&view=rev
Log:
Bug ID 43780: weblogic RMIC fails on ant1.7.0

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java?rev=591304&r1=591303&r2=591304&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
 Fri Nov  2 04:13:39 2007
@@ -43,20 +43,33 @@
 private Rmic attributes;
 private FileNameMapper mapper;
 private static final Random RAND = new Random();
-/** suffix denoting a stub file */
+/** suffix denoting a stub file: [EMAIL PROTECTED] */
 public static final String RMI_STUB_SUFFIX = "_Stub";
-/** suffix denoting a skel file */
+/** suffix denoting a skel file: [EMAIL PROTECTED] */
 public static final String RMI_SKEL_SUFFIX = "_Skel";
-/** suffix denoting a tie file */
+/** suffix denoting a tie file: [EMAIL PROTECTED] */
 public static final String RMI_TIE_SUFFIX = "_Tie";
-/** arg for compat */
+/** arg for compat: [EMAIL PROTECTED] */
 public static final String STUB_COMPAT = "-vcompat";
-/** arg for 1.1 */
+/** arg for 1.1: [EMAIL PROTECTED] */
 public static final String STUB_1_1 = "-v1.1";
-/** arg for 1.2 */
+/** arg for 1.2: [EMAIL PROTECTED] */
 public static final String STUB_1_2 = "-v1.2";
 
 /**
+ * option for stub 1.1 in the rmic task: [EMAIL PROTECTED]
+ */
+public static final String STUB_OPTION_1_1 = "1.1";
+/**
+ * option for stub 1.2 in the rmic task: [EMAIL PROTECTED]
+ */
+public static final String STUB_OPTION_1_2 = "1.2";
+/**
+ * option for stub compat in the rmic task: [EMAIL PROTECTED]
+ */
+public static final String STUB_OPTION_COMPAT = "compat";
+
+/**
  * Default constructor
  */
 public DefaultRmicAdapter() {
@@ -196,35 +209,13 @@
 
 cmd.createArgument().setValue("-classpath");
 cmd.createArgument().setPath(classpath);
-
-//handle the many different stub options.
-String stubVersion = attributes.getStubVersion();
-//default is compatibility
-String stubOption = null;
-if (null != stubVersion) {
-if ("1.1".equals(stubVersion)) {
-stubOption = STUB_1_1;
-} else if ("1.2".equals(stubVersion)) {
-stubOption = STUB_1_2;
-} else if ("compat".equals(stubVersion)) {
-stubOption = STUB_COMPAT;
-} else {
-//anything else
-attributes.log("Unknown stub option " + stubVersion);
-//do nothing with the value? or go -v+stubVersion??
-}
-}
-//for java1.5+, we generate compatible stubs, that is, unless
-//the caller asked for IDL or IIOP support.
-if (stubOption == null
-&& !attributes.getIiop()
-&& !attributes.getIdl()) {
-stubOption = STUB_COMPAT;
-}
+String stubOption=addStubVersionOptions();
 if (stubOption != null) {
 //set the non-null stubOption
 cmd.createArgument().setValue(stubOption);
 }
+
+
 if (null != attributes.getSourceBase()) {
 cmd.createArgument().setValue("-keepgenerated");
 }
@@ -262,6 +253,40 @@
  }
 
 /**
+ * This is an override point; get the stub version off the rmic command and
+ * translate that into a compiler-specific argument
+ * @return a string to use for the stub version; can be null
+ * @since Ant1.7.1
+ */
+protected String addStubVersionOptions() {
+//handle the many different stub options.
+String stubVersion = attributes.getStubVersion();
+//default is compatibility
+String stubOption = null;
+if (null != stubVersion) {
+if (STUB_OPTION_1_1.equals(stubVersion)) {
+stubOption = STUB_1_1;
+} else if (STUB_OPTION_1_2.equals(stubVersion)) {
+stubOption = STUB_1_2;
+} else if (STUB_OPTION_COMPAT.equals(stubVersion)) {
+stubOption = STUB_COMPAT;
+ 

svn commit: r591040 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

2007-11-01 Thread stevel
Author: stevel
Date: Thu Nov  1 08:02:20 2007
New Revision: 591040

URL: http://svn.apache.org/viewvc?rev=591040&view=rev
Log:
test changes to handle windows systems better

Modified:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

Modified: 
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java?rev=591040&r1=591039&r2=591040&view=diff
==
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
Thu Nov  1 08:02:20 2007
@@ -146,9 +146,9 @@
 
 
 public void testInternationalURI() throws Exception {
-String result=assertResolves("L\\u00f6wenbrau.aus.M\\u00fcnchen");
+String result=assertResolves("L\u00f6wenbrau.aus.M\u00fcnchen");
 char umlauted = result.charAt(1);
-assertEquals("expected 0xf6 (\\u00f6), but got 
"+Integer.toHexString(umlauted)+" '"+umlauted+"'",
+assertEquals("expected 0xf6 (\u00f6), but got 
"+Integer.toHexString(umlauted)+" '"+umlauted+"'",
 0xf6, umlauted);
 }
 



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



svn commit: r591037 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

2007-11-01 Thread stevel
Author: stevel
Date: Thu Nov  1 07:58:49 2007
New Revision: 591037

URL: http://svn.apache.org/viewvc?rev=591037&view=rev
Log:
test changes to handle windows systems better

Modified:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

Modified: 
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java?rev=591037&r1=591036&r2=591037&view=diff
==
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
Thu Nov  1 07:58:49 2007
@@ -23,9 +23,14 @@
 import java.net.URISyntaxException;
 import java.io.File;
 
+import org.apache.tools.ant.util.JavaEnvUtils;
+import org.apache.tools.ant.taskdefs.condition.Os;
+
 /** Test the locator in the ant-launch JAR */
 
 public class LocatorTest extends TestCase {
+private boolean windows;
+private boolean unix;
 
 
 /**
@@ -40,6 +45,17 @@
 super(name);
 }
 
+
+/**
+ * Sets up the fixture, for example, open a network connection.
+ * This method is called before a test is executed.
+ */
+protected void setUp() throws Exception {
+super.setUp();
+windows = Os.isFamily(Os.FAMILY_DOS);
+unix = Os.isFamily(Os.FAMILY_UNIX);
+}
+
 private String resolve(String uri) {
 String j14= Locator.fromURI(uri);
 String j13 = Locator.fromURIJava13(uri);
@@ -48,44 +64,47 @@
 return j14;
 }
 
-private void resolveTo(String uri,String expectedResult) {
+/**
+ * expect a uri to resolve to strings on different platforms
+ * @param uri uri to parse
+ * @param expectedUnix unix string (or null to skip that test)
+ * @param expectedDos DOS string (or null to skip that test)
+ */
+private String resolveTo(String uri, String expectedUnix, String 
expectedDos) {
 String result = resolve(uri);
-assertResolved(uri, expectedResult, result);
+assertResolved(uri, expectedUnix, result, unix);
+assertResolved(uri, expectedDos, result, windows);
+return result;
 }
 
-private void assertResolved(String uri, String expectedResult, String 
result) {
-assertEquals("Expected "+uri+" to resolve to \n"+expectedResult+"\n 
but got\n"+result+"\n",
+private void assertResolved(String uri, String expectedResult, String 
result, boolean condition) {
+if(condition && expectedResult!=null && expectedResult.length()>0) {
+assertEquals("Expected "+uri+" to resolve to 
\n"+expectedResult+"\n but got\n"+result+"\n",
 expectedResult,result);
+}
 }
 
 /**
  * This asserts that we can round trip the path to a URI and back again
- * @param path
+ * @param path filename with no directory separators
+ * @return the trailing filename
  */
-private void assertResolves(String path) throws Exception {
+private String assertResolves(String path) throws Exception {
 String asuri = new File(path).toURI().toASCIIString();
-logURI(path +" => "+asuri);
-resolveTo(asuri,path);
-}
-
-private void resolveTo13(String uri, String expectedResult) {
-String result = Locator.fromURIJava13(uri);
-assertResolved(uri, expectedResult, result);
+String fullpath = System.getProperty("user.dir") + File.separator + 
path;
+String result=resolveTo(asuri, fullpath, fullpath);
+return result.substring(result.lastIndexOf(File.separatorChar)+1);
 }
 
-private void logURI(String path) throws URISyntaxException{
-
-String s = new File(path).toURI().toASCIIString();
-System.out.println(path+" => "+s);
-
-}
 
 /**
  * this isnt really a valid URI, except maybe in IE
  * @throws Exception
  */
 public void testNetworkURI() throws Exception {
-
resolveTo("file:PC03\\jclasses\\lib\\ant-1.7.0.jar","PC03\\jclasses\\lib\\ant-1.7.0.jar");
+resolveTo("file:PC03\\jclasses\\lib\\ant-1.7.0.jar","" +
+"PC03\\jclasses\\lib\\ant-1.7.0.jar",
+"PC03\\jclasses\\lib\\ant-1.7.0.jar");
 }
 
 /**
@@ -93,23 +112,25 @@
  * @throws Exception
  */
 public void NotestTripleForwardSlashNetworkURI() throws Exception {
-resolveTo("file:///PC03/jclasses/lib/ant-1.7.0.jar", 
"///PC03/jclasses/lib/ant-1.7.0.jar");
+resolveTo("file:///PC03/jclasses/lib/ant-1.7.0.jar",
+"///PC03/jclasses/lib

svn commit: r591013 - /ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml

2007-11-01 Thread stevel
Author: stevel
Date: Thu Nov  1 07:06:39 2007
New Revision: 591013

URL: http://svn.apache.org/viewvc?rev=591013&view=rev
Log:
defect 38732; rmic task doesn't work with -Xnew and JDK 6.0

turning the test off on java6, as it damages the XML parser

Modified:
ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml

Modified: ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml?rev=591013&r1=591012&r2=591013&view=diff
==
--- ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml Thu Nov  1 07:06:39 
2007
@@ -117,7 +117,7 @@
 
   
 
-
+
   
 
   
@@ -278,7 +278,10 @@
 
   
 
-  
+  
+  
 
   
 



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



svn commit: r590998 - /ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java

2007-11-01 Thread stevel
Author: stevel
Date: Thu Nov  1 06:29:23 2007
New Revision: 590998

URL: http://svn.apache.org/viewvc?rev=590998&view=rev
Log:
no, I'm  rolling this back. Let's wait and see what the tests I'm running at 
work on something similar say.

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java?rev=590998&r1=590997&r2=590998&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java Thu Nov  1 
06:29:23 2007
@@ -114,7 +114,7 @@
  */
 public void waitUntilFinished(long timeout) throws InterruptedException {
 synchronized(notify) {
-while (!finished) {
+if(!finished) {
 notify.wait(timeout);
 }
 }



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



svn commit: r590990 - /ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java

2007-11-01 Thread stevel
Author: stevel
Date: Thu Nov  1 06:12:49 2007
New Revision: 590990

URL: http://svn.apache.org/viewvc?rev=590990&view=rev
Log:
read the javadocs on wait(long) to see why this change was made

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java?rev=590990&r1=590989&r2=590990&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java Thu Nov  1 
06:12:49 2007
@@ -114,10 +114,9 @@
  */
 public void waitUntilFinished(long timeout) throws InterruptedException {
 synchronized(notify) {
-if(finished) {
-return;
+while (!finished) {
+notify.wait(timeout);
 }
-notify.wait(timeout);
 }
 }
 



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



svn commit: r590988 - /ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java

2007-11-01 Thread stevel
Author: stevel
Date: Thu Nov  1 06:00:02 2007
New Revision: 590988

URL: http://svn.apache.org/viewvc?rev=590988&view=rev
Log:
make it impossible to have a null notify value

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java?rev=590988&r1=590987&r2=590988&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java Thu Nov  1 
06:00:02 2007
@@ -54,7 +54,7 @@
  */
 public WorkerAnt(Task task, Object notify) {
 this.task = task;
-this.notify = notify;
+this.notify = notify != null ? notify : this;
 }
 
 /**
@@ -65,7 +65,6 @@
  */
 public WorkerAnt(Task task) {
 this(task,null);
-notify = this;
 }
 
 /**



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



svn commit: r589767 - in /ant/core/trunk/src/main/org/apache/tools/ant: taskdefs/ taskdefs/optional/testing/ util/

2007-10-29 Thread stevel
Author: stevel
Date: Mon Oct 29 10:44:21 2007
New Revision: 589767

URL: http://svn.apache.org/viewvc?rev=589767&view=rev
Log:
new test tasks, not declared yet -so they dont exist-

 for functional testing
 is waitfor that throws a BuildTimeoutException when it times out

Added:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BlockFor.java

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/BuildTimeoutException.java

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
ant/core/trunk/src/main/org/apache/tools/ant/util/WorkerAnt.java
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java?rev=589767&r1=589766&r2=589767&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/WaitFor.java Mon Oct 
29 10:44:21 2007
@@ -52,20 +52,24 @@
  * @ant.task category="control"
  */
 public class WaitFor extends ConditionBase {
-private static final long ONE_SECOND = 1000L;
-private static final long ONE_MINUTE = ONE_SECOND * 60L;
-private static final long ONE_HOUR   = ONE_MINUTE * 60L;
-private static final long ONE_DAY= ONE_HOUR * 24L;
-private static final long ONE_WEEK   = ONE_DAY * 7L;
-
-private static final long DEFAULT_MAX_WAIT_MILLIS = ONE_MINUTE * 3L;
-private static final long DEFAULT_CHECK_MILLIS = 500L;
-
-/** default max wait time */
-private long maxWaitMillis = DEFAULT_MAX_WAIT_MILLIS;
-private long maxWaitMultiplier = 1L;
-private long checkEveryMillis = DEFAULT_CHECK_MILLIS;
-private long checkEveryMultiplier = 1L;
+public static final long ONE_MILLISECOND = 1L;
+public static final long ONE_SECOND = 1000L;
+public static final long ONE_MINUTE = ONE_SECOND * 60L;
+public static final long ONE_HOUR   = ONE_MINUTE * 60L;
+public static final long ONE_DAY= ONE_HOUR * 24L;
+public static final long ONE_WEEK   = ONE_DAY * 7L;
+
+public static final long DEFAULT_MAX_WAIT_MILLIS = ONE_MINUTE * 3L;
+public static final long DEFAULT_CHECK_MILLIS = 500L;
+
+/** default max wait time in the current unit*/
+private long maxWait = DEFAULT_MAX_WAIT_MILLIS;
+private long maxWaitMultiplier = ONE_MILLISECOND;
+/**
+ * check time in the current unit
+ */
+private long checkEvery = DEFAULT_CHECK_MILLIS;
+private long checkEveryMultiplier = ONE_MILLISECOND;
 private String timeoutProperty;
 
 /**
@@ -75,14 +79,26 @@
 super("waitfor");
 }
 
+
+/**
+ * Constructor that takes the name of the task in the task name.
+ *
+ * @param taskName the name of the task.
+ * @since Ant 1.8
+ */
+public WaitFor(String taskName) {
+super(taskName);
+}
+
 /**
  * Set the maximum length of time to wait.
  * @param time a long value
  */
 public void setMaxWait(long time) {
-maxWaitMillis = time;
+maxWait = time;
 }
 
+
 /**
  * Set the max wait time unit
  * @param unit an enumerated Unit value
@@ -91,12 +107,14 @@
 maxWaitMultiplier = unit.getMultiplier();
 }
 
+
+
 /**
  * Set the time between each check
  * @param time a long value
  */
 public void setCheckEvery(long time) {
-checkEveryMillis = time;
+checkEvery = time;
 }
 
 /**
@@ -131,32 +149,42 @@
  + getTaskName());
 }
 Condition c = (Condition) getConditions().nextElement();
-
-long savedMaxWaitMillis = maxWaitMillis;
-long savedCheckEveryMillis = checkEveryMillis;
 try {
-try {
-maxWaitMillis *= maxWaitMultiplier;
-checkEveryMillis *= checkEveryMultiplier;
-long start = System.currentTimeMillis();
-long end = start + maxWaitMillis;
-
-while (System.currentTimeMillis() < end) {
-if (c.eval()) {
-processSuccess();
-return;
-}
-Thread.sleep(checkEveryMillis);
+long maxWaitMillis = calculateMaxWaitMillis();
+long checkEveryMillis = calculateCheckEveryMillis();
+long start = System.currentTimeMillis();
+long end = start + maxWaitMillis;
+
+while (System.currentTimeMillis() < end) {
+if (c.eval()) {
+processSuccess();
+retur

svn commit: r589763 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

2007-10-29 Thread stevel
Author: stevel
Date: Mon Oct 29 10:41:35 2007
New Revision: 589763

URL: http://svn.apache.org/viewvc?rev=589763&view=rev
Log:
discussion on junit triggered me to look at this task; fix some things the IDE 
warned about on localisation.

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java?rev=589763&r1=589762&r2=589763&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
 Mon Oct 29 10:41:35 2007
@@ -39,6 +39,7 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Vector;
+import java.util.Locale;
 
 import org.apache.tools.ant.AntClassLoader;
 import org.apache.tools.ant.BuildException;
@@ -831,10 +832,10 @@
 
 /**
  * Execute a list of tests in a single forked Java VM.
- * @param tests the list of tests to execute.
+ * @param testList the list of tests to execute.
  * @throws BuildException on error.
  */
-protected void execute(List tests) throws BuildException {
+protected void execute(List testList) throws BuildException {
 JUnitTest test = null;
 // Create a temporary file to pass the test cases to run to
 // the runner (one test case per line)
@@ -843,7 +844,7 @@
 try {
 writer =
 new PrintWriter(new BufferedWriter(new FileWriter(casesFile)));
-Iterator iter = tests.iterator();
+Iterator iter = testList.iterator();
 while (iter.hasNext()) {
 test = (JUnitTest) iter.next();
 writer.print(test.getName());
@@ -895,6 +896,7 @@
  * the test could probably hang forever.
  * @param casesFile list of test cases to execute. Can be null,
  * in this case only one test is executed.
+ * @return the test results from the JVM itself.
  * @throws BuildException in case of error creating a temporary property 
file,
  * or if the junit process can not be forked
  */
@@ -1049,6 +1051,7 @@
 
 /**
  * Adding ant runtime.
+ * @param cmd command to run
  */
 private void checkIncludeAntRuntime(CommandlineJava cmd) {
 if (includeAntRuntime) {
@@ -1070,10 +1073,20 @@
 }
 }
 
+
+/**
+ * check for the parameter being "withoutanderr" in a locale-independent 
way.
+ * @param summaryOption the summary option -can be null
+ * @return true if the run should be withoutput and error
+ */
+private boolean equalsWithOutAndErr(String summaryOption) {
+return summaryOption != null && 
"withoutanderr".equals(summaryOption.toLowerCase(Locale.ENGLISH));
+}
+
 private void checkIncludeSummary(CommandlineJava cmd) {
 if (summary) {
 String prefix = "";
-if ("withoutanderr".equalsIgnoreCase(summaryValue)) {
+if (equalsWithOutAndErr(summaryValue)) {
 prefix = "OutErr";
 }
 cmd.createArgument()
@@ -1086,6 +1099,7 @@
 /**
  * Check the path for multiple different versions of
  * ant.
+ * @param cmd command to execute
  */
 private void checkForkedPath(CommandlineJava cmd) {
 if (forkedPathChecked) {
@@ -1244,6 +1258,7 @@
  * Execute inside VM.
  * @param arg one JUnitTest
  * @throws BuildException under unspecified circumstances
+ * @return the results
  */
 private TestResultHolder executeInVM(JUnitTest arg) throws BuildException {
 JUnitTest test = (JUnitTest) arg.clone();
@@ -1288,8 +1303,7 @@
 
 JUnitTaskMirror.SummaryJUnitResultFormatterMirror f =
 delegate.newSummaryJUnitResultFormatter();
-f.setWithOutAndErr("withoutanderr"
-   .equalsIgnoreCase(summaryValue));
+f.setWithOutAndErr(equalsWithOutAndErr(summaryValue));
 f.setOutput(getDefaultOutput());
 runner.addFormatter(f);
 }
@@ -1807,7 +1821,7 @@
 }
 
 /**
- * A value class that contains thee result of a test.
+ * A value class that contains the result of a test.
  */
 protected class TestResultHolder {
 // CheckStyle:VisibilityModifier OFF - bc



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



svn commit: r589762 - /ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java

2007-10-29 Thread stevel
Author: stevel
Date: Mon Oct 29 10:40:51 2007
New Revision: 589762

URL: http://svn.apache.org/viewvc?rev=589762&view=rev
Log:
javadoc

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?rev=589762&r1=589761&r2=589762&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Mon Oct 29 
10:40:51 2007
@@ -971,6 +971,7 @@
  * @param reader the input to read from.
  * @return the string.
  * @throws IOException if unable to read from reader.
+ * @since Ant 1.7.1
  */
 public static String safeReadFully(Reader reader) throws IOException {
 String ret = readFully(reader);



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



svn commit: r589755 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java

2007-10-29 Thread stevel
Author: stevel
Date: Mon Oct 29 10:30:28 2007
New Revision: 589755

URL: http://svn.apache.org/viewvc?rev=589755&view=rev
Log:
javdoc

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java?rev=589755&r1=589754&r2=589755&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Parallel.java Mon Oct 
29 10:30:28 2007
@@ -408,7 +408,7 @@
 }
 
 /**
- * Determine the number of processors. Only effective on later VMs
+ * Determine the number of processors. Only effective on Java 1.4+
  *
  * @return the number of processors available or 0 if not determinable.
  */



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



svn commit: r585108 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java

2007-10-16 Thread stevel
Author: stevel
Date: Tue Oct 16 03:50:59 2007
New Revision: 585108

URL: http://svn.apache.org/viewvc?rev=585108&view=rev
Log:
Bug ID 43635  task can't be used more than once with a file stylesheet

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java?rev=585108&r1=585107&r2=585108&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Tue 
Oct 16 03:50:59 2007
@@ -35,6 +35,7 @@
 import org.apache.tools.ant.types.resources.FileResource;
 import org.apache.tools.ant.types.resources.Resources;
 import org.apache.tools.ant.types.resources.Union;
+import org.apache.tools.ant.types.resources.FileProvider;
 import org.apache.tools.ant.util.FileNameMapper;
 import org.apache.tools.ant.util.FileUtils;
 
@@ -285,8 +286,9 @@
 throw new BuildException("input file " + inFile + " does not 
exist", getLocation());
 }
 try {
+Resource styleResource;
 if (baseDir == null) {
-baseDir = getProject().resolveFile(".");
+baseDir = getProject().getBaseDir();
 }
 liaison = getLiaison();
 
@@ -315,11 +317,13 @@
 FileResource fr = new FileResource();
 fr.setProject(getProject());
 fr.setFile(stylesheet);
-xslResource = fr;
+styleResource = fr;
+} else {
+styleResource = xslResource;
 }
 // if we have an in file and out then process them
 if (inFile != null && outFile != null) {
-process(inFile, outFile, xslResource);
+process(inFile, outFile, styleResource);
 return;
 }
 /*
@@ -337,7 +341,7 @@
 // Process all the files marked for styling
 list = scanner.getIncludedFiles();
 for (int i = 0; i < list.length; ++i) {
-process(baseDir, list[i], destDir, xslResource);
+process(baseDir, list[i], destDir, styleResource);
 }
 if (performDirectoryScan) {
 // Process all the directories marked for styling
@@ -346,7 +350,7 @@
 list = new File(baseDir, dirs[j]).list();
 for (int i = 0; i < list.length; ++i) {
 process(baseDir, dirs[j] + File.separator + 
list[i], destDir,
-xslResource);
+styleResource);
 }
 }
 }
@@ -355,7 +359,7 @@
 throw new BuildException("no resources specified");
 }
 }
-processResources(xslResource);
+processResources(styleResource);
 } finally {
 if (loader != null) {
 loader.resetThreadContextLoader();
@@ -575,6 +579,7 @@
 /**
  * Styles all existing resources.
  *
+ * @param stylesheet style sheet to use
  * @since Ant 1.7
  */
 private void processResources(Resource stylesheet) {
@@ -983,8 +988,8 @@
 // If we are here we cannot set the stylesheet as
 // a resource, but we can set it as a file. So,
 // we make an attempt to get it as a file
-if (stylesheet instanceof FileResource) {
-liaison.setStylesheet(((FileResource) 
stylesheet).getFile());
+if (stylesheet instanceof FileProvider) {
+liaison.setStylesheet(((FileProvider) 
stylesheet).getFile());
 } else {
 throw new BuildException(liaison.getClass().toString()
 + " accepts the stylesheet only as a file", 
getLocation());



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



svn commit: r585106 - /ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java

2007-10-16 Thread stevel
Author: stevel
Date: Tue Oct 16 03:48:13 2007
New Revision: 585106

URL: http://svn.apache.org/viewvc?rev=585106&view=rev
Log:
seems to me these should be synchronized

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java?rev=585106&r1=585105&r2=585106&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java Tue Oct 
16 03:48:13 2007
@@ -696,7 +696,7 @@
  * Called at the start of processing an antlib.
  * @param uri the uri that is associated with this antlib.
  */
-public synchronized void enterAntLib(String uri) {
+public void enterAntLib(String uri) {
 antLibCurrentUri = uri;
 antLibStack.push(uri);
 }
@@ -711,7 +711,7 @@
 /**
  * Called at the end of processing an antlib.
  */
-public synchronized void exitAntLib() {
+public void exitAntLib() {
 antLibStack.pop();
 antLibCurrentUri = (antLibStack.size() == 0) ? null : (String) 
antLibStack.peek();
 }



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



svn commit: r583818 - /ant/core/trunk/docs/manual/OptionalTasks/sshexec.html

2007-10-11 Thread stevel
Author: stevel
Date: Thu Oct 11 06:19:03 2007
New Revision: 583818

URL: http://svn.apache.org/viewvc?rev=583818&view=rev
Log:
SFOS-485 release build.xml isnt compatible with Ant1.7.0
http://jira.smartfrog.org/jira/browse/SFOS-485

-fixing the docs so nobody else uses commandResource prematurely.

Modified:
ant/core/trunk/docs/manual/OptionalTasks/sshexec.html

Modified: ant/core/trunk/docs/manual/OptionalTasks/sshexec.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/OptionalTasks/sshexec.html?rev=583818&r1=583817&r2=583818&view=diff
==
--- ant/core/trunk/docs/manual/OptionalTasks/sshexec.html (original)
+++ ant/core/trunk/docs/manual/OptionalTasks/sshexec.html Thu Oct 11 06:19:03 
2007
@@ -65,7 +65,8 @@
   
   
 commandResource
-The resource (file) that contains the commands to run on 
the remote host.
+The resource (file) that contains the commands to run on 
the remote host.
+Since Ant 1.7.1
 Either this or command must be set
   
   



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



svn commit: r577281 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java src/tests/antunit/taskdefs/optional/unix/ src/tests/antunit/taskdefs/optional/unix/

2007-09-19 Thread stevel
Author: stevel
Date: Wed Sep 19 05:29:39 2007
New Revision: 577281

URL: http://svn.apache.org/viewvc?rev=577281&view=rev
Log:
bugzilla ID 38199, symlink fails on second call
bugzilla ID 43426,  cant create a symlink over a file

solution is the same: opt for ln -sf after trying to do it internally. We could 
perhaps drop all ant deletion operations, for a much simpler operation.

Added:
ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/
ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
Modified:
ant/core/trunk/WHATSNEW

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=577281&r1=577280&r2=577281&view=diff
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Sep 19 05:29:39 2007
@@ -41,6 +41,13 @@
 Fixed bugs:
 ---
 
+ *  task couldn't overwrite existing symlinks that pointed to 
nonexistent files
+   Bugzilla report 38199
+
+ *  task couldn't overwrite files that were in the way of the symlink.
+   Bugzilla report 43426
+
+
 Other changes:
 --
 

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=577281&r1=577280&r2=577281&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
 Wed Sep 19 05:29:39 2007
@@ -404,7 +404,7 @@
  *   fail.
  */
 public static void deleteSymlink(File linkfil)
-throws IOException, FileNotFoundException {
+throws IOException{
 if (!linkfil.exists()) {
 throw new FileNotFoundException("No such symlink: " + linkfil);
 }
@@ -466,6 +466,7 @@
  *
  * @param msgThe message to log, or include in the
  *  BuildException.
+ * @throws BuildException with the message if failonerror=true
  */
 private void handleError(String msg) {
 if (failonerror) {
@@ -481,20 +482,24 @@
  *
  * @param res   The path of the resource we are linking to.
  * @param lnk   The name of the link we wish to make.
+ * @throws BuildException when things go wrong
  */
 private void doLink(String res, String lnk) throws BuildException {
 File linkfil = new File(lnk);
-if (overwrite && linkfil.exists()) {
-try {
-deleteSymlink(linkfil);
-} catch (FileNotFoundException fnfe) {
-handleError("Symlink disappeared before it was deleted: " + 
lnk);
-} catch (IOException ioe) {
-handleError("Unable to overwrite preexisting link: " + lnk);
+String options = "-s";
+if (overwrite) {
+options += "f";
+if (linkfil.exists()) {
+try {
+deleteSymlink(linkfil);
+} catch (FileNotFoundException fnfe) {
+log("Symlink disappeared before it was deleted: " + lnk);
+} catch (IOException ioe) {
+log("Unable to overwrite preexisting link or file: " + 
lnk,ioe, Project.MSG_INFO);
+}
 }
 }
-String[] cmd = new String[] {"ln", "-s", res, lnk};
-log(Commandline.toString(cmd));
+String[] cmd = new String[] {"ln", options, res, lnk};
 Execute.runCommand(this, cmd);
 }
 

Added: ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml?rev=577281&view=auto
==
--- ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml 
(added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml 
Wed Sep 19 05:29:39 2007
@@ -0,0 +1,55 @@
+
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+  
+
+
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+
+
+  
+
+
+  
+
+
+  
+
+  
+
+
+  
+
+
\ No newline at end of file



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



svn commit: r577279 - /ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java

2007-09-19 Thread stevel
Author: stevel
Date: Wed Sep 19 05:28:01 2007
New Revision: 577279

URL: http://svn.apache.org/viewvc?rev=577279&view=rev
Log:
make this synchronized, especially the pop

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java?rev=577279&r1=577278&r2=577279&view=diff
==
--- ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java Wed Sep 
19 05:28:01 2007
@@ -696,7 +696,7 @@
  * Called at the start of processing an antlib.
  * @param uri the uri that is associated with this antlib.
  */
-public void enterAntLib(String uri) {
+public synchronized void enterAntLib(String uri) {
 antLibCurrentUri = uri;
 antLibStack.push(uri);
 }
@@ -711,7 +711,7 @@
 /**
  * Called at the end of processing an antlib.
  */
-public void exitAntLib() {
+public synchronized void exitAntLib() {
 antLibStack.pop();
 antLibCurrentUri = (antLibStack.size() == 0) ? null : (String) 
antLibStack.peek();
 }



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



svn commit: r576771 - /ant/core/trunk/WHATSNEW

2007-09-18 Thread stevel
Author: stevel
Date: Tue Sep 18 01:20:21 2007
New Revision: 576771

URL: http://svn.apache.org/viewvc?rev=576771&view=rev
Log:
bug ID 43348:   add FileProvider interface for file providing resources

Modified:
ant/core/trunk/WHATSNEW

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=576771&r1=576770&r2=576771&view=diff
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Sep 18 01:20:21 2007
@@ -44,6 +44,12 @@
 Other changes:
 --
 
+ * There is now a FileProvider interface for resources that act as a source
+   of filenames. This should be used by tasks that require resources
+   to provide filenames, rather than require that all resources
+   are instances or subclasses of FileResource
+   Bugzilla report 43348
+
 
 Changes from Ant 1.7.0 TO Ant 1.7.1
 =



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



svn commit: r576769 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/resources: FileProvider.java FileResource.java

2007-09-18 Thread stevel
Author: stevel
Date: Tue Sep 18 01:17:13 2007
New Revision: 576769

URL: http://svn.apache.org/viewvc?rev=576769&view=rev
Log:
bug ID 43348:   add FileProvider interface for file providing resources

Added:

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileProvider.java
Modified:

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java

Added: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileProvider.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileProvider.java?rev=576769&view=auto
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileProvider.java 
(added)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileProvider.java 
Tue Sep 18 01:17:13 2007
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.tools.ant.types.resources;
+
+import java.io.File;
+
+/**
+ * This is an interface that resources that can provide a file should 
implement.
+ * This is a refactoring of [EMAIL PROTECTED] FileResource}, to allow other 
resources
+ * to act as sources of files (and to make components that only support
+ * file-based resources from only support FileResource resources.
+ * @since Ant 1.8
+ */
+public interface FileProvider {
+/**
+ * Get the file represented by this Resource.
+ * @return the file.
+ */
+File getFile();
+}

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java?rev=576769&r1=576768&r2=576769&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java 
(original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/FileResource.java 
Tue Sep 18 01:17:13 2007
@@ -34,7 +34,7 @@
  * A Resource representation of a File.
  * @since Ant 1.7
  */
-public class FileResource extends Resource implements Touchable {
+public class FileResource extends Resource implements Touchable, FileProvider {
 
 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
 private static final int NULL_FILE



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



svn commit: r552475 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java

2007-07-02 Thread stevel
Author: stevel
Date: Mon Jul  2 04:58:07 2007
New Revision: 552475

URL: http://svn.apache.org/viewvc?view=rev&rev=552475
Log:
I know, lets have a more detailed error message when expand fails than just 
"expand failed"

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java?view=diff&rev=552475&r1=552474&r2=552475
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Expand.java Mon Jul  
2 04:58:07 2007
@@ -144,7 +144,8 @@
 
 log("expand complete", Project.MSG_VERBOSE);
 } catch (IOException ioe) {
-throw new BuildException("Error while expanding " + srcF.getPath(),
+throw new BuildException("Error while expanding " + srcF.getPath()
++"\n"+ioe.toString(),
  ioe);
 } finally {
 ZipFile.closeQuietly(zf);



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



svn commit: r546132 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java

2007-06-11 Thread stevel
Author: stevel
Date: Mon Jun 11 05:57:42 2007
New Revision: 546132

URL: http://svn.apache.org/viewvc?view=rev&rev=546132
Log:
mark some static methods as non-final, as it is implicit from being static

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java?view=diff&rev=546132&r1=546131&r2=546132
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java Mon Jun 11 
05:57:42 2007
@@ -889,7 +889,7 @@
  * @return the matching entry, or null if the file is not found
  * @since Ant 1.6.2
  */
-protected static final String findJarName(String fileName,
+protected static String findJarName(String fileName,
   String[] classpath) {
 if (classpath == null) {
 return (new File(fileName)).getName();
@@ -936,7 +936,7 @@
  * @since Ant 1.7
  * @throws IOException on error
  */
-protected static final void grabFilesAndDirs(String file, List dirs,
+protected static void grabFilesAndDirs(String file, List dirs,
  List files)
 throws IOException {
 org.apache.tools.zip.ZipFile zf = null;



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



svn commit: r540954 - in /ant/core/trunk: docs/manual/OptionalTasks/rpm.html src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java

2007-05-23 Thread stevel
Author: stevel
Date: Wed May 23 06:42:50 2007
New Revision: 540954

URL: http://svn.apache.org/viewvc?view=rev&rev=540954
Log:
Let's make the rpm documentation more complete, shall we?

Modified:
ant/core/trunk/docs/manual/OptionalTasks/rpm.html
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java

Modified: ant/core/trunk/docs/manual/OptionalTasks/rpm.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/OptionalTasks/rpm.html?view=diff&rev=540954&r1=540953&r2=540954
==
--- ant/core/trunk/docs/manual/OptionalTasks/rpm.html (original)
+++ ant/core/trunk/docs/manual/OptionalTasks/rpm.html Wed May 23 06:42:50 2007
@@ -27,9 +27,8 @@
 Rpm
 Description
 
-  A basic task for invoking the rpm executable to build a Linux installation
-  file. The task currently only works on Linux or other Unix platforms
-  with rpm support.
+  A basic task for invoking the rpm executable to build a RedHat Package 
Manager Linux installation
+  file. The task currently only works on Linux or other Unix platforms with 
rpm support.
 
 
 Parameters
@@ -41,7 +40,8 @@
   
   
 specFile
-The name of the spec file to be used.
+The name of the spec file to be used. This must be 
relative to the SPECS directory
+under the root of the RPM set in the topDir attribute.
 Yes
   
   
@@ -49,26 +49,33 @@
 
   This is the directory which will have the expected
   subdirectories, SPECS, SOURCES, BUILD, SRPMS.  If this isn't specified,
-  the baseDir value is used
+  the default RPM directory of the system (or user, if ~/.rpmmacros 
defines it) is used (often
+  /usr/src/rpm.
+  Defining a topdir will set %_topdir to the specified directory 
-there is no need
+  to edit your .rpmmacros file.
 
-No
+No, but your build file is very brittle if 
it is not set.
   
   
 cleanBuildDir
 This will remove the generated files in the BUILD
-directory.
+  directory.
+  See the the --clean option of rpmbuild.
+
 No
   
   
 removeSpec
-This will remove the spec file from SPECS
+This will remove the spec file from SPECS.
+  See the the --rmspec option of rpmbuild.
+
 No
   
   
 removeSource
 Flag (optional, default=false) 
 to remove the sources after the build.
-See the the --rmsource  option of rpmbuild.
+See the the --rmsource option of rpmbuild.
 No
   
   
@@ -82,7 +89,7 @@
   
   
 command
-Very similar idea to the cvs task.  the default is 
"-bb"
+The command to pass to the rpmbuild program. The default 
is "-bb"
 No
   
   
@@ -103,7 +110,14 @@
   
 
 
-
+Examples
+
+<rpm
+specFile="example.spec"
+topDir="build/rpm"
+cleanBuildDir="true"
+failOnError="true"/>
+
 
 
 

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java?view=diff&rev=540954&r1=540953&r2=540954
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java Wed 
May 23 06:42:50 2007
@@ -225,7 +225,7 @@
  * @param sf the spec file name to use.
  */
 public void setSpecFile(String sf) {
-if ((sf == null) || (sf.trim().equals(""))) {
+if ((sf == null) || (sf.trim().length()==0)) {
 throw new BuildException("You must specify a spec file", 
getLocation());
 }
 this.specFile = sf;



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



svn commit: r540101 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

2007-05-21 Thread stevel
Author: stevel
Date: Mon May 21 03:22:47 2007
New Revision: 540101

URL: http://svn.apache.org/viewvc?view=rev&rev=540101
Log:
skip a test that, while failing, doesn't seem to arise in real-life

Modified:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

Modified: 
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java?view=diff&rev=540101&r1=540100&r2=540101
==
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
Mon May 21 03:22:47 2007
@@ -88,7 +88,11 @@
 
resolveTo("file:PC03\\jclasses\\lib\\ant-1.7.0.jar","PC03\\jclasses\\lib\\ant-1.7.0.jar");
 }
 
-public void testTripleForwardSlashNetworkURI() throws Exception {
+/**
+ * This is not being tested as we don't appear to generate paths like this 
in the launcher
+ * @throws Exception
+ */
+public void NotestTripleForwardSlashNetworkURI() throws Exception {
 resolveTo("file:///PC03/jclasses/lib/ant-1.7.0.jar", 
"///PC03/jclasses/lib/ant-1.7.0.jar");
 }
 



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



svn commit: r540098 - /ant/core/trunk/build.xml

2007-05-21 Thread stevel
Author: stevel
Date: Mon May 21 03:20:27 2007
New Revision: 540098

URL: http://svn.apache.org/viewvc?view=rev&rev=540098
Log:
exclude this package on java1.3

Modified:
ant/core/trunk/build.xml

Modified: ant/core/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/build.xml?view=diff&rev=540098&r1=540097&r2=540098
==
--- ant/core/trunk/build.xml (original)
+++ ant/core/trunk/build.xml Mon May 21 03:20:27 2007
@@ -170,6 +170,7 @@
 
   
   
+  
 
   
 



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



svn commit: r539719 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-05-19 Thread stevel
Author: stevel
Date: Sat May 19 02:13:54 2007
New Revision: 539719

URL: http://svn.apache.org/viewvc?view=rev&rev=539719
Log:
I'm not sure what changed here but it is modified, so I'm checking it in

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=539719&r1=539718&r2=539719
==
Binary files - no diff available.



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



svn commit: r539477 - in /ant/core/trunk: ./ docs/manual/ src/main/org/apache/tools/ant/ src/main/org/apache/tools/ant/listener/

2007-05-18 Thread stevel
Author: stevel
Date: Fri May 18 07:20:10 2007
New Revision: 539477

URL: http://svn.apache.org/viewvc?view=rev&rev=539477
Log:
Logger work.
The main change is the new BigProjectLogger that makes reading the results of 
very big chained/nested projects  manageable. 

Some pulling up of helper methods into DefaultLogger, and a bit of cleanup 
there; plus the appopriate documentation changes

Added:
ant/core/trunk/src/main/org/apache/tools/ant/listener/BigProjectLogger.java
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/listeners.html
ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java
ant/core/trunk/src/main/org/apache/tools/ant/NoBannerLogger.java
ant/core/trunk/src/main/org/apache/tools/ant/listener/AnsiColorLogger.java
ant/core/trunk/src/main/org/apache/tools/ant/listener/TimestampedLogger.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=539477&r1=539476&r2=539477
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri May 18 07:20:10 2007
@@ -148,6 +148,8 @@
nested element as nested text instead of using the 'value'
   attribute.
 
+* A new logger, BigProjectLogger, lists the project name with every target   
+
 
 Changes from Ant 1.6.5 to Ant 1.7.0
 ===

Modified: ant/core/trunk/docs/manual/listeners.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/listeners.html?view=diff&rev=539477&r1=539476&r2=539477
==
--- ant/core/trunk/docs/manual/listeners.html (original)
+++ ant/core/trunk/docs/manual/listeners.html Fri May 18 07:20:10 2007
@@ -44,13 +44,19 @@
   message logged
 
 
+
+  These are used internally for various recording and housekeeping operations,
+  however new listeners may registered on the command line through the 
-listener
+  argument.
+
+
 Loggers
 
 Loggers extend the capabilities of listeners and add the following 
features:
 
 
   Receives a handle to the standard output and error print streams and
-  therefore can log information to the console or the -logfile specified 
file.
+  therefore can log information to the console or the -logfile 
specified file.
   Logging level (-quiet, -verbose, -debug) aware
   Emacs-mode aware
 
@@ -104,7 +110,11 @@
 Prints the time that a build finished
 BuildLogger
   
-
+  
+org.apache.tools.ant.BigProjectLogger
+Prints the project name every target
+BuildLogger
+  
 
 DefaultLogger
 
@@ -235,7 +245,7 @@
 color codes.  It works on XTerm, ETerm, Win9x Console
 (with ANSI.SYS loaded.), etc.
 NOTE:
-It doesn't work on WinNT even when a COMMAND.COM console loaded with
+It doesn't work on WinNT and successors, even when a COMMAND.COM console 
loaded with
 ANSI.SYS is used.
 If the user wishes to override the default colors
 with custom ones, a file containing zero or more of the
@@ -318,7 +328,7 @@
 
 
 
-To use Log4j you will need the Log4j jar file and a 'log4j.properties'
+To use Log4j you will need the Log4j JAR file and a 'log4j.properties'
 configuration file.  Both should be placed somewhere in your Ant
 classpath. If the log4j.properties is in your project root folder you can
 add this with -lib option:
@@ -386,6 +396,7 @@
 
   BUILD SUCCESSFUL - at 16/08/05 16:24
 
+To use this listener, use the command:
 
 
 
@@ -393,6 +404,63 @@
 
 
 
+BigProjectLogger
+
+
+  This logger is designed to make examining the logs of a big build easier,
+  especially those run under continuous integration tools. It
+
+
+  When entering a child project, prints its name and directory
+  When exiting a child project, prints its name
+  Includes the name of the project when printing a target
+  Omits logging the names of all targets that have no direct task 
output
+  Includes the build finished timestamp of the TimeStamp logger
+
+
+  This is useful when using <subant> to build a large project
+  from many smaller projects -the output shows which particular
+  project is building. Here is an example in which "clean" is being called
+  on all a number of child projects, only some of which perform work:
+
+
+
+==
+Entering project "xunit"
+In /home/ant/components/xunit
+==
+
+xunit.clean:
+   [delete] Deleting directory /home/ant/components/xunit/build
+   [delete] Deleting directory /home/ant/components/xunit/dist
+
+==
+Exiting project "xunit"
+==
+
+===

svn commit: r539002 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/launch/Locator.java src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

2007-05-17 Thread stevel
Author: stevel
Date: Thu May 17 09:25:44 2007
New Revision: 539002

URL: http://svn.apache.org/viewvc?view=rev&rev=539002
Log:
bug 42275...handle failure of File.toURI() by printing the message (too noisy?) 
and falling back to our own code.

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=539002&r1=539001&r2=539002
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu May 17 09:25:44 2007
@@ -19,6 +19,10 @@
 * Regression: Locator fails with URI encoding problem when spaces in path
   Bugzilla report 4
 
+* Regression in Locator: running Ant off a network share does not work:
+  message "URI has authority component" appears
+  Bugzilla report 42275
+
 * Improvements in AntClassLoader Speed.
   Bugzilla report 42259
 
@@ -76,13 +80,14 @@
  
 * -autoproxy turns Java1.5+ automatic proxy support on. Bugzilla 41904
 
-* handle null result of system getProperty(). Bugzilla 42334.
+* Handle null result of system getProperty(). Bugzilla 42334.
 
 * Regression: concat fixlastline="true" should not have applied to
   nested text, but did in Ant 1.7.0. Bugzilla 42369.
 
 * Regression: ant.version was not passed down in .
-  This worked in Ant1.6.5, but not in 1.7.0. Bugzilla bug 42263 
+  This worked in Ant1.6.5, but not in 1.7.0. Bugzilla bug 42263
+
 
 Other changes:
 --

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?view=diff&rev=539002&r1=539001&r2=539002
==
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Thu May 17 
09:25:44 2007
@@ -32,6 +32,16 @@
  * The Locator is a utility class which is used to find certain items
  * in the environment.
  *
+ * It is used at boot time in the launcher, and cannot make use of any of 
Ant's other classes.
+ *
+ * This is a surprisingly brittle piece of code, and has had lots of bugs 
filed against it.
+ * [EMAIL PROTECTED] http://issues.apache.org/bugzilla/show_bug.cgi?id=42275";>running ant off 
a network share can cause Ant to fail}
+ * [EMAIL PROTECTED] http://issues.apache.org/bugzilla/show_bug.cgi?id=8031";>use 
File.toURI().toURL().toExternalForm()}
+ * [EMAIL PROTECTED] http://issues.apache.org/bugzilla/show_bug.cgi?id=4";>Locator 
implementation not encoding URI strings properly: spaces in paths}
+ * It also breaks Eclipse 3.3 Betas
+ * [EMAIL PROTECTED] https://bugs.eclipse.org/bugs/show_bug.cgi?id=183283";>Exception if 
installation path has spaces}
+ *
+ * Be very careful when making changes to this class, as a break will upset a 
lot of people.
  * @since Ant 1.6
  */
 public final class Locator {
@@ -151,12 +161,28 @@
  * @since Ant 1.6
  */
 public static String fromURI(String uri) {
-// #8031: first try Java 1.4.
+// #buzilla8031: first try Java 1.4.
+String result = null;
+//result = fromUriJava14(uri);
+if (result == null) {
+result = fromURIJava13(uri);
+}
+return result;
+}
+
+
+/**
+ * Java1.4+ code to extract the path from the URI.
+ * @param uri
+ * @return null if a conversion was not possible
+ */
+private static String fromUriJava14(String uri) {
 Class uriClazz = null;
 try {
 uriClazz = Class.forName("java.net.URI");
 } catch (ClassNotFoundException cnfe) {
 // Fine, Java 1.3 or earlier, do it by hand.
+return null;
 }
 // Also check for properly formed URIs. Ant formerly recommended using
 // nonsense URIs such as "file:./foo.xml" in XML includes. You 
shouldn't
@@ -165,18 +191,22 @@
 if (uriClazz != null && uri.startsWith("file:/")) {
 try {
 java.lang.reflect.Method createMethod
-= uriClazz.getMethod("create", new Class[] {String.class});
-Object uriObj = createMethod.invoke(null, new Object[] 
{encodeURI(uri)});
+= uriClazz.getMethod("create", new 
Class[]{String.class});
+Object uriObj = createMethod.invoke(null, new 
Object[]{encodeURI(uri)});
 java.lang.reflect.Constructor fileConst
-= File.class.getConstructor(new Class[] {uriClazz});
-File f = (File) fileConst.newInstance(new Object[] {uriO

svn commit: r538995 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/Project.java src/main/org/apache/tools/ant/taskdefs/Ant.java src/tests/antunit/taskdefs/subant-test.xml

2007-05-17 Thread stevel
Author: stevel
Date: Thu May 17 09:16:16 2007
New Revision: 538995

URL: http://svn.apache.org/viewvc?view=rev&rev=538995
Log:
bugzilla bug 42263: ${ant.version} not set in 

Added:
ant/core/trunk/src/tests/antunit/taskdefs/subant-test.xml
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/Project.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ant.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=538995&r1=538994&r2=538995
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu May 17 09:16:16 2007
@@ -81,6 +81,9 @@
 * Regression: concat fixlastline="true" should not have applied to
   nested text, but did in Ant 1.7.0. Bugzilla 42369.
 
+* Regression: ant.version was not passed down in .
+  This worked in Ant1.6.5, but not in 1.7.0. Bugzilla bug 42263 
+
 Other changes:
 --
 * 

svn commit: r537862 - /ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java

2007-05-14 Thread stevel
Author: stevel
Date: Mon May 14 07:55:14 2007
New Revision: 537862

URL: http://svn.apache.org/viewvc?view=rev&rev=537862
Log:
minor javadoc tweaks

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java?view=diff&rev=537862&r1=537861&r2=537862
==
--- ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/MagicNames.java Mon May 14 
07:55:14 2007
@@ -37,55 +37,57 @@
 public static final String ANTLIB_PREFIX = "antlib:";
 
 /**
- * Ant version property. [EMAIL PROTECTED]
+ * Ant version property.
+ * Value: [EMAIL PROTECTED]
  */
 public static final String ANT_VERSION = "ant.version";
 
 /**
- * System classpath policy. [EMAIL PROTECTED]
+ * System classpath policy.
+ * Value: [EMAIL PROTECTED]
  */
 public static final String BUILD_SYSCLASSPATH = "build.sysclasspath";
 
 /**
- * The name of the script repository used by the script repo task
+ * The name of the script repository used by the script repo task.
  * Value [EMAIL PROTECTED]
  */
 public static final String SCRIPT_REPOSITORY = "org.apache.ant.scriptrepo";
 
 /**
- * The name of the reference to the System Class Loader
+ * The name of the reference to the System Class Loader.
  * Value [EMAIL PROTECTED]
  **/
 public static final String SYSTEM_LOADER_REF = "ant.coreLoader";
 
 /**
- * Name of the property which can provide an override of the repository dir
+ * Name of the property which can provide an override of the repository 
dir.
  * for the libraries task
  * Value [EMAIL PROTECTED]
  */
 public static final String REPOSITORY_DIR_PROPERTY = 
"ant.maven.repository.dir";
 /**
- * Name of the property which can provide an override of the repository URL
+ * Name of the property which can provide an override of the repository 
URL.
  * for the libraries task
  * Value [EMAIL PROTECTED]
  */
 public static final String REPOSITORY_URL_PROPERTY = 
"ant.maven.repository.url";
 
 /**
- * name of the resource that taskdefs are stored under
+ * name of the resource that taskdefs are stored under.
  * Value: [EMAIL PROTECTED]
  */
 public static final String TASKDEF_PROPERTIES_RESOURCE =
 "/org/apache/tools/ant/taskdefs/defaults.properties";
 /**
- * name of the resource that typedefs are stored under
+ * name of the resource that typedefs are stored under.
  * Value: [EMAIL PROTECTED]
  */
 public static final String TYPEDEFS_PROPERTIES_RESOURCE =
 "/org/apache/tools/ant/types/defaults.properties";
 
 /**
- * Reference to the current Ant executor
+ * Reference to the current Ant executor.
  * Value: [EMAIL PROTECTED]
  */
 public static final String ANT_EXECUTOR_REFERENCE = "ant.executor";
@@ -96,30 +98,33 @@
  */
 public static final String ANT_EXECUTOR_CLASSNAME = "ant.executor.class";
 /**
- * property name for basedir of the project
+ * property name for basedir of the project.
  * Value: [EMAIL PROTECTED]
  */
 public static final String PROJECT_BASEDIR = "basedir";
 /**
- * property for ant file name
+ * property for ant file name.
  * Value: [EMAIL PROTECTED]
  */
 public static final String ANT_FILE = "ant.file";
 
 /**
  * Property used to store the java version ant is running in.
+ * Value: [EMAIL PROTECTED]
  * @since Ant 1.7
  */
 public static final String ANT_JAVA_VERSION = "ant.java.version";
 
 /**
  * Property used to store the location of ant.
+ * Value: [EMAIL PROTECTED]
  * @since Ant 1.7
  */
 public static final String ANT_HOME = Launcher.ANTHOME_PROPERTY;
 
 /**
  * Property used to store the location of the ant library (typically the 
ant.jar file.)
+ * Value: [EMAIL PROTECTED]
  * @since Ant 1.7
  */
 public static final String ANT_LIB = "ant.core.lib";
@@ -147,7 +152,7 @@
 public static final String BUILD_JAVAC_TARGET = "ant.build.javac.target";
 
 /**
- * Name of the magic property that controls classloader reuse
+ * Name of the magic property that controls classloader reuse.
  * @since Ant 1.4.
  * Value: [EMAIL PROTECTED]
  */
@@ -160,7 +165,7 @@
 public static final String REFID_CLASSPATH_LOADER_PREFIX = "ant.loader.";
 
 /**
- * Reference used to store the 

svn commit: r534920 - /ant/core/trunk/doap_Ant.rdf

2007-05-03 Thread stevel
Author: stevel
Date: Thu May  3 09:04:38 2007
New Revision: 534920

URL: http://svn.apache.org/viewvc?view=rev&rev=534920
Log:
up to date

Modified:
ant/core/trunk/doap_Ant.rdf

Modified: ant/core/trunk/doap_Ant.rdf
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/doap_Ant.rdf?view=diff&rev=534920&r1=534919&r2=534920
==
--- ant/core/trunk/doap_Ant.rdf (original)
+++ ant/core/trunk/doap_Ant.rdf Thu May  3 09:04:38 2007
@@ -35,9 +35,9 @@
 http://projects.apache.org/category/build-management"; />
 
   
-Apache Ant 1.6.5
-2005-06-02
-1.6.5
+Apache Ant 1.7.0
+2006-12-13
+1.7.0
   
 
 



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



svn commit: r534315 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-05-01 Thread stevel
Author: stevel
Date: Tue May  1 22:18:12 2007
New Revision: 534315

URL: http://svn.apache.org/viewvc?view=rev&rev=534315
Log:
pre-talk preparations

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=534315&r1=534314&r2=534315
==
Binary files - no diff available.



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



svn commit: r533567 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

2007-04-29 Thread stevel
Author: stevel
Date: Sun Apr 29 15:11:06 2007
New Revision: 533567

URL: http://svn.apache.org/viewvc?view=rev&rev=533567
Log:
fix the header. Sometimes the IDE get's over enthusiatic, and unless I add some 
location-awareness plugin, it assumes my laptop is always doing work code.

Modified:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java

Modified: 
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java?view=diff&rev=533567&r1=533566&r2=533567
==
--- ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
(original)
+++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java 
Sun Apr 29 15:11:06 2007
@@ -1,27 +1,26 @@
-/** (C) Copyright 2007 Hewlett-Packard Development Company, LP
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
- For more information: www.smartfrog.org
-
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
  */
+
 package org.apache.tools.ant.launch;
 
 import junit.framework.TestCase;
 
-/** created 27-Apr-2007 12:26:47 */
+/** Test the locator in the ant-launch JAR */
 
 public class LocatorTest extends TestCase {
 



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



svn commit: r533214 - /ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 13:40:13 2007
New Revision: 533214

URL: http://svn.apache.org/viewvc?view=rev&rev=533214
Log:
little bit of code review

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java?view=diff&rev=533214&r1=533213&r2=533214
==
--- ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java Fri Apr 27 
13:40:13 2007
@@ -35,6 +35,7 @@
 import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.Vector;
+import java.util.Locale;
 import java.util.jar.Attributes;
 import java.util.jar.Attributes.Name;
 import java.util.jar.JarFile;
@@ -212,7 +213,7 @@
  */
 private Hashtable zipFiles = new Hashtable();
 
-/** Static map of jar file/time to manifiest class-path entries */
+/** Static map of jar file/time to manifest class-path entries */
 private static Map/**/ pathMap = 
Collections.synchronizedMap(new HashMap());
 
 /**
@@ -515,9 +516,7 @@
 } catch (org.apache.tools.ant.taskdefs.ManifestException e) {
 // ignore
 } finally {
-if (manifestStream != null) {
-manifestStream.close();
-}
+FileUtils.close(manifestStream);
 if (jarFile != null) {
 jarFile.close();
 }
@@ -829,6 +828,9 @@
 if (zipFile == null) {
 zipFile = new ZipFile(file);
 zipFiles.put(file, zipFile);
+//to eliminate a race condition, retrieve the entry
+//that is in the hash table under that filename
+zipFile = (ZipFile) zipFiles.get(file);
 }
 ZipEntry entry = zipFile.getEntry(resourceName);
 if (entry != null) {
@@ -1276,7 +1278,8 @@
 }
 }
 
-if (sealedString != null && sealedString.equalsIgnoreCase("true")) {
+if (sealedString != null
+&& sealedString.toLowerCase(Locale.ENGLISH).equals("true")) {
 try {
 sealBase = new 
URL(FileUtils.getFileUtils().toURI(container.getAbsolutePath()));
 } catch (MalformedURLException e) {



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



svn commit: r533193 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 12:10:21 2007
New Revision: 533193

URL: http://svn.apache.org/viewvc?view=rev&rev=533193
Log:
getting ready for apachecon

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=533193&r1=533192&r2=533193
==
Binary files - no diff available.



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



svn commit: r533121 - in /ant/core/trunk: ./ docs/manual/OptionalTasks/ src/main/org/apache/tools/ant/taskdefs/optional/script/ src/main/org/apache/tools/ant/util/ src/tests/antunit/taskdefs/optional/

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 07:37:56 2007
New Revision: 533121

URL: http://svn.apache.org/viewvc?view=rev&rev=533121
Log:
Bug #41597; scriptdef should be resource-enabled.

Added:
ant/core/trunk/src/tests/antunit/taskdefs/optional/script/
ant/core/trunk/src/tests/antunit/taskdefs/optional/script/scriptdef-test.xml
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java
ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerHelper.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=533121&r1=533120&r2=533121
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Apr 27 07:37:56 2007
@@ -4,6 +4,11 @@
 Changes that could break older environments:
 ---
 
+* String resources only have properties single expanded. If you relied on
+   resources being expanded more than once, it no longer happens.
+  Bugzilla report 42277.
+
+
 Fixed bugs:
 ---
 * Error in handling of some permissions, most notably the AllPermission on
@@ -102,6 +107,11 @@
 *  checks for validity of attribute names.
 
 * JUnitVersionHelper.getTestCaseClassName is now public. Bugzilla 42231
+
+*  resource supports nested text. Bugzilla bug 42276
+
+*  now sources scripts from nested resources/resource collections. 
This lets you
+  define scripts in JARs, remote URLs, or any other supported resource. 
Bugzilla report 41597.
 
 
 Changes from Ant 1.6.5 to Ant 1.7.0

Modified: ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html?view=diff&rev=533121&r1=533120&r2=533121
==
--- ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html (original)
+++ ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html Fri Apr 27 07:37:56 
2007
@@ -190,6 +190,13 @@
 type="antlib:example.org:newtype"
 No
   
+  
+any resource or resource collection
+Since Ant1.7.1, this task can load scripts
+from any resource supplied as a nested element. when 
+No
+  
+
 
 
   classpath
@@ -197,6 +204,7 @@
 See the script task
 for using this nested element.
   
+
 
 Examples
 

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java?view=diff&rev=533121&r1=533120&r2=533121
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
 Fri Apr 27 07:37:56 2007
@@ -23,6 +23,8 @@
 import org.apache.tools.ant.MagicNames;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.ProjectHelper;
+import org.apache.tools.ant.types.Resource;
+import org.apache.tools.ant.types.ResourceCollection;
 import org.apache.tools.ant.taskdefs.DefBase;
 
 import java.util.Map;
@@ -250,25 +252,34 @@
 }
 
 // find the script repository - it is stored in the project
+Map scriptRepository = lookupScriptRepository();
+name = ProjectHelper.genComponentName(getURI(), name);
+scriptRepository.put(name, this);
+AntTypeDefinition def = new AntTypeDefinition();
+def.setName(name);
+def.setClass(ScriptDefBase.class);
+ComponentHelper.getComponentHelper(
+getProject()).addDataTypeDefinition(def);
+}
+
+/**
+ * Find or create the script repository - it is stored in the project.
+ * This method is synchronized on the project under [EMAIL PROTECTED] 
MagicNames#SCRIPT_REPOSITORY}
+ * @return the current script repository registered as a refrence.
+ */
+private Map lookupScriptRepository() {
 Map scriptRepository = null;
 Project p = getProject();
 synchronized (p) {
 scriptRepository =
-(Map) p.getReference(MagicNames.SCRIPT_REPOSITORY);
+(Map) p.getReference(MagicNames.SCRIPT_REPOSITORY);
 if (scriptRepository == null) {
 scriptRepository = new HashMap();
 p.addReference(MagicNames.SCRIPT_REPOSITORY,
-scriptRepository);
+scriptRepository);
 }
 }
-
-name = ProjectHelper.genComponentName(getURI(), name);
-scriptRepository.put(name, this);
-   

svn commit: r533115 - in /ant/core/trunk: docs/manual/CoreTypes/resources.html src/main/org/apache/tools/ant/types/resources/StringResource.java

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 07:20:45 2007
New Revision: 533115

URL: http://svn.apache.org/viewvc?view=rev&rev=533115
Log:
bug 42276: support nested text
bug 42277: String resources can have properties double expanded

Nested text is allowed, and property expansion is done at the tail end of a 
write, not on every read.

Modified:
ant/core/trunk/docs/manual/CoreTypes/resources.html

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java

Modified: ant/core/trunk/docs/manual/CoreTypes/resources.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/resources.html?view=diff&rev=533115&r1=533114&r2=533115
==
--- ant/core/trunk/docs/manual/CoreTypes/resources.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/resources.html Fri Apr 27 07:20:45 2007
@@ -249,7 +249,8 @@
 
 string
 
-Represents a Java String. As such a string is readable but not writable.
+Represents a Java String. It can be written to, but only once, after which
+it will be an error to write to again.
 
 
   
@@ -260,9 +261,19 @@
   
 value
 The value of this resource
-Yes
+No
   
 
+
+The resource also supports nested text, which can only be supplied if the 
value attribute is unset:
+  
+
+  <string>
+self.log("Ant version =${ant.version}");
+  </string>
+
+
+
 
 propertyresource
 

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java?view=diff&rev=533115&r1=533114&r2=533115
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java
 Fri Apr 27 07:20:45 2007
@@ -83,18 +83,40 @@
 }
 
 /**
- * Get the value of this StringResource.
+ * Get the value of this StringResource, resolving to the root reference 
if needed.
  * @return the represented String.
  */
 public synchronized String getValue() {
 return getName();
 }
 
+
+/**
+ * The exists attribute tells whether a resource exists.
+ *
+ * @return true if this resource exists.
+ */
+public boolean isExists() {
+return getValue()!=null;
+}
+
+/**
+ * Add nested text to this resource.
+ * Properties will be expanded during this process.
+ * @since Ant1.7.1
+ * @param text text to use as the string resource
+ */
+public void addText(String text) {
+checkChildrenAllowed();
+setValue(getProject().replaceProperties(text));
+}
+
 /**
  * Set the encoding to be used for this StringResource.
  * @param s the encoding name.
  */
 public synchronized void setEncoding(String s) {
+checkAttributesAllowed();
 encoding = s;
 }
 
@@ -129,15 +151,12 @@
 }
 
 /**
- * Get the string.
+ * Get the string. See [EMAIL PROTECTED] #getContent()}
  *
  * @return the string contents of the resource.
  * @since Ant 1.7
  */
 public String toString() {
-if (isReference()) {
-return getCheckedRef().toString();
-}
 return String.valueOf(getContent());
 }
 
@@ -175,14 +194,7 @@
 if (getValue() != null) {
 throw new ImmutableResourceException();
 }
-final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-return new FilterOutputStream(baos) {
-public void close() throws IOException {
-super.close();
-StringResource.this.setValue(encoding == null
-? baos.toString() : baos.toString(encoding));
-}
-};
+return new StringResourceFilterOutputStream();
 }
 
 /**
@@ -197,20 +209,42 @@
 }
 
 /**
- * Get the content of this StringResource.
- * @return a String; if the Project has been set properties
- * replacement will be attempted.
+ * Get the content of this StringResource. See [EMAIL PROTECTED] 
#getValue()}
+ * @return a String or null if there is no value.
  */
 protected synchronized String getContent() {
-if (isReference()) {
-return ((StringResource) getCheckedRef()).getContent();
-}
-String value = getValue();
-if (value == null) {
-return value;
+return getValue();
+}
+
+/**
+ * This method is only for use by our private helper output stream.
+ * It contains specific logic for expanding properties.
+ * @param output the output
+ */
+private void setValueFromOutputStream(String output) {
+String value;
+if(get

svn commit: r533113 - /ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 07:18:26 2007
New Revision: 533113

URL: http://svn.apache.org/viewvc?view=rev&rev=533113
Log:
not files, resources

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java?view=diff&rev=533113&r1=533112&r2=533113
==
--- ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java Fri Apr 27 
07:18:26 2007
@@ -154,7 +154,7 @@
 }
 
 /**
- * The exists attribute tells whether a file exists.
+ * The exists attribute tells whether a resource exists.
  * @return true if this resource exists.
  */
 public boolean isExists() {



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



svn commit: r533112 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 07:17:56 2007
New Revision: 533112

URL: http://svn.apache.org/viewvc?view=rev&rev=533112
Log:
Bind string resources to projects. There's no bugrep with this, but it is good 
practise

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java?view=diff&rev=533112&r1=533111&r2=533112
==
--- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Tokens.java 
Fri Apr 27 07:17:56 2007
@@ -71,7 +71,9 @@
 ArrayList result = new ArrayList();
 try {
 for (String s = tokenizer.getToken(rdr); s != null; s = 
tokenizer.getToken(rdr)) {
-result.add(new StringResource(s));
+StringResource resource = new StringResource(s);
+resource.setProject(getProject());
+result.add(resource);
 }
 } catch (IOException e) {
 throw new BuildException("Error reading tokens", e);



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



svn commit: r533110 - /ant/core/trunk/docs/manual/OptionalTasks/script.html

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 07:17:08 2007
New Revision: 533110

URL: http://svn.apache.org/viewvc?view=rev&rev=533110
Log:
bsf reference

Modified:
ant/core/trunk/docs/manual/OptionalTasks/script.html

Modified: ant/core/trunk/docs/manual/OptionalTasks/script.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/OptionalTasks/script.html?view=diff&rev=533110&r1=533109&r2=533110
==
--- ant/core/trunk/docs/manual/OptionalTasks/script.html (original)
+++ ant/core/trunk/docs/manual/OptionalTasks/script.html Fri Apr 27 07:17:08 
2007
@@ -52,7 +52,7 @@
 JavaDoc (especially for
 Project and
 Script) 
for more information.
-If you are using JavaScript a good resource is http://www.mozilla.org/rhino/doc.html";>
+If you are using JavaScript under BSF, a good resource is http://www.mozilla.org/rhino/doc.html";>
 http://www.mozilla.org/rhino/doc.html as we are using their JavaScript 
interpreter.
 Scripts can do almost anything a task written in Java could do.
 Rhino provides a special construct - the JavaAdapter. With that you 
can



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



svn commit: r533082 - in /ant/core/trunk/src: main/org/apache/tools/ant/launch/Locator.java tests/junit/org/apache/tools/ant/launch/ tests/junit/org/apache/tools/ant/launch/LocatorTest.java

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 05:45:53 2007
New Revision: 533082

URL: http://svn.apache.org/viewvc?view=rev&rev=533082
Log:
Bug 42275: ant doesnt run from a network share, because of an error when trying 
to work out where we loaded from.

1. this exception is still raised, but caught and causes ant to skip setting 
ant.lib.

2. we now have a test class for Locator

3. I've split out the java1.3 support and made it public, so we can test it 
separately. 

One of the tests is failing, showing the problem is still there. We need to 
decide what to do about it (ignore, switch to java1.3 code...)

Added:
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/
ant/core/trunk/src/tests/junit/org/apache/tools/ant/launch/LocatorTest.java
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?view=diff&rev=533082&r1=533081&r2=533082
==
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Fri Apr 27 
05:45:53 2007
@@ -49,6 +49,8 @@
 private static char[] gAfterEscaping2 = new char[128];
 private static char[] gHexChs = {'0', '1', '2', '3', '4', '5', '6', '7',
  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+public static final String ERROR_NOT_FILE_URI = "Can only handle valid 
file: URIs, not ";
+
 // initialize the above 3 arrays
 static {
 for (int i = 0; i <= 0x1f; i++) {
@@ -113,14 +115,19 @@
 }
 if (url != null) {
 String u = url.toString();
-if (u.startsWith("jar:file:")) {
-int pling = u.indexOf("!");
-String jarName = u.substring(4, pling);
-return new File(fromURI(jarName));
-} else if (u.startsWith("file:")) {
-int tail = u.indexOf(resource);
-String dirName = u.substring(0, tail);
-return new File(fromURI(dirName));
+try {
+if (u.startsWith("jar:file:")) {
+int pling = u.indexOf("!");
+String jarName = u.substring(4, pling);
+return new File(fromURI(jarName));
+} else if (u.startsWith("file:")) {
+int tail = u.indexOf(resource);
+String dirName = u.substring(0, tail);
+return new File(fromURI(dirName));
+}
+} catch (IllegalArgumentException e) {
+//unable to determine the URI for reasons unknown.
+return null;
 }
 }
 return null;
@@ -169,7 +176,7 @@
 Throwable e2 = e.getTargetException();
 if (e2 instanceof IllegalArgumentException) {
 // Bad URI, pass this on.
-throw (IllegalArgumentException) e2;
+throw new IllegalArgumentException("Bad URI "+uri+ 
":"+e2.getMessage(),e2);
 } else {
 // Unexpected target exception? Should not happen.
 e2.printStackTrace();
@@ -179,7 +186,15 @@
 e.printStackTrace();
 }
 }
+return fromURIJava13(uri);
+}
 
+/**
+ * This is only public for testing purposes, so its use is strongly 
discouraged.
+ * @param uri uri to expand
+ * @return the decoded URI
+ */
+public static String fromURIJava13(String uri) {
 // Fallback method for Java 1.3 or earlier.
 
 URL url = null;
@@ -189,7 +204,7 @@
 // Ignore malformed exception
 }
 if (url == null || !("file".equals(url.getProtocol( {
-throw new IllegalArgumentException("Can only handle valid file: 
URIs");
+throw new IllegalArgumentException(ERROR_NOT_FILE_URI +uri);
 }
 StringBuffer buf = new StringBuffer(url.getHost());
 if (buf.length() > 0) {
@@ -216,7 +231,7 @@
 } catch (UnsupportedEncodingException exc) {
 // not sure whether this is clean, but this method is
 // declared not to throw exceptions.
-throw new IllegalStateException("Could not convert URI to path: "
+throw new IllegalStateException("Could not convert URI "+uri+" to 
path: "
 + exc.getMessage());
 }

svn commit: r533058 - /ant/core/trunk/WHATSNEW

2007-04-27 Thread stevel
Author: stevel
Date: Fri Apr 27 03:51:34 2007
New Revision: 533058

URL: http://svn.apache.org/viewvc?view=rev&rev=533058
Log:
bug ID#42231, a static method is package scoped instead of public

Modified:
ant/core/trunk/WHATSNEW

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=533058&r1=533057&r2=533058
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Apr 27 03:51:34 2007
@@ -99,7 +99,9 @@
 
 * Patternset allows nested inverted patternsets using .
 
-*  checks for validity of attribute names. 
+*  checks for validity of attribute names.
+
+* JUnitVersionHelper.getTestCaseClassName is now public. Bugzilla 42231
 
 
 Changes from Ant 1.6.5 to Ant 1.7.0



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



svn commit: r532325 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java

2007-04-25 Thread stevel
Author: stevel
Date: Wed Apr 25 04:46:08 2007
New Revision: 532325

URL: http://svn.apache.org/viewvc?view=rev&rev=532325
Log:
bug ID#42231, a static method is package scoped instead of public

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java?view=diff&rev=532325&r1=532324&r2=532325
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java
 Wed Apr 25 04:46:08 2007
@@ -25,10 +25,20 @@
 /**
  * Work around for some changes to the public JUnit API between
  * different JUnit releases.
+ * @since Ant 1.7
  */
 public class JUnitVersionHelper {
 
 private static Method testCaseName = null;
+
+/**
+ * Name of the JUnit4 class we look for.
+ * [EMAIL PROTECTED]
+ * @since Ant 1.7.1
+ */
+public static final String JUNIT_FRAMEWORK_JUNIT4_TEST_CASE_FACADE = 
"junit.framework.JUnit4TestCaseFacade";
+private static final String UNKNOWN_TEST_CASE_NAME = "unknown";
+
 static {
 try {
 testCaseName = TestCase.class.getMethod("getName", new Class[0]);
@@ -36,7 +46,7 @@
 // pre JUnit 3.7
 try {
 testCaseName = TestCase.class.getMethod("name", new Class[0]);
-} catch (NoSuchMethodException e2) {
+} catch (NoSuchMethodException ignored) {
 // ignore
 }
 }
@@ -60,9 +70,9 @@
 public static String getTestCaseName(Test t) {
 if (t == null)
 {
-return "unknown";
+return UNKNOWN_TEST_CASE_NAME;
 }
-if 
(t.getClass().getName().equals("junit.framework.JUnit4TestCaseFacade")) {
+if 
(t.getClass().getName().equals(JUNIT_FRAMEWORK_JUNIT4_TEST_CASE_FACADE)) {
 // Self-describing as of JUnit 4 (#38811). But trim "(ClassName)".
 String name = t.toString();
 if (name.endsWith(")")) {
@@ -75,7 +85,7 @@
 if (t instanceof TestCase && testCaseName != null) {
 try {
 return (String) testCaseName.invoke(t, new Object[0]);
-} catch (Throwable e) {
+} catch (Throwable ignored) {
 // ignore
 }
 } else {
@@ -92,23 +102,27 @@
 && getNameMethod.getReturnType() == String.class) {
 return (String) getNameMethod.invoke(t, new Object[0]);
 }
-} catch (Throwable e) {
+} catch (Throwable ignored) {
 // ignore
 }
 }
-return "unknown";
+return UNKNOWN_TEST_CASE_NAME;
 }
 
 /**
  * Tries to find the name of the class which a test represents
- * across JUnit 3 and 4.
+ * across JUnit 3 and 4. For Junit4 it parses the toString() value of the
+ * test, and extracts it from there.
+ * @since Ant 1.7.1 (it was private until then)
+ * @param test test case to look at
+ * @return the extracted class name.
  */
-static String getTestCaseClassName(Test test) {
+public static String getTestCaseClassName(Test test) {
 String className = test.getClass().getName();
 if (test instanceof JUnitTaskMirrorImpl.VmExitErrorTest) {
 className = ((JUnitTaskMirrorImpl.VmExitErrorTest) 
test).getClassName();
 } else
-if (className.equals("junit.framework.JUnit4TestCaseFacade")) {
+if (className.equals(JUNIT_FRAMEWORK_JUNIT4_TEST_CASE_FACADE)) {
 // JUnit 4 wraps solo tests this way. We can extract
 // the original test name with a little hack.
 String name = test.toString();



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



svn commit: r531604 - /ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 14:14:23 2007
New Revision: 531604

URL: http://svn.apache.org/viewvc?view=rev&rev=531604
Log:
typo

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java?view=diff&rev=531604&r1=531603&r2=531604
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerCreator.java 
Mon Apr 23 14:14:23 2007
@@ -107,7 +107,7 @@
  * This checks if the script manager exists in the scriptLoader
  * classloader and if so it creates and returns the script runner.
  * @param checkManager check if the manager matchs this value.
- * @param mangagerClass the name of the script manager class.
+ * @param managerClass the name of the script manager class.
  * @param runnerClass   the name of ant's script runner for this manager.
  * @return the script runner class.
  * @throws BuildException if there is a problem creating the runner class.



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



svn commit: r531603 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 14:13:52 2007
New Revision: 531603

URL: http://svn.apache.org/viewvc?view=rev&rev=531603
Log:
make the name of application.xml a constant, use locale-sensitive case 
conversion

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java?view=diff&rev=531603&r1=531602&r2=531603
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Ear.java Mon Apr 23 
14:13:52 2007
@@ -19,6 +19,8 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Locale;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.ZipFileSet;
@@ -37,6 +39,7 @@
 
 private File deploymentDescriptor;
 private boolean descriptorAdded;
+private static final String XML_DESCRIPTOR_PATH = 
"META-INF/application.xml";
 
 /**
  * Create an Ear task.
@@ -72,7 +75,7 @@
 // Create a ZipFileSet for this file, and pass it up.
 ZipFileSet fs = new ZipFileSet();
 fs.setFile(deploymentDescriptor);
-fs.setFullpath("META-INF/application.xml");
+fs.setFullpath(XML_DESCRIPTOR_PATH);
 super.addFileset(fs);
 }
 
@@ -122,14 +125,16 @@
 // attribute - or if it's being added twice, meaning the same
 // file is specified by the "appxml" attribute and in a
 //  element.
-if (vPath.equalsIgnoreCase("META-INF/application.xml"))  {
-if (deploymentDescriptor == null
+String vPathLowerCase = vPath.toLowerCase(Locale.ENGLISH);
+if (XML_DESCRIPTOR_PATH.equals(vPathLowerCase))  {
+if (deploymentDescriptor != null
 || !FILE_UTILS.fileNameEquals(deploymentDescriptor, file)
 || descriptorAdded) {
 log("Warning: selected " + archiveType
-+ " files include a META-INF/application.xml which will"
++ " files include a "+ XML_DESCRIPTOR_PATH +" which will"
 + " be ignored (please use appxml attribute to "
-+ archiveType + " task)", Project.MSG_WARN);
++ archiveType + " task)",
+Project.MSG_WARN);
 } else {
 super.zipFile(file, zOut, vPath, mode);
 descriptorAdded = true;



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



svn commit: r531599 - /ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 14:10:42 2007
New Revision: 531599

URL: http://svn.apache.org/viewvc?view=rev&rev=531599
Log:
BuildExceptions get caught and rethrown

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java?view=diff&rev=531599&r1=531598&r2=531599
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
 Mon Apr 23 14:10:42 2007
@@ -95,7 +95,11 @@
 }
 // execute the script
 return engine.invoke("eval", String.class, getScript());
+} catch (BuildException be) {
+//catch and rethrow build exceptions
+throw be;
 } catch (Exception be) {
+//any other exception? Get its cause
 Throwable t = be;
 Throwable te = (Throwable) ReflectUtil.invoke(be, "getCause");
 if (te != null) {



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



svn commit: r531486 - /ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 07:45:30 2007
New Revision: 531486

URL: http://svn.apache.org/viewvc?view=rev&rev=531486
Log:
Very delicate changes to Introspection helper

1. warnings in the javadocs about how sensitive the file is
2. factoring out of the code to handle InvocationTargetExeptions
3. some more javadocs
4. some IDE-hinted warnings about static classes, access modifiers on 
abstract/private class constructors

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java?view=diff&rev=531486&r1=531485&r2=531486
==
--- ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java Mon 
Apr 23 07:45:30 2007
@@ -37,7 +37,23 @@
  * Helper class that collects the methods a task or nested element
  * holds to set attributes, create nested elements or hold PCDATA
  * elements.
- * The class is final as it has a private constructor.
+ *
+ * It contains hashtables containing classes that use introspection
+ * to handle all the invocation of the project-component specific methods.
+ *
+ * This class is somewhat complex, as it implements the O/X mapping between
+ * Ant XML and Java class instances. This is not the best place for someone new
+ * to Ant to start contributing to the codebase, as a change here can break the
+ * entire system in interesting ways. Always run a full test of Ant before 
checking
+ * in/submitting changes to this file.  
+ *
+ * The class is final and has a private constructor.
+ * To get an instance for a specific (class,project) combination, use [EMAIL 
PROTECTED] #getHelper(Project,Class)}.
+ * This may return an existing version, or a new one
+ * ...do not make any assumptions about its uniqueness, or its validity after 
the Project
+ * instance has finished its build.
+ *
+ *
  */
 public final class IntrospectionHelper  {
 
@@ -324,7 +340,7 @@
  * The method will make sure the helper will be cleaned up at the end of
  * the project, and only one instance will be created for each class.
  *
- * @param p the project instance.
+ * @param p the project instance. Can be null, in which case the helper is 
not cached.
  * @param c The class for which a helper is required.
  *  Must not be null.
  *
@@ -402,11 +418,7 @@
 // impossible as getMethods should only return public methods
 throw new BuildException(ie);
 } catch (InvocationTargetException ite) {
-Throwable t = ite.getTargetException();
-if (t instanceof BuildException) {
-throw (BuildException) t;
-}
-throw new BuildException(t);
+throw extractBuildException(ite);
 }
 }
 
@@ -450,11 +462,7 @@
 // impossible as getMethods should only return public methods
 throw new BuildException(ie);
 } catch (InvocationTargetException ite) {
-Throwable t = ite.getTargetException();
-if (t instanceof BuildException) {
-throw (BuildException) t;
-}
-throw new BuildException(t);
+throw extractBuildException(ite);
 }
 }
 
@@ -472,6 +480,17 @@
 throw new UnsupportedElementException(msg, elementName);
 }
 
+/**
+ * Get the specific NestedCreator for a given project/parent/element 
combination
+ * @param project ant project
+ * @param parentUri URI of the parent.
+ * @param parent the parent class
+ * @param elementName element to work with. This can contain
+ *  a URI,localname tuple of of the form uri:localname
+ * @param child the bit of XML to work with
+ * @return a nested creator that can handle the child elements.
+ * @throws BuildException if the parent does not support child elements of 
that name
+ */
 private NestedCreator getNestedCreator(
 Project project, String parentUri, Object parent,
 String elementName, UnknownElement child) throws BuildException {
@@ -486,7 +505,7 @@
 parentUri = "";
 }
 NestedCreator nc = null;
-if (uri.equals(parentUri) || uri.equals("")) {
+if (uri.equals(parentUri) || uri.length()==0) {
 nc = (NestedCreator) nestedCreators.get(
 name.toLowerCase(Locale.US));
 }
@@ -567,11 +586,7 @@
 // impossible as getMethods should only return public methods
 throw new BuildException(ine);
 } catch (InvocationTargetException ite) {
-Throwable t = ite.getTargetException();
-if (t instanceof BuildException) {
-

svn commit: r531485 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/antversion-test.xml

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 07:43:25 2007
New Revision: 531485

URL: http://svn.apache.org/viewvc?view=rev&rev=531485
Log:
Fix the version logic to work without having hard coded ant versions in there.

Modified:
ant/core/trunk/src/tests/antunit/taskdefs/condition/antversion-test.xml

Modified: 
ant/core/trunk/src/tests/antunit/taskdefs/condition/antversion-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/condition/antversion-test.xml?view=diff&rev=531485&r1=531484&r2=531485
==
--- ant/core/trunk/src/tests/antunit/taskdefs/condition/antversion-test.xml 
(original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/condition/antversion-test.xml Mon 
Apr 23 07:43:25 2007
@@ -2,15 +2,16 @@
 
 
   
-
+
 


   
 
   
-
-  
+
+
+   

   
 



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



svn commit: r531483 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 07:41:10 2007
New Revision: 531483

URL: http://svn.apache.org/viewvc?view=rev&rev=531483
Log:
Print out the name of the attribute and its value when there is a conversion 
error

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java?view=diff&rev=531483&r1=531482&r2=531483
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java 
(original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java 
Mon Apr 23 07:41:10 2007
@@ -77,14 +77,18 @@
 if (null == atLeast && null == exactly) {
 throw new BuildException("One of atleast or exactly must be set.");
 }
-try {
-if (atLeast != null) {
+if (atLeast != null) {
+try {
 new DeweyDecimal(atLeast);
-} else {
+} catch (NumberFormatException e) {
+throw new BuildException("The 'atleast' attribute is not a 
Dewey Decimal eg 1.1.0 : " + atLeast);
+}
+} else {
+try {
 new DeweyDecimal(exactly);
+} catch (NumberFormatException e) {
+throw new BuildException("The 'exactly' attribute is not a 
Dewey Decimal eg 1.1.0 : " + exactly);
 }
-} catch (NumberFormatException e) {
-throw new BuildException("The argument is not a Dewey Decimal eg 
1.1.0");
 }
 }
 



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



svn commit: r531472 - /ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 07:11:46 2007
New Revision: 531472

URL: http://svn.apache.org/viewvc?view=rev&rev=531472
Log:
Test didnt work on Unix. Assume that ${user.home} is in a partition with some 
(but finite) space. If anyone runs these tests on a disk array with >1 
petabyte, they will still fail.

Modified:
ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml

Modified: 
ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml?view=diff&rev=531472&r1=531471&r2=531472
==
--- ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml 
(original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/condition/hasfreespace-test.xml 
Mon Apr 23 07:11:46 2007
@@ -2,29 +2,32 @@
 
 
   
-   
+
+  
+
+
   
 
- 
+  
   
   
 
   
 
- 
+  

   
 
   

 
- 
+ 
 
   

   
 
-  
+

   
 



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



svn commit: r531448 - /ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 05:30:32 2007
New Revision: 531448

URL: http://svn.apache.org/viewvc?view=rev&rev=531448
Log:
correct the comment to match the code -we only check for string args-

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java?view=diff&rev=531448&r1=531447&r2=531448
==
--- ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java Mon 
Apr 23 05:30:32 2007
@@ -206,8 +206,7 @@
 continue;
 }
 /*
-If the argument is not a String or Location,
-and if there
+If the argument is not a String and if there
 is an overloaded form of this method already defined,
 we just override that with the new one.
 This mechanism does not guarantee any specific order



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



svn commit: r531427 - /ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java

2007-04-23 Thread stevel
Author: stevel
Date: Mon Apr 23 04:00:52 2007
New Revision: 531427

URL: http://svn.apache.org/viewvc?view=rev&rev=531427
Log:
don't drop the underlying cause when thing can't be read

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java?view=diff&rev=531427&r1=531426&r2=531427
==
--- ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/types/FilterSet.java Mon Apr 
23 04:00:52 2007
@@ -370,7 +370,7 @@
   }
} catch (Exception ex) {
   throw new BuildException("Could not read filters from file: "
-  + filtersFile);
+  + filtersFile,ex);
} finally {
   FileUtils.close(in);
}



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



svn commit: r528522 - /ant/core/trunk/docs/manual/proxy.html

2007-04-13 Thread stevel
Author: stevel
Date: Fri Apr 13 08:24:35 2007
New Revision: 528522

URL: http://svn.apache.org/viewvc?view=rev&rev=528522
Log:
now I understand how proxies work under Java 5

Modified:
ant/core/trunk/docs/manual/proxy.html

Modified: ant/core/trunk/docs/manual/proxy.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/proxy.html?view=diff&rev=528522&r1=528521&r2=528522
==
--- ant/core/trunk/docs/manual/proxy.html (original)
+++ ant/core/trunk/docs/manual/proxy.html Fri Apr 13 08:24:35 2007
@@ -32,7 +32,7 @@
 
 
 
-All tasks running in Ant's JVM share the same HTTP/FTP/Socks
+All tasks and threads running in Ant's JVM share the same HTTP/FTP/Socks
 proxy configuration.
 
 
@@ -71,33 +71,66 @@
 
 This property maybe enough to give command-line Ant
 builds network access, although in practise the results
-are somewhat disappointing.
+are inconsistent.
 
 
-We are not entirely sure where it reads the property settings from. 
-For windows, it probably reads the appropriate bits of the registry. For
-Unix/Linux it may use the current Gnome2 settings. 
-
+It is has also been reported a breaking the IBM Java 5 JRE on AIX,
+and does not always work on Linux (presumably due to missing gconf 
settings)
+Other odd things can go wrong, like Oracle JDBC drivers or pure Java SVN 
clients.
+
+
 
-One limitation of this feature, other than requiring a 1.5+ JVM,
-is that it is not dynamic. A long-lasting build hosted on a laptop will
-not adapt to changes in proxy settings.
+To make the -autoproxy option the default, add it to the 
environment variable
+ANT_ARGS, which contains a list of arguments to pass to Ant 
on every
+command line run.
 
 
+How Autoproxy works
+
+We are grateful for some input from Sun as to how the proxy code works under
+Java 1.5 and up. The java.net.useSystemProxies is checked only
+once, at startup time, the other checks (registry, gconf, system properties) 
are done
+dynamically whenever needed (socket connection, URL connection etc..).
+
+Windows
 
 
-It is has also been reported a breaking the IBM Java 5 JRE on AIX,
-and does not appear to work reliably on Linux.
-Other odd things can go wrong, like Oracle JDBC drivers or pure Java SVN 
clients.
+The JVM goes straight to the registry, bypassing WinInet, as it is not
+present/consistent on all supported Windows platforms (it is part of IE,
+really). Java 7 may use the Windows APIs on the platforms when it is present.
 
 
+Linux
+
 
-To make the -autproxy option the default, add it to the 
environment variable
-ANT_ARGS, which contains a list of arguments to pass to Ant 
on every
-command line run.
+The JVM uses the gconf library to look at specific entries.
+The GConf-2 settings used are:
+
+
+ - /system/http_proxy/use_http_proxyboolean
+ - /system/http_proxy/use_authenticationboolean
+ - /system/http_proxy/host  string
+ - /system/http_proxy/authentication_user   string
+ - /system/http_proxy/authentication_password   string
+ - /system/http_proxy/port  int
+ - /system/proxy/socks_host string
+ - /system/proxy/mode   string
+ - /system/proxy/ftp_host   string
+ - /system/proxy/secure_hoststring
+ - /system/proxy/socks_port int
+ - /system/proxy/ftp_port   int
+ - /system/proxy/secure_portint
+ - /system/proxy/no_proxy_for   list
+ - /system/proxy/gopher_hoststring
+ - /system/proxy/gopher_portint
+
+
+If you are using KDE or another GUI than Gnome, you can still use the
+gconf-editor tool to add these entries.
 
 
-JVM options
+
+Manual JVM options
 
 Any JVM can have its proxy options explicitly configured by passing
 the appropriate -D system property options to the runtime.
@@ -116,8 +149,13 @@
 setenv ANT_OPTS "-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"
 
 
-  For Windows, set the ANT_OPTS environment variable in the appropriate 
"MyComputer" 
-  properties dialog box.
+If you insert this line into the Ant shell script itself, it gets picked up
+by all continuous integration tools running on the system that call Ant via the
+command line.
+
+
+  For Windows, set the ANT_OPTS environment variable in the 
appropriate "My Computer" 
+  properties dialog box (winXP), "Computer" properties (Vista)
 
 
   This mechanism works across Java versions, is cross-platform and reliable. 
@@ -133,6 +171,7 @@
   Not dynamic enough to deal with laptop configuration changes.
   
 
+
 SetProxy Task
 
 The setproxy task can be used to
@@ -174,16 +213,73 @@
   </target>
 
 
+Custom ProxySelector implementations
+
+As Java le

svn commit: r527130 - /ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java

2007-04-10 Thread stevel
Author: stevel
Date: Tue Apr 10 06:14:40 2007
New Revision: 527130

URL: http://svn.apache.org/viewvc?view=rev&rev=527130
Log:
adding javadocs. It seems to me that this code could be replaced by 
deleteChars.indexOf(c)>=0, delegating the loop to the string class itself

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java?view=diff&rev=527130&r1=527129&r2=527130
==
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java Tue 
Apr 10 06:14:40 2007
@@ -659,7 +659,12 @@
 };
 }
 
-/** check if the character c is to be deleted */
+/**
+ *  check if the character c is to be deleted
+ *
+ * @param c char to test
+ * @return true if the supplied char is in the list to be stripped.
+ */
 private boolean isDeleteCharacter(char c) {
 for (int d = 0; d < deleteChars.length(); ++d) {
 if (deleteChars.charAt(d) ==  c) {



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



svn commit: r521804 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-23 Thread stevel
Author: stevel
Date: Fri Mar 23 10:03:42 2007
New Revision: 521804

URL: http://svn.apache.org/viewvc?view=rev&rev=521804
Log:
draft for burning to CD, distribution to attendees.

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=521804&r1=521803&r2=521804
==
Binary files - no diff available.



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



svn commit: r520384 - /ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java

2007-03-20 Thread stevel
Author: stevel
Date: Tue Mar 20 06:31:41 2007
New Revision: 520384

URL: http://svn.apache.org/viewvc?view=rev&rev=520384
Log:
no need to mark static methods as final

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?view=diff&rev=520384&r1=520383&r2=520384
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Tue Mar 20 
06:31:41 2007
@@ -939,7 +939,7 @@
  * @throws IOException if the contents could not be read out from the
  * reader.
  */
-public static final String readFully(Reader rdr) throws IOException {
+public static String readFully(Reader rdr) throws IOException {
 return readFully(rdr, BUF_SIZE);
 }
 
@@ -954,7 +954,7 @@
  * @throws IOException if the contents could not be read out from the
  * reader.
  */
-public static final String readFully(Reader rdr, int bufferSize)
+public static String readFully(Reader rdr, int bufferSize)
 throws IOException {
 if (bufferSize <= 0) {
 throw new IllegalArgumentException("Buffer size must be greater "



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



svn commit: r520382 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/Main.java

2007-03-20 Thread stevel
Author: stevel
Date: Tue Mar 20 06:30:24 2007
New Revision: 520382

URL: http://svn.apache.org/viewvc?view=rev&rev=520382
Log:
bug id 41904; -autoproxy broken.

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=520382&r1=520381&r2=520382
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Mar 20 06:30:24 2007
@@ -54,8 +54,7 @@
 
 *  did not append.  Bugzilla 41399.
  
-*  xsl stylesheets allow setting the title used in  and 
 tags by
-  using  element.  Bugzilla 41742.
+* -autoproxy turns Java1.5+ automatic proxy support on. Bugzilla 41904
 
 Other changes:
 --
@@ -87,6 +86,11 @@
 * Add a  resource collection, corresponding to .
 
 * Add new  task.
+
+*  xsl stylesheets allow setting the title used in  and 
 tags by
+  using  element.  Bugzilla 41742.
+  
+  
 
 Changes from Ant 1.6.5 to Ant 1.7.0
 ===

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Main.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Main.java?view=diff&rev=520382&r1=520381&r2=520382
==
--- ant/core/trunk/src/main/org/apache/tools/ant/Main.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Main.java Tue Mar 20 06:30:24 
2007
@@ -382,7 +382,7 @@
 + "the ant script/.bat file and Ant itself.";
 throw new BuildException(msg);
 } else if (arg.equals("-autoproxy")) {
-proxy = false;
+proxy = true;
 } else if (arg.startsWith("-")) {
 // we don't have any more args to recognize!
 String msg = "Unknown argument: " + arg;



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



svn commit: r520355 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-20 Thread stevel
Author: stevel
Date: Tue Mar 20 04:09:36 2007
New Revision: 520355

URL: http://svn.apache.org/viewvc?view=rev&rev=520355
Log:
Jan's feedback applied

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=520355&r1=520354&r2=520355
==
Binary files - no diff available.



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



svn commit: r518225 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-14 Thread stevel
Author: stevel
Date: Wed Mar 14 10:23:20 2007
New Revision: 518225

URL: http://svn.apache.org/viewvc?view=rev&rev=518225
Log:
How to write a task

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=518225&r1=518224&r2=518225
==
Binary files - no diff available.



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



svn commit: r518215 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-14 Thread stevel
Author: stevel
Date: Wed Mar 14 09:55:14 2007
New Revision: 518215

URL: http://svn.apache.org/viewvc?view=rev&rev=518215
Log:
about to attempt some new master to get page layout right at print time

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=518215&r1=518214&r2=518215
==
Binary files - no diff available.



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



svn commit: r517896 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-13 Thread stevel
Author: stevel
Date: Tue Mar 13 14:57:13 2007
New Revision: 517896

URL: http://svn.apache.org/viewvc?view=rev&rev=517896
Log:
More on what you shouldn't do

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=517896&r1=517895&r2=517896
==
Binary files - no diff available.



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



svn commit: r517780 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-13 Thread stevel
Author: stevel
Date: Tue Mar 13 10:12:26 2007
New Revision: 517780

URL: http://svn.apache.org/viewvc?view=rev&rev=517780
Log:
More examples

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=517780&r1=517779&r2=517780
==
Binary files - no diff available.



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



svn commit: r517724 - /ant/core/trunk/docs/slides/extending_ant.odp

2007-03-13 Thread stevel
Author: stevel
Date: Tue Mar 13 08:17:26 2007
New Revision: 517724

URL: http://svn.apache.org/viewvc?view=rev&rev=517724
Log:
OOo Impress is like powerpoint only less reliable

Modified:
ant/core/trunk/docs/slides/extending_ant.odp

Modified: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=diff&rev=517724&r1=517723&r2=517724
==
Binary files - no diff available.



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



svn commit: r517649 - in /ant/core/trunk/docs/slides: ./ extending_ant.odp

2007-03-13 Thread stevel
Author: stevel
Date: Tue Mar 13 04:38:31 2007
New Revision: 517649

URL: http://svn.apache.org/viewvc?view=rev&rev=517649
Log:
These are the slides for ApacheCon; I'm doing them in the apache repo as that 
is where they will live.

Added:
ant/core/trunk/docs/slides/
ant/core/trunk/docs/slides/extending_ant.odp   (with props)

Added: ant/core/trunk/docs/slides/extending_ant.odp
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/slides/extending_ant.odp?view=auto&rev=517649
==
Binary file - no diff available.

Propchange: ant/core/trunk/docs/slides/extending_ant.odp
--
svn:mime-type = application/octet-stream



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



svn commit: r507587 - /ant/core/trunk/docs/manual/CoreTasks/parallel.html

2007-02-14 Thread stevel
Author: stevel
Date: Wed Feb 14 07:43:08 2007
New Revision: 507587

URL: http://svn.apache.org/viewvc?view=rev&rev=507587
Log:
thread-safe edition

Modified:
ant/core/trunk/docs/manual/CoreTasks/parallel.html

Modified: ant/core/trunk/docs/manual/CoreTasks/parallel.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/parallel.html?view=diff&rev=507587&r1=507586&r2=507587
==
--- ant/core/trunk/docs/manual/CoreTasks/parallel.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/parallel.html Wed Feb 14 07:43:08 2007
@@ -26,8 +26,32 @@
 
 Parallel
 Description
-Parallel is a container task - it can contain other Ant tasks. Each nested
-task within the parallel task will be executed in its own thread. 
+
+Executes nested tasks in parallel with no guarantees of thread safety.
+Every task will run in its own thread, with the likelihood of 
+concurrency problems scaling with the number of CPUs on the host system.
+
+Warning: While the Ant core is believed to be thread safe, no such 
+guarantees are made about tasks, which are not tested for thread safety 
during
+Ant's test process. 
+Third party tasks may or may not be thread safe, and some of Ant's core 
tasks, such as
+<javac> are definitely not re-entrant. This is because 
they use libraries that
+were never designed to be used in a multithreaded environment.
+
+
+The primary use case for <parallel> is to run external 
programs
+such as an application server, and the JUnit or TestNG test suites at the
+same time. Anyone trying to run large Ant task sequences in parallel, such
+as javadoc and javac at the same time, is implicitly taking on the task
+of identifying and fixing all concurrency bugs the tasks that they run.
+
+
+
+Accordingly, while this task has uses, it should be considered an advanced
+task which should be used in certain batch-processing or testing 
situations,
+rather than an easy trick to speed up build times on a multiway CPU. 
+
+
 Parameters
 
   
@@ -43,15 +67,10 @@
   
 threadsPerProcessor
 Maximum number of threads to use per available processor
-(Requires JDK 1.4)
+(Java 1.4+)
 No, defers to threadCount
   
   
-pollInterval
-Currently has no effect
-No, default is 1000
-  
-  
 timeout
 Number of milliseconds before execution is terminated
 No
@@ -62,28 +81,29 @@
  at that point without waiting for any other tasks to 
complete.
 No
   
+  
+pollInterval
+Currently has no effect
+No, default is 1000
+  
 
 
 Parallel tasks have a number of uses in an Ant build file including:
 
-Taking advantage of available processing resources to reduce build 
time
+Taking advantage of available processing resources to excute external
+ programs simultaneously.
 Testing servers, where the server can be run in one thread and the test
 harness is run in another thread.
 
 
-Care must be taken when using multithreading to ensure the tasks within the
-threads do not interact. For example, two javac compile tasks which write
-classes into the same destination directory may interact where one tries to
-read a class for dependency information while the other task is writing the
-class file. Be sure to avoid these types of interactions within a
-<parallel> task
-
 Any valid Ant task may be embedded within a
-parallel task, including other parallel tasks.
+parallel task, including other parallel tasks, though there is no guarantee 
that
+the tasks will be thread safe in such an environment.
 
-Note that while the tasks within the parallel task are being run, the main
+While the tasks within the parallel task are being run, the main
 thread will be blocked waiting for all the child threads to complete. If
-execution is terminated by a timeout or a nested task failure when the 
failonany
+execution is terminated by a timeout or a nested task failure when the
+failonany
 flag is set, the parallel task will complete without waiting for other nested
 tasks to complete in other threads.
 
@@ -96,7 +116,7 @@
 sequential task to define sequences of tasks to be executed on each thread
 within the parallel block
 
-The threadCount attribute can be used to place a maximum number of available
+The threadCount attribute can be used to place a maximum 
number of available
 threads for the execution.  When not present all child tasks will be executed 
at
 once.  When present then the maximum number of concurrently executing tasks 
will
 not exceed the number of threads specified.  Furthermore, each task will be
@@ -104,16 +124,18 @@
 of execution or the order of completion of the tasks, only that each will be
 started before the next.
 
-If you are using J2RE 1.4 or later you can also use the threadsPerProcessor
+If you are using Java 1.4 or later you can also use the 
threadsPerProcess

svn commit: r498630 - /ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml

2007-01-22 Thread stevel
Author: stevel
Date: Mon Jan 22 06:53:28 2007
New Revision: 498630

URL: http://svn.apache.org/viewvc?view=rev&rev=498630
Log:
Not making this a failing test on gump, because its not clear the behaviour is 
anomalous w.r.t the Xml specifications.

Modified:
ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml

Modified: ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml?view=diff&rev=498630&r1=498629&r2=498630
==
--- ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml Mon Jan 22 
06:53:28 2007
@@ -23,14 +23,14 @@
 semanticAttributes="true"/>
 
  element  expectedactual
-p ${app.n}${app.p}
+p $${app.n}${app.p}
 nn${app.n}
 on${app.o}
 mn${app.m}
 
   
 
-  
+  
 
 
 



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



svn commit: r498628 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java

2007-01-22 Thread stevel
Author: stevel
Date: Mon Jan 22 06:51:35 2007
New Revision: 498628

URL: http://svn.apache.org/viewvc?view=rev&rev=498628
Log:
no point in a public ctor to a package scope class; mention other JVMs in the 
javadocs

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

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java?view=diff&rev=498628&r1=498627&r2=498628
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java 
Mon Jan 22 06:51:35 2007
@@ -70,10 +70,10 @@
  * removing a process results in an empty list, the
  * ProcessDestroyer is removed as a shutdown hook.
  */
-public ProcessDestroyer() {
+ProcessDestroyer() {
 try {
 // check to see if the shutdown hook methods exists
-// (support pre-JDK 1.3 VMs)
+// (support pre-JDK 1.3 and Non-Sun VMs)
 Class[] paramTypes = {Thread.class};
 addShutdownHookMethod =
 Runtime.class.getMethod("addShutdownHook", paramTypes);



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



svn commit: r497394 - /ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml

2007-01-18 Thread stevel
Author: stevel
Date: Thu Jan 18 02:56:42 2007
New Revision: 497394

URL: http://svn.apache.org/viewvc?view=rev&rev=497394
Log:
fix the tests. the problem is some double expansion going on in antunit's 
assertions

Modified:
ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml

Modified: ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml?view=diff&rev=497394&r1=497393&r2=497394
==
--- ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml Thu Jan 18 
02:56:42 2007
@@ -15,7 +15,7 @@
 
   
 
-  
+  
 
-
+  
+
+  
+
 
 
-
-
-
-
+
+
 
-   
-  
+  xml attributes are not expanding correctly
+  expected: mnop=nnn$${app.n}
+  actualmnop=${sequence}
+  
+
+  
+
+  
 
   
 



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



svn commit: r497387 - in /ant/core/trunk/src/tests/antunit/taskdefs: xmlproperty-test.xml xmlproperty.inline-expansion.xml

2007-01-18 Thread stevel
Author: stevel
Date: Thu Jan 18 02:33:30 2007
New Revision: 497387

URL: http://svn.apache.org/viewvc?view=rev&rev=497387
Log:
looking at how xml properties get expanded

Added:
ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml
Modified:
ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml

Modified: ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml?view=diff&rev=497387&r1=497386&r2=497387
==
--- ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty-test.xml Thu Jan 18 
02:33:30 2007
@@ -6,12 +6,39 @@
   
 
   
+
   
 
 
 
   
 
+  
+
+  
+
+
+ element  expectedactual
+p ${app.n}${app.p}
+nn${app.n}
+on${app.o}
+mn${app.m}
+
+
+
+
+
+
+
+
+
+   
+  
+
   
 
 

Added: 
ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml?view=auto&rev=497387
==
--- ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml 
(added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/xmlproperty.inline-expansion.xml 
Thu Jan 18 02:33:30 2007
@@ -0,0 +1,16 @@
+
+  
+  
+
\ No newline at end of file



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



svn commit: r496879 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java

2007-01-16 Thread stevel
Author: stevel
Date: Tue Jan 16 14:24:42 2007
New Revision: 496879

URL: http://svn.apache.org/viewvc?view=rev&rev=496879
Log:
I forgot to add an @since tag when this was added.

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

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java?view=diff&rev=496879&r1=496878&r2=496879
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Xor.java 
Tue Jan 16 14:24:42 2007
@@ -24,6 +24,7 @@
 /**
  * The Xor condition type to exclusive or operations.
  * This does not shortcut stuff.
+ * @since Ant 1.7
  */
 public class Xor extends ConditionBase implements Condition {
 



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



svn commit: r495399 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/ComponentHelper.java

2007-01-11 Thread stevel
Author: stevel
Date: Thu Jan 11 14:01:51 2007
New Revision: 495399

URL: http://svn.apache.org/viewvc?view=rev&rev=495399
Log:
Extra diagnostics. Dump all types in a namespace if the one you ask for isnt 
known. Good for identifying typos, and helps you differentiate "library not yet 
loaded" from "task unknown"

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=495399&r1=495398&r2=495399
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Jan 11 14:01:51 2007
@@ -63,6 +63,10 @@
 
 * Allow  to refer directly to a FileNameMapper instance.
 
+* If you try and use a type in a namespace (or an antlib), and the type is not
+  recognized but there are other definitions in that namespace, Ant lists what
+  the known definitions are. This helps you find spelling errors. 
+
 Changes from Ant 1.6.5 to Ant 1.7.0
 ===
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java?view=diff&rev=495399&r1=495398&r2=495399
==
--- ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java Thu Jan 
11 14:01:51 2007
@@ -33,6 +33,10 @@
 import java.util.Properties;
 import java.util.Set;
 import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 
 import org.apache.tools.ant.taskdefs.Typedef;
 import org.apache.tools.ant.taskdefs.Definer;
@@ -760,6 +764,8 @@
 /**
  * Called for each component name, check if the
  * associated URI has been examined for antlibs.
+ * @param componentName the name of the component, which should include a 
URI
+ *  prefix if it is in a namespace
  */
 private synchronized void checkNamespace(String componentName) {
 String uri = ProjectHelper.extractUriFromComponentName(componentName);
@@ -929,21 +935,36 @@
 }
 
 /**
- * Print unknown definition.
+ * Print unknown definition.forking
  */
 private void printUnknownDefinition(
 PrintWriter out, String componentName, String dirListing) {
 boolean isAntlib = componentName.indexOf(MagicNames.ANTLIB_PREFIX) == 
0;
+String uri=ProjectHelper.extractUriFromComponentName(componentName);
 out.println("Cause: The name is undefined.");
 out.println("Action: Check the spelling.");
 out.println("Action: Check that any custom tasks/types have been 
declared.");
 out.println("Action: Check that any /"
 + " declarations have taken place.");
-if (isAntlib) {
-out.println();
-out.println("This appears to be an antlib declaration. ");
-out.println("Action: Check that the implementing library exists in 
one of:");
-out.println(dirListing);
+if(uri.length()>0) {
+List matches = antTypeTable.findMatches(uri);
+if(matches.size()>0) {
+out.println();
+out.println("The definitions in the namespace "+uri+" are:");
+for(Iterator it=matches.iterator();it.hasNext();) {
+AntTypeDefinition def=(AntTypeDefinition) it.next();
+String local = 
ProjectHelper.extractNameFromComponentName(def.getName());
+out.println(""+local);
+}
+} else {
+out.println("No types or tasks have been defined in this 
namespace yet");
+if (isAntlib) {
+out.println();
+out.println("This appears to be an antlib declaration. ");
+out.println("Action: Check that the implementing library 
exists in one of:");
+out.println(dirListing);
+}
+}
 }
 }
 
@@ -1035,6 +1056,22 @@
 public boolean containsValue(Object value) {
 return contains(value);
 }
-}
 
+/**
+ * Create a list of all definitions that match a prefix, usually the 
URI
+ * of a library
+ * @param prefix prefix to match off
+ * @return the (possibly empty) list of definitions
+ */
+public List/**/ findMatches(String prefix) {
+ArrayList matches=new ArrayList();
+

svn commit: r495229 - in /ant/core/trunk: ./ src/etc/testcases/taskdefs/rmic/ src/main/org/apache/tools/ant/taskdefs/rmic/ src/tests/junit/org/apache/tools/ant/taskdefs/

2007-01-11 Thread stevel
Author: stevel
Date: Thu Jan 11 06:02:50 2007
New Revision: 495229

URL: http://svn.apache.org/viewvc?view=rev&rev=495229
Log:
Bug 41349: rmic should strip out -J compiler args when not forking

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java

ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/RmicAdvancedTest.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=495229&r1=495228&r2=495229
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Jan 11 06:02:50 2007
@@ -34,6 +34,10 @@
 * Regression: NPE was thrown when using  against a
   (third-party instantiated) fileset with null Project reference.
 
+* Strip out all -J arguments to non forking rmic adapters, specifically
+  the Sun and Weblogic compilers.
+  Bug report 41349  
+
 Other changes:
 --
 

Modified: ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml?view=diff&rev=495229&r1=495228&r2=495229
==
--- ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/rmic/rmic.xml Thu Jan 11 06:02:50 
2007
@@ -153,6 +153,14 @@
 
   
 
+
+  
+
+  
+
+
+  
+
   
 
+  
+
+  
+
+  
+
   
 
   

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java?view=diff&rev=495229&r1=495228&r2=495229
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java
 Thu Jan 11 06:02:50 2007
@@ -21,6 +21,9 @@
 import java.io.File;
 import java.util.Random;
 import java.util.Vector;
+import java.util.List;
+import java.util.ArrayList;
+
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.taskdefs.Rmic;
 import org.apache.tools.ant.types.Commandline;
@@ -249,11 +252,48 @@
 cmd.createArgument().setValue("-g");
 }
 
-cmd.addArguments(attributes.getCurrentCompilerArgs());
+String[] compilerArgs = attributes.getCurrentCompilerArgs();
+compilerArgs = preprocessCompilerArgs(compilerArgs);
+cmd.addArguments(compilerArgs);
 
 logAndAddFilesToCompile(cmd);
 return cmd;
  }
+
+/**
+ * Preprocess the compiler arguments in any way you see fit.
+ * This is to allow compiler adapters to validate or filter the arguments.
+ * The base implementation returns the original compiler arguments 
unchanged.
+ * @param compilerArgs the original compiler arguments
+ * @return the filtered set.
+ */
+protected String[] preprocessCompilerArgs(String[] compilerArgs) {
+return compilerArgs;
+}
+
+
+/**
+ * Strip out all -J args from the command list. Invoke this from
+ * [EMAIL PROTECTED] #preprocessCompilerArgs(String[])} if you have a 
non-forking
+ * compiler. 
+ * @param compilerArgs the original compiler arguments
+ * @return the filtered set.
+ */
+protected String[] filterJvmCompilerArgs(String[] compilerArgs) {
+int len = compilerArgs.length;
+List args=new ArrayList(len);
+for(int i=0;ihttp://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java?view=diff&rev=495229&r1=495228&r2=495229
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/SunRmic.java Thu 
Jan 11 06:02:50 2007
@@ -100,4 +100,14 @@
 }
 }
 }
+
+
+/**
+ * Strip out all -J args from the command list.
+ * @param compilerArgs the original compiler arguments
+ * @return the filtered set.
+ */
+protected String[] preprocessCompilerArgs(String[] compilerArgs) {
+return filterJvmCompilerArgs(compilerArgs);
+}
 }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/rmic/WLRmic.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/task

svn commit: r492317 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/Apt.java

2007-01-03 Thread stevel
Author: stevel
Date: Wed Jan  3 13:46:42 2007
New Revision: 492317

URL: http://svn.apache.org/viewvc?view=rev&rev=492317
Log:
bug 41280 APT Task ignores memoryMaximumSize argument

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

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=492317&r1=492316&r2=492317
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Jan  3 13:46:42 2007
@@ -28,6 +28,9 @@
   if not set) as it caused a BC problem.
   Bugzilla report 41268.
 
+*  forks properly and so memory settings are picked up.
+  Bug report 41280.
+
 Other changes:
 --
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Apt.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Apt.java?view=diff&rev=492317&r1=492316&r2=492317
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Apt.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Apt.java Wed Jan  3 
13:46:42 2007
@@ -110,7 +110,7 @@
 public Apt() {
 super();
 super.setCompiler(AptExternalCompilerAdapter.class.getName());
-setFork(true);
+super.setFork(true);
 }
 
 /**



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



svn commit: r492314 - /ant/core/trunk/xdocs/resources.xml

2007-01-03 Thread stevel
Author: stevel
Date: Wed Jan  3 13:43:29 2007
New Revision: 492314

URL: http://svn.apache.org/viewvc?view=rev&rev=492314
Log:
hyphens break the autolinking to bookstores

Modified:
ant/core/trunk/xdocs/resources.xml

Modified: ant/core/trunk/xdocs/resources.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/xdocs/resources.xml?view=diff&rev=492314&r1=492313&r2=492314
==
--- ant/core/trunk/xdocs/resources.xml (original)
+++ ant/core/trunk/xdocs/resources.xml Wed Jan  3 13:43:29 2007
@@ -92,7 +92,7 @@
 
   The most recent books come first
   
+  isbn="193239480X">
 Published April/May 2007, and covering Ant 1.7.
 
 This is a major rewrite of the first edition; still 600 pages long.



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



svn commit: r485920 - in /ant/core/trunk: WHATSNEW docs/manual/proxy.html docs/manual/running.html src/main/org/apache/tools/ant/Main.java

2006-12-11 Thread stevel
Author: stevel
Date: Mon Dec 11 14:25:29 2006
New Revision: 485920

URL: http://svn.apache.org/viewvc?view=rev&rev=485920
Log:
automatic proxy handling is only there if -autoproxy is set; marked as such in 
the docs. -noproxy is removed.

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/proxy.html
ant/core/trunk/docs/manual/running.html
ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=485920&r1=485919&r2=485920
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Dec 11 14:25:29 2006
@@ -9,6 +9,9 @@
   not available, or if explicitly requested by using
   a "manager" attribute.
 
+* The -noproxy option which was in the previous 1.7 alpha and beta
+  releases has been removed. It is the default behavior and not needed.
+
 Fixed bugs:
 ---
 * Directory deletion did not work properly.
@@ -63,7 +66,12 @@
   EnumeratedAttribute. Bugzilla 41058.
 
 * Create a pom file for ant-testutil and add ant-testutil.jar to the ant
-  distribution. Bugzilla 40980.  
+  distribution. Bugzilla 40980.
+
+* Roll back automatic proxy enabling on Java 1.5. It broke things like
+  Oracle JDBC drivers, and Ant itself on IBM's JVM on AIX, and didnt
+  seem to work to well the rest of the time.
+  To enable the feature, use the -autoproxy command line option. 
 
 Changes from Ant 1.7.0Beta3 to Ant 1.7.0RC1
 ===

Modified: ant/core/trunk/docs/manual/proxy.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/proxy.html?view=diff&rev=485920&r1=485919&r2=485920
==
--- ant/core/trunk/docs/manual/proxy.html (original)
+++ ant/core/trunk/docs/manual/proxy.html Mon Dec 11 14:25:29 2006
@@ -26,6 +26,11 @@
 Proxy Configuration
 
 
+This page discussing proxy issues on command-line ant.
+Consult your IDE documentation for IDE-specific information upon proxy setup.
+
+
+
 
 All tasks running in Ant's JVM share the same HTTP/FTP/Socks
 proxy configuration.
@@ -44,42 +49,29 @@
 does not work behind the firewall.
 
 
-This is a longstanding problem with Java and Ant, which Java1.5 finally 
-addresses. When Ant is run under Java1.5, it automatically sets the 
-java.net.useSystemProxies system property, telling the JVM to 
-switch to the OS-configured proxy settings.This is automatic, but it can 
be disabled.
-
-
-When running Ant on older JVMs, this property is ignored. There are two 
other
-ways to configure Ant's proxy settings in these cases.
+This is a long standing problem with Java and Ant. The only way to fix
+it is to explictly configure Ant with the proxy settings, either
+by passing down the proxy details as JVM properties, or to
+tell Ant on a Java1.5+ system to have the JVM work it out for itself.
+
 
 
 
 
-Java1.5 automatic proxy support (new for Ant1.7)
+Java1.5+ proxy support (new for Ant1.7)
 
-When Ant starts up, it automatically sets the 
+When Ant starts up, if the -autoproxy
+command is supplied, Ant sets the
 java.net.useSystemProxies system property. This tells 
 a Java1.5+ JVM to use the current set of property settings of the host
 environment. Other JVMs, such as the Kaffe and Apache Harmony runtimes,
-may also use this property in future, which is why Ant always sets the
-property -it is ignored on the Java1.4 and earlier runtimes.
+may also use this property in future.
+It is ignored on the Java1.4 and earlier runtimes.
 
 
-This property should be enough to automatically give Ant hosted
-builds network access. It may also work under an IDE, though that depends
-upon the IDE and how it starts ant. If it bypasses Ant's Main entry point,
-the proxy setup may be skipped, and if networking has already started up
-by the time ant is run, the option may be ignored. Consult your IDE 
-documentation for IDE-specific information upon proxy setup.
-
-
-To disable this automatic feature, set the command line option
--noproxy, or set a JVM or Ant property 
-java.net.useSystemProxies to a value other than
-true or on. If the JVM option is already set, 
-Ant will not touch it; if an Ant property of that name is set, Ant will
-pass the value of that property down to the JVM.
+This property maybe enough to give command-line Ant
+builds network access, although in practise the results
+are somewhat disappointing.
 
 
 We are not entirely sure where it reads the property settings from. 
@@ -87,14 +79,22 @@
 Unix/Linux it may use the current Gnome2 settings. 
 
 
-The biggest limitation of this feature, other than requiring a 1.5+ JVM,
+One limitation

svn commit: r484857 - /ant/core/trunk/xdocs/resources.xml

2006-12-08 Thread stevel
Author: stevel
Date: Fri Dec  8 16:10:40 2006
New Revision: 484857

URL: http://svn.apache.org/viewvc?view=rev&rev=484857
Log:
I plan to have this frozen by the end of the month too.

Modified:
ant/core/trunk/xdocs/resources.xml

Modified: ant/core/trunk/xdocs/resources.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/xdocs/resources.xml?view=diff&rev=484857&r1=484856&r2=484857
==
--- ant/core/trunk/xdocs/resources.xml (original)
+++ ant/core/trunk/xdocs/resources.xml Fri Dec  8 16:10:40 2006
@@ -91,6 +91,59 @@
 
 
   The most recent books come first
+  
+Published April/May 2007, and covering Ant 1.7.
+
+This is a major rewrite of the first edition; still 600 pages long.
+
+
+
+  This book moves up from Ant1.5 to Java1.5 and 1.7, with a 
near-complete
+  rewrite of the applied-ant section, covering new topics such as
+  antlibs, repository management with Ivy, Xml Schema validation,
+  EJB3.0/Java EE development and advanced deployment using SmartFrog.
+  The ant coding section looks at AntUnit, antlib authoring and
+  scripting languages, while the beginners chapters, the first third
+  of the book, still shows developers how to build, test, package and
+  redistribute a Java application.
+
+
+  If you are one of the 20,000+ owners of the first edition, it is now
+  obsolete. Sorry :)
+
+
+
+  
+Author:
+Steve Loughran and Erik Hatcher
+  
+  
+Publisher URL:
+
+  http://www.manning.com/loughran/";>
+http://www.manning.com/loughran/
+  
+
+  
+  
+Book URL
+
+  http://antbook.org/";>
+http://antbook.org/
+  
+
+  
+  
+Source code repository
+
+  http://sourceforge.net/projects/antbook";>
+http://sourceforge.net/projects/antbook
+  
+
+  
+
+  
 
   
 Published April 2005, and covers Ant release 1.6.1.



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



svn commit: r484842 - /ant/core/trunk/docs/manual/OptionalTasks/script.html

2006-12-08 Thread stevel
Author: stevel
Date: Fri Dec  8 15:23:47 2006
New Revision: 484842

URL: http://svn.apache.org/viewvc?view=rev&rev=484842
Log:
fix the link

Modified:
ant/core/trunk/docs/manual/OptionalTasks/script.html

Modified: ant/core/trunk/docs/manual/OptionalTasks/script.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/OptionalTasks/script.html?view=diff&rev=484842&r1=484841&r2=484842
==
--- ant/core/trunk/docs/manual/OptionalTasks/script.html (original)
+++ ant/core/trunk/docs/manual/OptionalTasks/script.html Fri Dec  8 15:23:47 
2006
@@ -29,7 +29,7 @@
   Execute a script in a
 http://jakarta.apache.org/bsf"; target="_top">Apache BSF
 or
-JSR 233  supported language.
+https://scripting.dev.java.net";>JSR 233  supported language.
   
   Note:
 This task depends on external libraries not included in the Ant 
distribution.



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



svn commit: r473393 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java

2006-11-10 Thread stevel
Author: stevel
Date: Fri Nov 10 09:20:05 2006
New Revision: 473393

URL: http://svn.apache.org/viewvc?view=rev&rev=473393
Log:
I'm still trying to stabilize the web.xml is optional policy. Maybe we just 
pull it. Here the problem is that if you try and  where there already is 
one, there may not be an addedWebXmlFile.

I would have thought isInUpdateMode would handle this, but it does not. Instead 
we remember tht a web.xml file was set on teh command line, and get away with 
it. I may also downgrade the error to a warning.

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java?view=diff&rev=473393&r1=473392&r2=473393
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java Fri Nov 10 
09:20:05 2006
@@ -216,7 +216,7 @@
  * gets executed.
  */
 protected void cleanUp() {
-if (addedWebXmlFile == null && needxmlfile && !isInUpdateMode()) {
+if (addedWebXmlFile == null && deploymentDescriptor==null && 
needxmlfile && !isInUpdateMode()) {
 throw new BuildException("No WEB-INF/web.xml file was added.\n"
 + "If this is your intent, set needxml='false' ");
 }



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



svn commit: r468568 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTasks/war.html src/main/org/apache/tools/ant/taskdefs/War.java src/tests/antunit/taskdefs/war-test.xml

2006-10-27 Thread stevel
Author: stevel
Date: Fri Oct 27 15:33:42 2006
New Revision: 468568

URL: http://svn.apache.org/viewvc?view=rev&rev=468568
Log:
Made web.xml non optional again, as it was hiding too many bugs (e.g war files 
for tomcat 5), but added an attribute to make it optional. 

More tests, especially for updates. One test is disabled because it fails. The 
task fails if you are pulling in a web.xml on an existing web.xml file via a 
fileset if update=false, because the fileset version checking is hiding the 
inclusion of the web.xml file from the war task -its being dropped before we 
notice. This is not a BC problem. Maybe I should always make web.xml mandatory 
to stop this behavior arising.

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/CoreTasks/war.html
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java
ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=468568&r1=468567&r2=468568
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Oct 27 15:33:42 2006
@@ -28,9 +28,8 @@
   Bugzilla 40019.
 
 *  task now allows you to omit the web.xml file. as this is optional
-  in the servlet 2.5 and Java EE 5 APIs. If you do want a web.xml file, it
-  can be pulled in by any nested fileset or resource reference; the webxml
-  attribute is optional.
+  in the servlet 2.5 and Java EE 5 APIs. set needxmlfile="false" to
+  avoid a missing web.xml file from halting the build.  
 
 * Diagnostics catches and logs security exceptions when accessing system 
properties.
 

Modified: ant/core/trunk/docs/manual/CoreTasks/war.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/war.html?view=diff&rev=468568&r1=468567&r2=468568
==
--- ant/core/trunk/docs/manual/CoreTasks/war.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/war.html Fri Oct 27 15:33:42 2006
@@ -41,14 +41,17 @@
 
 Before Servlet API 2.5/Java EE 5, a WEB-INF/web.xml file was mandatory in a
 WAR file, so this task failed if the webxml attribute was 
missing.
-As the web.xml file is now optional, the webxml attribute is 
now
-downgraded to being optional. The task will warn if the file is not
-included as an attribute or in a fileset, but still succeed. The task
-will also complain if more than one web.xml file is added to the JAR. 
+As the web.xml file is now optional, the webxml attribute may 
now
+be made optional. However, as most real web applications do need a web.xml 
file,
+it is not optional by default. The task will fail if the file is not
+included, unless the needxmlfile attribute
+is set to true. The task
+will warn if more than one web.xml file is added to the JAR  
+through the filesets.
 
 
 
-Please note that the zip format allows multiple files of the same
+Please note that the Zip format allows multiple files of the same
 fully-qualified name to exist within a single archive.  This has been
 documented as causing various problems for unsuspecting users.  If you wish
 to avoid this behavior you must set the duplicate attribute
@@ -73,8 +76,18 @@
   
   
 webxml
-The deployment descriptor to use (WEB-INF/web.xml).
-No (since Ant1.7)
+The servlet configuration descriptor to use 
(WEB-INF/web.xml).
+Yes, unless needxmlfile is true,
+the file is pulled in via a nested fileset, or an existing WAR file is
+being updated.
+  
+  
+needxmlfile
+Flag to indicate whether or not the web.xml file is 
needed.
+I=it should be set to false when generating
+servlet 2.5+ WAR files without a web.xml file.
+Since Ant 1.7
+No -default "true"
   
   
 basedir

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java?view=diff&rev=468568&r1=468567&r2=468568
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java Fri Oct 27 
15:33:42 2006
@@ -55,11 +55,15 @@
 /**
  * flag set if the descriptor is added
  */
-private boolean descriptorAdded;
+private boolean needxmlfile=true;
 private File addedWebXmlFile;
 
 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
-private static final String XML_DESCRIPTOR_PATH = "web-inf/web.xml";
+/** path to web.xml file */
+private static final String XML_DESCRIPTOR_PATH = "WEB-INF/web.xml";
+/** lower case version for comparisons */
+private static fi

svn commit: r468556 - /ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java

2006-10-27 Thread stevel
Author: stevel
Date: Fri Oct 27 15:08:51 2006
New Revision: 468556

URL: http://svn.apache.org/viewvc?view=rev&rev=468556
Log:
remove some imports we dont need

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java?view=diff&rev=468556&r1=468555&r2=468556
==
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/TokenFilter.java Fri 
Oct 27 15:08:51 2006
@@ -25,11 +25,8 @@
 import org.apache.tools.ant.ProjectComponent;
 import org.apache.tools.ant.types.RegularExpression;
 import org.apache.tools.ant.types.Substitution;
-import org.apache.tools.ant.util.FileUtils;
 import org.apache.tools.ant.util.Tokenizer;
-import org.apache.tools.ant.util.FileTokenizer;
 import org.apache.tools.ant.util.LineTokenizer;
-import org.apache.tools.ant.util.StringTokenizer;
 import org.apache.tools.ant.util.StringUtils;
 import org.apache.tools.ant.util.regexp.Regexp;
 



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



svn commit: r468184 - /ant/core/trunk/WHATSNEW

2006-10-26 Thread stevel
Author: stevel
Date: Thu Oct 26 16:15:17 2006
New Revision: 468184

URL: http://svn.apache.org/viewvc?view=rev&rev=468184
Log:
update change log

Modified:
ant/core/trunk/WHATSNEW

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=468184&r1=468183&r2=468184
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Oct 26 16:15:17 2006
@@ -24,10 +24,18 @@
 
 * removed dependence on sun.misc.UUEncoder for UUMailer.
 
-* added regex attribute to the echoproperties task. 
+* added regex attribute to the echoproperties task.
   Bugzilla 40019.
 
-Changes from Ant 1.7.0Beta2 to Ant 1.7.0Beta3 
+*  task now allows you to omit the web.xml file. as this is optional
+  in the servlet 2.5 and Java EE 5 APIs. If you do want a web.xml file, it
+  can be pulled in by any nested fileset or resource reference; the webxml
+  attribute is optional.
+
+* Diagnostics catches and logs security exceptions when accessing system 
properties.
+
+
+Changes from Ant 1.7.0Beta2 to Ant 1.7.0Beta3
 =
 
 Changes that could break older environments:



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



svn commit: r468181 - /ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java

2006-10-26 Thread stevel
Author: stevel
Date: Thu Oct 26 16:11:25 2006
New Revision: 468181

URL: http://svn.apache.org/viewvc?view=rev&rev=468181
Log:
handle security checks on property get gracefully

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java?view=diff&rev=468181&r1=468180&r2=468181
==
--- ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java Thu Oct 26 
16:11:25 2006
@@ -49,7 +49,16 @@
  */
 public final class Diagnostics {
 
+/**
+ * value for which a difference between clock and temp file time triggers
+ * a warning.
+ * [EMAIL PROTECTED]
+ */
 private static final int BIG_DRIFT_LIMIT = 1;
+/**
+ * How big a test file to write.
+ * [EMAIL PROTECTED]
+ */
 private static final int TEST_FILE_SIZE = 32;
 private static final int KILOBYTE = 1024;
 private static final int SECONDS_PER_MILLISECOND = 1000;
@@ -58,6 +67,12 @@
 private static final String TEST_CLASS
 = "org.apache.tools.ant.taskdefs.optional.Test";
 
+/**
+ * The error text when a security manager blocks access to a property.
+ * [EMAIL PROTECTED]
+ */
+protected static final String ERROR_PROPERTY_ACCESS_BLOCKED = "Access to 
this property blocked by a security manager";
+
 /** utility class */
 private Diagnostics() {
 // hidden constructor
@@ -322,17 +337,29 @@
 for (Enumeration keys = sysprops.propertyNames();
 keys.hasMoreElements();) {
 String key = (String) keys.nextElement();
-String value;
-try {
-value = System.getProperty(key);
-} catch (SecurityException e) {
-value = "Access to this property blocked by a security 
manager";
-}
+String value = getProperty(key);
 out.println(key + " : " + value);
 }
 }
 
 /**
+ * Get the value of a system property. If a security manager
+ * blocks access to a property it fills the result in with an error 
+ * @param key
+ * @return the system property's value or error text
+ * @see #ERROR_PROPERTY_ACCESS_BLOCKED
+ */
+private static String getProperty(String key) {
+String value;
+try {
+value = System.getProperty(key);
+} catch (SecurityException e) {
+value = ERROR_PROPERTY_ACCESS_BLOCKED;
+}
+return value;
+}
+
+/**
  * Report the content of ANT_HOME/lib directory
  * @param out the stream to print the content to
  */
@@ -558,28 +585,27 @@
 }
 
 /**
- * print a property name="value" pair, or name=[undefined] if there is none
- * @param out
- * @param name
+ * print a property name="value" pair if the property is set;
+ * print nothing if it is null
+ * @param out stream to print on
+ * @param key property name
  */
-private static void printProperty(PrintStream out,String name) {
-out.print(name);
-out.print(" = ");
-String value=System.getProperty(name);
+private static void printProperty(PrintStream out,String key) {
+String value= getProperty(key);
 if(value!=null) {
+out.print(key);
+out.print(" = ");
 out.print('"');
 out.print(value);
 out.println('"');
-} else {
-out.println("[undefined]");
 }
-
 }
 
 /**
  * Report proxy information
- *
+ * 
  * @param out stream to print to
+ * @since Ant1.7
  */
 private static void doReportProxy(PrintStream out) {
 printProperty(out,ProxySetup.HTTP_PROXY_HOST);
@@ -607,7 +633,7 @@
 try {
 Class proxyDiagClass = Class.forName(proxyDiagClassname);
 Object instance =proxyDiagClass.newInstance();
-out.println("Java1.5+ proxy settings");
+out.println("Java1.5+ proxy settings:");
 out.println(instance.toString());
 } catch (ClassNotFoundException e) {
 //not included, do nothing



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



svn commit: r468180 - in /ant/core/trunk: docs/manual/CoreTasks/war.html src/main/org/apache/tools/ant/taskdefs/War.java src/tests/antunit/taskdefs/war-test.xml src/tests/antunit/taskdefs/web.xml

2006-10-26 Thread stevel
Author: stevel
Date: Thu Oct 26 16:10:10 2006
New Revision: 468180

URL: http://svn.apache.org/viewvc?view=rev&rev=468180
Log:
web.xml is now optional in Java EE. I've tweaked  to warn but continue if 
it is omitted, and not to say anything if there is a duplicate reference to the 
same web.xml, but to complain a lot if there are two conflicting ones (with 
diagnostics). 

We may want to have an attribute to indicate that a web.xml file is needed, or 
that we dont want to see the warning message. Say nowebxml="fail", "warn" or 
"skip", with the default being fail for backwards compatibility. Thoughts? Now 
is the time to add it...

Added:
ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml
ant/core/trunk/src/tests/antunit/taskdefs/web.xml
Modified:
ant/core/trunk/docs/manual/CoreTasks/war.html
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java

Modified: ant/core/trunk/docs/manual/CoreTasks/war.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/war.html?view=diff&rev=468180&r1=468179&r2=468180
==
--- ant/core/trunk/docs/manual/CoreTasks/war.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/war.html Thu Oct 26 16:10:10 2006
@@ -33,7 +33,20 @@
 (The War task is a shortcut for specifying the particular layout of a WAR 
file.
 The same thing can be accomplished by using the prefix and 
fullpath
 attributes of zipfilesets in a Zip or Jar task.)
-The extended zipfileset element from the zip task (with attributes 
prefix, fullpath, and src) is available in the War 
task.
+The extended zipfileset element from the zip task
+(with attributes prefix, fullpath, and src)
+is available in the War task. The task is also resource-enabled
+and will add nested resources and resource collections to the archive.
+
+
+Before Servlet API 2.5/Java EE 5, a WEB-INF/web.xml file was mandatory in a
+WAR file, so this task failed if the webxml attribute was 
missing.
+As the web.xml file is now optional, the webxml attribute is 
now
+downgraded to being optional. The task will warn if the file is not
+included as an attribute or in a fileset, but still succeed. The task
+will also complain if more than one web.xml file is added to the JAR. 
+
+
 
 Please note that the zip format allows multiple files of the same
 fully-qualified name to exist within a single archive.  This has been
@@ -55,13 +68,13 @@
   
   
 warfile
-Deprecated name of the file to create
+Deprecated name of the file to create
 -use destfile instead.
   
   
 webxml
 The deployment descriptor to use (WEB-INF/web.xml).
-Yes, unless update is set to true
+No (since Ant1.7)
   
   
 basedir
@@ -231,7 +244,7 @@
 directory, and thus it is our fault your webapp doesn't work. The cause
 of these complaints lies in WinZip, which turns an all upper-case
 directory into an all lower case one in a fit of helpfulness. Please check that
-jar xvf yourwebapp.war shows the same behaviour before filing another
+jar xvf yourwebapp.war shows the same behaviour before filing 
another
 report.
 Winzip has an option allowing all uppercase names (which is off by default!).  
It can be enabled by:
 Menu "Options" -> "Configuration",  "View" property/tab page, then "General" 
group box has an option called "Allow all uppercase file names".

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java?view=diff&rev=468180&r1=468179&r2=468180
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/War.java Thu Oct 26 
16:10:10 2006
@@ -20,6 +20,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Locale;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.types.ZipFileSet;
@@ -55,8 +56,10 @@
  * flag set if the descriptor is added
  */
 private boolean descriptorAdded;
+private File addedWebXmlFile;
 
 private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+private static final String XML_DESCRIPTOR_PATH = "web-inf/web.xml";
 
 /** Constructor for the War Task. */
 public War() {
@@ -93,7 +96,7 @@
 // Create a ZipFileSet for this file, and pass it up.
 ZipFileSet fs = new ZipFileSet();
 fs.setFile(deploymentDescriptor);
-fs.setFullpath("WEB-INF/web.xml");
+fs.setFullpath(XML_DESCRIPTOR_PATH);
 super.addFileset(fs);
 }
 
@@ -137,16 +140,18 @@
  */
 protected void initZipOutputStre

svn commit: r465013 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java src/main/org/apache/tools/ant/uti

2006-10-17 Thread stevel
Author: stevel
Date: Tue Oct 17 12:28:20 2006
New Revision: 465013

URL: http://svn.apache.org/viewvc?view=rev&rev=465013
Log:
Having learned about how the java memory model really works, I have had a quick 
code review of the threading here.

1. stuff that is shared read is always marked volatile, to avoid being compiled 
out.

2. added more synchronization when appropriate. 

I make no claims as to thread safety here, as I was never that good at formal 
proofs of correctness.

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java
ant/core/trunk/src/main/org/apache/tools/ant/util/Watchdog.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=465013&r1=465012&r2=465013
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Oct 17 12:28:20 2006
@@ -12,6 +12,10 @@
 
 * Upgraded XML API and parser to Xerces 2.8.1
 
+* A code review of some threaded logic has tightened up the synchronization
+  of Watchdog, ExecuteWatchdog and ExecuteJava, which could reduce the 
occurence
+  of race conditions here, especially on Java1.5+.
+
 Changes from Ant 1.7.0Beta2 to Ant 1.7.0Beta3 
 =
 
@@ -24,6 +28,13 @@
   the java class file. Bugzilla report 33604.
 
 * Defer reference process. Bugzilla 36955, 34458, 37688.
+  This may break build files in which a reference was set in a target which was
+  never executed. Historically, Ant would set the reference early on, during 
parse
+  time, so the datatype would be defined. Now it requires the reference to have
+  been in a bit of the build file which was actually executed. If you get
+  an error about an undefined reference, locate the reference and move it 
somewhere
+  where it is used, or fix the depends attribute of the target in question to
+  depend on the target which defines the reference/datatype.
 
 Fixed bugs:
 ---

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java?view=diff&rev=465013&r1=465012&r2=465013
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java Tue 
Oct 17 12:28:20 2006
@@ -50,8 +50,8 @@
 private Permissions  perm = null;
 private Method main = null;
 private Long timeout = null;
-private Throwable caught = null;
-private boolean timedOut = false;
+private volatile Throwable caught = null;
+private volatile boolean timedOut = false;
 private Thread thread = null;
 
 /**

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java?view=diff&rev=465013&r1=465012&r2=465013
==
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ExecuteWatchdog.java 
Tue Oct 17 12:28:20 2006
@@ -45,13 +45,13 @@
 private Process process;
 
 /** say whether or not the watchdog is currently monitoring a process */
-private boolean watch = false;
+private volatile boolean watch = false;
 
 /** exception that might be thrown during the process execution */
 private Exception caught = null;
 
 /** say whether or not the process was killed due to running overtime */
-private boolean killedProcess = false;
+private volatile boolean killedProcess = false;
 
 /** will tell us whether timeout has occurred */
 private Watchdog watchdog;
@@ -103,15 +103,15 @@
  */
 public synchronized void stop() {
 watchdog.stop();
-watch = false;
-process = null;
+cleanUp();
 }
 
 /**
  * Called after watchdog has finished.
+ * This can be called in the watchdog thread
  * @param w the watchdog
  */
-public void timeoutOccured(Watchdog w) {
+public synchronized void timeoutOccured(Watchdog w) {
 try {
 try {
 // We must check if the process was not stopped
@@ -135,7 +135,7 @@
 /**
  * reset the monitor flag and the process.
  */
-protected void cleanUp() {
+protected synchronized void cleanUp() {
 watch = false;
 process = null;
 }
@@ -148,7 +148,7 @@
  * @throws  BuildException  a wrapped exception over the one that was
  * silently swallowed and stored during th

svn commit: r464518 - /ant/core/trunk/WHATSNEW

2006-10-16 Thread stevel
Author: stevel
Date: Mon Oct 16 08:27:01 2006
New Revision: 464518

URL: http://svn.apache.org/viewvc?view=rev&rev=464518
Log:
Move up to Xerces 2.8.1.

Modified:
ant/core/trunk/WHATSNEW

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=464518&r1=464517&r2=464518
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Oct 16 08:27:01 2006
@@ -10,6 +10,8 @@
 Other changes:
 --
 
+* Upgraded XML API and parser to Xerces 2.8.1
+
 Changes from Ant 1.7.0Beta2 to Ant 1.7.0Beta3 
 =
 



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



svn commit: r464468 - in /ant/core/trunk: fetch.xml lib/libraries.properties lib/xercesImpl.jar lib/xml-apis.jar

2006-10-16 Thread stevel
Author: stevel
Date: Mon Oct 16 05:40:48 2006
New Revision: 464468

URL: http://svn.apache.org/viewvc?view=rev&rev=464468
Log:
Move up to Xerces 2.8.1. I tried using Maven to do it, but the artifacts are 
out of date, inconsistent, and with dirty dependencies.

Modified:
ant/core/trunk/fetch.xml
ant/core/trunk/lib/libraries.properties
ant/core/trunk/lib/xercesImpl.jar
ant/core/trunk/lib/xml-apis.jar

Modified: ant/core/trunk/fetch.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/fetch.xml?view=diff&rev=464468&r1=464467&r2=464468
==
--- ant/core/trunk/fetch.xml (original)
+++ ant/core/trunk/fetch.xml Mon Oct 16 05:40:48 2006
@@ -63,12 +63,10 @@
   
 
   
+
 
-  
-
-
-  
+  
 
 
@@ -92,7 +90,7 @@
   
   
 
-Unknown archive @{archive}
+Unknown archive @{archive} -no property @{archive}.version defined.
   
 
 
@@ -141,6 +139,21 @@
 depends="init">
 
 
+  
+
+  
+
+  
+
+
   
 
   http://svn.apache.org/viewvc/ant/core/trunk/lib/libraries.properties?view=diff&rev=464468&r1=464467&r2=464468
==
--- ant/core/trunk/lib/libraries.properties (original)
+++ ant/core/trunk/lib/libraries.properties Mon Oct 16 05:40:48 2006
@@ -16,6 +16,7 @@
 #when a specific dependency forces them to be out-of-order
 antlr.version=2.7.2
 bcel.version=5.1
+#there is a version 2.4.0, which is what Ant is built against. It is just not 
yet in the repo
 bsf.version=2.3.0
 bsh.version=2.0b4
 bsh-core.version=${bsh.version}
@@ -32,7 +33,11 @@
 oro.version=2.0.8
 regexp.version=1.3
 which.version=1.0
-xerces.version=2.6.2
+xerces.version=2.8.1
+xercesImpl.version=${xerces.version}
+#should be in sync w/ xerces, but not in the maven repository
+#xmlParserAPIs.version=${xerces.version}
+xmlParserAPIs.version=2.6.1
 xalan.version=2.7.0
 xml-resolver.version=1.1
 

Modified: ant/core/trunk/lib/xercesImpl.jar
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/lib/xercesImpl.jar?view=diff&rev=464468&r1=464467&r2=464468
==
Binary files - no diff available.

Modified: ant/core/trunk/lib/xml-apis.jar
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/lib/xml-apis.jar?view=diff&rev=464468&r1=464467&r2=464468
==
Binary files - no diff available.



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



svn commit: r463473 - in /ant/core/trunk/docs/manual/CoreTasks: get.html sql.html

2006-10-12 Thread stevel
Author: stevel
Date: Thu Oct 12 15:29:38 2006
New Revision: 463473

URL: http://svn.apache.org/viewvc?view=rev&rev=463473
Log:
mention proxy settings here.

Modified:
ant/core/trunk/docs/manual/CoreTasks/get.html
ant/core/trunk/docs/manual/CoreTasks/sql.html

Modified: ant/core/trunk/docs/manual/CoreTasks/get.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/get.html?view=diff&rev=463473&r1=463472&r2=463473
==
--- ant/core/trunk/docs/manual/CoreTasks/get.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/get.html Thu Oct 12 15:29:38 2006
@@ -40,12 +40,16 @@
 NB: This timestamp facility only works on downloads using the HTTP protocol. 
 
 A username and password can be specified, in which case basic 'slightly encoded
-plain text' authentication is used. This is only a secure authentication
-mechanism over an HTTPS link.
+plain text' authentication is used. This is only secure over an HTTPS link.
+
 
-If you need to go through a firewall, use
-<setproxy>
-to set up the proxy first. 
+Proxies. Since Ant1.7, Ant running on Java1.5 or later defaults to 
+using
+the proxy settings of the operating system. There is also the  
+ <setproxy> task for
+earlier Java versions. With proxies turned on, <get> 
requests against
+localhost may not work as expected, if the request is relayed to the proxy.
+The -noproxy option can be used to turn this feature off.
 
  
 Parameters

Modified: ant/core/trunk/docs/manual/CoreTasks/sql.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/sql.html?view=diff&rev=463473&r1=463472&r2=463473
==
--- ant/core/trunk/docs/manual/CoreTasks/sql.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/sql.html Thu Oct 12 15:29:38 2006
@@ -43,6 +43,16 @@
 stop execution and commit transaction;
 and abort execution and transaction and fail task.
 
+
+Proxies. Some JDBC drivers (including the Oracle thin driver), 
+use the JVM's proxy settings to route their JDBC operations to the 
database.
+Since Ant1.7, Ant running on Java1.5 or later defaults to 
+using
+the proxy settings of the operating system. 
+Accordingly, the OS proxy settings need to be valid, or Ant's proxy
+support disabled with -noproxy option.
+
+
 Parameters
 
 



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



svn commit: r453274 - in /ant/core/trunk/src/main/org/apache/tools/ant/util: WeakishReference.java optional/WeakishReference12.java

2006-10-05 Thread stevel
Author: stevel
Date: Thu Oct  5 08:48:31 2006
New Revision: 453274

URL: http://svn.apache.org/viewvc?view=rev&rev=453274
Log:
refactoring of WeakishReference, as discussed.

Modified:
ant/core/trunk/src/main/org/apache/tools/ant/util/WeakishReference.java

ant/core/trunk/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/util/WeakishReference.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/WeakishReference.java?view=diff&rev=453274&r1=453273&r2=453274
==
--- ant/core/trunk/src/main/org/apache/tools/ant/util/WeakishReference.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/WeakishReference.java Thu 
Oct  5 08:48:31 2006
@@ -18,24 +18,34 @@
 
 package org.apache.tools.ant.util;
 
-import org.apache.tools.ant.util.optional.WeakishReference12;
+
+import java.lang.ref.WeakReference;
 
 /**
- * This is a weak reference on java1.2 and up, that is all
- * platforms Ant1.6 supports.
+ * These classes are part of some code to reduce memory leaks by only 
retaining weak references to things
+ * on Java1.2+, and yet still work (with leaky hard references) on Java1.1. 
Now that Ant is 1.2+ only,
+ * life is simpler and none of the classes are needed any more.
+ *
+ * They are only retained in case a third-party task uses them
  * @since ant1.6
- * @deprecated since 1.7.
+ * @see org.apache.tools.ant.util.optional.WeakishReference12
+ * @deprecated deprecated 1.7; will be removed in Ant1.8
  * Just use [EMAIL PROTECTED] java.lang.ref.WeakReference} 
directly.
  */
-public abstract class WeakishReference  {
+public class WeakishReference  {
+
+
+private WeakReference weakref;
 
 /**
- * create the appropriate type of reference for the java version
- * @param object the object that the reference will refer to.
- * @return reference to the Object.
+ * create a new soft reference, which is bound to a
+ * Weak reference inside
+ *
+ * @param reference
+ * @see java.lang.ref.WeakReference
  */
-public static WeakishReference createReference(Object object) {
-return new WeakishReference12(object);
+WeakishReference(Object reference) {
+this.weakref = new WeakReference(reference);
 }
 
 /**
@@ -45,31 +55,35 @@
  * @return The object to which this reference refers, or
  * null if this reference object has been cleared.
  */
-public abstract Object get();
+public Object get() {
+return weakref.get();
+}
 
 /**
- * A hard reference for Java 1.1.
+ * create the appropriate type of reference for the java version
+ * @param object the object that the reference will refer to.
+ * @return reference to the Object.
+ */
+public static WeakishReference createReference(Object object) {
+return new WeakishReference(object);
+}
+
+
+/**
+ * This was a hard reference for Java 1.1. Since Ant1.7,
  * @deprecated since 1.7. 
  * Hopefully nobody is using this.
  */
 public static class HardReference extends WeakishReference {
-private Object object;
 
 /**
  * constructor.
  * @param object the object that the reference will refer to.
  */
 public HardReference(Object object) {
-this.object = object;
+super(object);
 }
 
-/**
- * Returns this reference object's referent.
- * @return the object to which this reference refers.
- */
-public Object get() {
-return object;
-}
 }
 
 }

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java?view=diff&rev=453274&r1=453273&r2=453274
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java
 Thu Oct  5 08:48:31 2006
@@ -27,10 +27,13 @@
  * appropriate java.lang.ref class.
  * @deprecated since 1.7.
  * Just use [EMAIL PROTECTED] WeakReference} directly.
+ * Note that in ant1.7 is parent was changed to extend HardReference.
+ * This is because the latter has access to the (package scoped)
+ * WeakishReference(Object) constructor, and both that and this are thin
+ * facades on the underlying no-longer-abstract base class. 
  */
-public class WeakishReference12 extends WeakishReference  {
+public class WeakishReference12 extends WeakishReference.HardReference  {
 
-private WeakReference weakref;
 
 /**
  * create a new so

svn commit: r453156 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java

2006-10-05 Thread stevel
Author: stevel
Date: Thu Oct  5 02:24:11 2006
New Revision: 453156

URL: http://svn.apache.org/viewvc?view=rev&rev=453156
Log:
close using FileUtils.close

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java?view=diff&rev=453156&r1=453155&r2=453156
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java
 Thu Oct  5 02:24:11 2006
@@ -37,6 +37,7 @@
 import java.util.Vector;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
+import org.apache.tools.ant.util.FileUtils;
 import org.apache.tools.ant.types.EnumeratedAttribute;
 
 /**
@@ -213,13 +214,7 @@
 } catch (IOException ioe) {
 throw new BuildException(ioe, getLocation());
 } finally {
-if (bos != null) {
-try {
-bos.close();
-} catch (IOException ioex) {
-// ignore
-}
-}
+FileUtils.close(bos);
 }
 }
 



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



svn commit: r452919 - /ant/core/trunk/build.bat

2006-10-04 Thread stevel
Author: stevel
Date: Wed Oct  4 08:48:58 2006
New Revision: 452919

URL: http://svn.apache.org/viewvc?view=rev&rev=452919
Log:
patch build.bat to set the NT error code if bootstrapping failed, to be 
consistent with the build.sh script.

Modified:
ant/core/trunk/build.bat

Modified: ant/core/trunk/build.bat
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/build.bat?view=diff&rev=452919&r1=452918&r2=452919
==
--- ant/core/trunk/build.bat (original)
+++ ant/core/trunk/build.bat Wed Oct  4 08:48:58 2006
@@ -21,6 +21,8 @@
 call bootstrap.bat
 if exist bootstrap\lib\ant.jar if exist bootstrap\bin\ant.bat if exist 
bootstrap\bin\lcp.bat if exist bootstrap\bin\antRun.bat goto runAnt
 echo Bootstrap FAILED
+REM set the error code
+color 00
 goto cleanup
 
 :runAnt



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



svn commit: r452917 - /ant/core/trunk/build.sh

2006-10-04 Thread stevel
Author: stevel
Date: Wed Oct  4 08:45:50 2006
New Revision: 452917

URL: http://svn.apache.org/viewvc?view=rev&rev=452917
Log:
patch build.sh to exit with an error code if bootstrapping fails, for the 
Gentoo team.

Modified:
ant/core/trunk/build.sh

Modified: ant/core/trunk/build.sh
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/build.sh?view=diff&rev=452917&r1=452916&r2=452917
==
--- ant/core/trunk/build.sh (original)
+++ ant/core/trunk/build.sh Wed Oct  4 08:45:50 2006
@@ -41,7 +41,7 @@
 
 if test ! -f bootstrap/lib/ant.jar -o  ! -x bootstrap/bin/ant -o ! -x 
bootstrap/bin/antRun ; then
   echo Bootstrap FAILED
-  exit
+  exit 1
 fi
 
 if [ "$REALANTHOME" != "" ] ; then



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



svn commit: r448886 - /ant/core/trunk/fetch.xml

2006-09-22 Thread stevel
Author: stevel
Date: Fri Sep 22 03:14:27 2006
New Revision: 448886

URL: http://svn.apache.org/viewvc?view=rev&rev=448886
Log:
when you ask for everything, you get everything, scripting included.

Modified:
ant/core/trunk/fetch.xml

Modified: ant/core/trunk/fetch.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/fetch.xml?view=diff&rev=448886&r1=448885&r2=448886
==
--- ant/core/trunk/fetch.xml (original)
+++ ant/core/trunk/fetch.xml Fri Sep 22 03:14:27 2006
@@ -212,6 +212,6 @@
 
   
+
depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script"
 />
 
 



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



svn commit: r447852 - /ant/antlibs/common/trunk/build.xml

2006-09-19 Thread stevel
Author: stevel
Date: Tue Sep 19 07:11:02 2006
New Revision: 447852

URL: http://svn.apache.org/viewvc?view=rev&rev=447852
Log:
only search in the expected location for the JAR, otherwise forking junit tasks 
fail with a bad classpath.

Modified:
ant/antlibs/common/trunk/build.xml

Modified: ant/antlibs/common/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/antlibs/common/trunk/build.xml?view=diff&rev=447852&r1=447851&r2=447852
==
--- ant/antlibs/common/trunk/build.xml (original)
+++ ant/antlibs/common/trunk/build.xml Tue Sep 19 07:11:02 2006
@@ -119,6 +119,7 @@
 unless="skip-junit">
 
 
 Expected to find ant-testutil.jar



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



svn commit: r441510 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java

2006-09-08 Thread stevel
Author: stevel
Date: Fri Sep  8 07:22:58 2006
New Revision: 441510

URL: http://svn.apache.org/viewvc?view=rev&rev=441510
Log:
use a buffered file in reporting. Added a note to tell people not to switch to 
ClasspathUtils because the forking junit tests promptly fail.

Modified:

ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java?view=diff&rev=441510&r1=441509&r2=441510
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java
 Fri Sep  8 07:22:58 2006
@@ -21,6 +21,8 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.OutputStream;
+import java.io.BufferedOutputStream;
+
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.types.EnumeratedAttribute;
@@ -202,7 +204,9 @@
 if (classname == null) {
 throw new BuildException("you must specify type or classname");
 }
-
+//although this code appears to duplicate that of 
ClasspathUtils.newInstance,
+//we cannot use that because this formatter may run in a forked 
process,
+//without that class.
 Class f = null;
 try {
 if (loader == null) {
@@ -230,12 +234,11 @@
 + " is not a JUnitResultFormatter");
 }
 JUnitTaskMirror.JUnitResultFormatterMirror r = 
(JUnitTaskMirror.JUnitResultFormatterMirror) o;
-
 if (useFile && outFile != null) {
 try {
-out = new FileOutputStream(outFile);
+out = new BufferedOutputStream(new FileOutputStream(outFile));
 } catch (java.io.IOException e) {
-throw new BuildException(e);
+throw new BuildException("Unable to open file " + outFile, e);
 }
 }
 r.setOutput(out);



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



svn commit: r441117 - /ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java

2006-09-07 Thread stevel
Author: stevel
Date: Thu Sep  7 08:27:45 2006
New Revision: 441117

URL: http://svn.apache.org/viewvc?view=rev&rev=441117
Log:
move other java1.5+ check down to the other java1.5 proxy tests.

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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java?view=diff&rev=441117&r1=441116&r2=441117
==
--- ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Diagnostics.java Thu Sep  7 
08:27:45 2006
@@ -582,9 +582,6 @@
  * @param out stream to print to
  */
 private static void doReportProxy(PrintStream out) {
-if(JavaEnvUtils.getJavaVersionNumber()>=15) {
-printProperty(out, ProxySetup.USE_SYSTEM_PROXIES);
-}
 printProperty(out,ProxySetup.HTTP_PROXY_HOST);
 printProperty(out, ProxySetup.HTTP_PROXY_PORT);
 printProperty(out, ProxySetup.HTTP_PROXY_USERNAME);
@@ -604,6 +601,7 @@
 if (JavaEnvUtils.getJavaVersionNumber() < 15) {
 return;
 }
+printProperty(out, ProxySetup.USE_SYSTEM_PROXIES);
 final String proxyDiagClassname
 = "org.apache.tools.ant.util.java15.ProxyDiagnostics";
 try {



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



svn commit: r434056 - in /ant/core/trunk: fetch.xml lib/libraries.properties

2006-08-23 Thread stevel
Author: stevel
Date: Wed Aug 23 07:52:58 2006
New Revision: 434056

URL: http://svn.apache.org/viewvc?rev=434056&view=rev
Log:
update jsch version.

I'd move to xerces 2.8.0 if there was a consistent release of the api and impl 
artifacts, as it is 2.6.2 is the one to use.

Modified:
ant/core/trunk/fetch.xml
ant/core/trunk/lib/libraries.properties

Modified: ant/core/trunk/fetch.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/fetch.xml?rev=434056&r1=434055&r2=434056&view=diff
==
--- ant/core/trunk/fetch.xml (original)
+++ ant/core/trunk/fetch.xml Wed Aug 23 07:52:58 2006
@@ -135,7 +135,7 @@
 description="load networking libraries (commons-net; jsch)"
 depends="init">
 
-
+
   
 
   http://svn.apache.org/viewvc/ant/core/trunk/lib/libraries.properties?rev=434056&r1=434055&r2=434056&view=diff
==
--- ant/core/trunk/lib/libraries.properties (original)
+++ ant/core/trunk/lib/libraries.properties Wed Aug 23 07:52:58 2006
@@ -25,7 +25,7 @@
 jdepend.version=2.7
 jruby.version=0.8.3
 junit.version=3.8.2
-jsch.version=0.1.25
+jsch.version=0.1.27
 jython.version=2.1
 log4j.version=1.2.13
 #rhino.version=1.5.4R1



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



  1   2   3   4   5   6   >