svn commit: r581076 - /ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java
Author: jglick Date: Mon Oct 1 14:35:46 2007 New Revision: 581076 URL: http://svn.apache.org/viewvc?rev=581076&view=rev Log: #43398: always print stack trace for non-BuildException's. Modified: ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java?rev=581076&r1=581075&r2=581076&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/DefaultLogger.java Mon Oct 1 14:35:46 2007 @@ -149,6 +149,15 @@ message.append(getBuildFailedMessage()); message.append(StringUtils.LINE_SEP); +while (error instanceof BuildException) { // #43398 +Throwable cause = ((BuildException) error).getCause(); +if (cause != null && cause.toString().equals(error.getMessage())) { +error = cause; +} else { +break; +} +} + if (Project.MSG_VERBOSE <= msgOutputLevel || !(error instanceof BuildException)) { message.append(StringUtils.getStackTrace(error)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581086 - /ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java
Author: jglick Date: Mon Oct 1 14:49:24 2007 New Revision: 581086 URL: http://svn.apache.org/viewvc?rev=581086&view=rev Log: merge rev 559393: test compilability Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java Modified: ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java?rev=581086&r1=581085&r2=581086&view=diff == --- ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java (original) +++ ant/core/branches/ANT_17_BRANCH/src/tests/junit/org/apache/tools/ant/taskdefs/JarTest.java Mon Oct 1 14:49:24 2007 @@ -274,30 +274,30 @@ public void testNoVersionInfoIgnore() { executeTarget("testNoVersionInfoIgnore"); -assertTrue( getFullLog().contains("No Implementation-Title set.") ); -assertTrue( getFullLog().contains("No Implementation-Version set.") ); -assertTrue( getFullLog().contains("No Implementation-Vendor set.") ); +assertTrue( getFullLog().indexOf("No Implementation-Title set.") > -1 ); +assertTrue( getFullLog().indexOf("No Implementation-Version set.") > -1 ); +assertTrue( getFullLog().indexOf("No Implementation-Vendor set.") > -1 ); } public void testNoVersionInfoWarn() { executeTarget("testNoVersionInfoWarn"); -assertTrue( getLog().contains("No Implementation-Title set.") ); -assertTrue( getLog().contains("No Implementation-Version set.") ); -assertTrue( getLog().contains("No Implementation-Vendor set.") ); +assertTrue( getLog().indexOf("No Implementation-Title set.") > -1 ); +assertTrue( getLog().indexOf("No Implementation-Version set.") > -1 ); +assertTrue( getLog().indexOf("No Implementation-Vendor set.") > -1 ); } public void testNoVersionInfoNoStrict() { executeTarget("testNoVersionInfoNoStrict"); -assertFalse( getLog().contains("No Implementation-Title set.") ); -assertFalse( getLog().contains("No Implementation-Version set.") ); -assertFalse( getLog().contains("No Implementation-Vendor set.") ); +assertFalse( getLog().indexOf("No Implementation-Title set.") > -1 ); +assertFalse( getLog().indexOf("No Implementation-Version set.") > -1 ); +assertFalse( getLog().indexOf("No Implementation-Vendor set.") > -1 ); } public void testHasVersionInfo() { executeTarget("testHasVersionInfo"); -assertFalse( getLog().contains("No Implementation-Title set.") ); -assertFalse( getLog().contains("No Implementation-Version set.") ); -assertFalse( getLog().contains("No Implementation-Vendor set.") ); +assertFalse( getLog().indexOf("No Implementation-Title set.") > -1 ); +assertFalse( getLog().indexOf("No Implementation-Version set.") > -1 ); +assertFalse( getLog().indexOf("No Implementation-Vendor set.") > -1 ); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581091 - /ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DefaultLogger.java
Author: jglick Date: Mon Oct 1 15:01:42 2007 New Revision: 581091 URL: http://svn.apache.org/viewvc?rev=581091&view=rev Log: #43398: print full stack trace (merge of rev 581076 from trunk) Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DefaultLogger.java Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DefaultLogger.java URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DefaultLogger.java?rev=581091&r1=581090&r2=581091&view=diff == --- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DefaultLogger.java (original) +++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DefaultLogger.java Mon Oct 1 15:01:42 2007 @@ -149,6 +149,15 @@ message.append(getBuildFailedMessage()); message.append(StringUtils.LINE_SEP); +while (error instanceof BuildException) { // #43398 +Throwable cause = ((BuildException) error).getCause(); +if (cause != null && cause.toString().equals(error.getMessage())) { +error = cause; +} else { +break; +} +} + if (Project.MSG_VERBOSE <= msgOutputLevel || !(error instanceof BuildException)) { message.append(StringUtils.getStackTrace(error)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581206 - /ant/core/trunk/WHATSNEW
Author: jglick Date: Tue Oct 2 05:27:20 2007 New Revision: 581206 URL: http://svn.apache.org/viewvc?rev=581206&view=rev Log: noting #43398 Modified: ant/core/trunk/WHATSNEW Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=581206&r1=581205&r2=581206&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Tue Oct 2 05:27:20 2007 @@ -84,6 +84,11 @@ Fixed bugs: --- + +* The default logger was failing to print complete stack traces for exceptions + other than BuildException, thus omitting often important diagnostic + information. Bugzilla 43398. + * Error in FTP task Bugzilla report 41724 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581208 - /ant/core/branches/ANT_17_BRANCH/WHATSNEW
Author: jglick Date: Tue Oct 2 05:28:38 2007 New Revision: 581208 URL: http://svn.apache.org/viewvc?rev=581208&view=rev Log: noting #43398 Modified: ant/core/branches/ANT_17_BRANCH/WHATSNEW Modified: ant/core/branches/ANT_17_BRANCH/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/WHATSNEW?rev=581208&r1=581207&r2=581208&view=diff == --- ant/core/branches/ANT_17_BRANCH/WHATSNEW (original) +++ ant/core/branches/ANT_17_BRANCH/WHATSNEW Tue Oct 2 05:28:38 2007 @@ -24,6 +24,11 @@ Fixed bugs: --- + +* The default logger was failing to print complete stack traces for exceptions + other than BuildException, thus omitting often important diagnostic + information. Bugzilla 43398. + * Error in FTP task Bugzilla report 41724 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581377 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/scm/
Author: jglick Date: Tue Oct 2 13:47:50 2007 New Revision: 581377 URL: http://svn.apache.org/viewvc?rev=581377&view=rev Log: Removing empty package. Removed: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/scm/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581394 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java
Author: jglick Date: Tue Oct 2 14:38:20 2007 New Revision: 581394 URL: http://svn.apache.org/viewvc?rev=581394&view=rev Log: Silly little optimization: was taking time quadratic in fileset size. Unfortunately this is not the only place in Ant where List.contains is called; DirectoryScanner.processIncluded seems to be as bad. Alas, someone long ago made protected Vector fields in DS, and it seems too late to change them now: even changing to ArrayList would break subclasses like FTP which call addElement! Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java?rev=581394&r1=581393&r2=581394&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/Union.java Tue Oct 2 14:38:20 2007 @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; +import java.util.Set; import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.types.ResourceCollection; @@ -100,14 +102,16 @@ return Collections.EMPTY_LIST; } //preserve order-encountered using a list; enforce set logic manually: +// (LinkedHashSet better, but JDK 1.4+) ArrayList union = new ArrayList(rc.size() * 2); +Set _union = new HashSet(rc.size() * 2); for (Iterator rcIter = rc.iterator(); rcIter.hasNext();) { for (Iterator r = nextRC(rcIter).iterator(); r.hasNext();) { Object o = r.next(); if (asString) { o = o.toString(); } -if (!(union.contains(o))) { +if (_union.add(o)) { union.add(o); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581395 - /ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/resources/Union.java
Author: jglick Date: Tue Oct 2 14:39:20 2007 New Revision: 581395 URL: http://svn.apache.org/viewvc?rev=581395&view=rev Log: optimization; merge of 581394 from trunk Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/resources/Union.java Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/resources/Union.java URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/resources/Union.java?rev=581395&r1=581394&r2=581395&view=diff == --- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/resources/Union.java (original) +++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/resources/Union.java Tue Oct 2 14:39:20 2007 @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; +import java.util.Set; import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.types.ResourceCollection; @@ -100,14 +102,16 @@ return Collections.EMPTY_LIST; } //preserve order-encountered using a list; enforce set logic manually: +// (LinkedHashSet better, but JDK 1.4+) ArrayList union = new ArrayList(rc.size() * 2); +Set _union = new HashSet(rc.size() * 2); for (Iterator rcIter = rc.iterator(); rcIter.hasNext();) { for (Iterator r = nextRC(rcIter).iterator(); r.hasNext();) { Object o = r.next(); if (asString) { o = o.toString(); } -if (!(union.contains(o))) { +if (_union.add(o)) { union.add(o); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r581748 - in /ant/core/trunk: ./ src/main/org/apache/tools/ant/ src/main/org/apache/tools/ant/taskdefs/ src/main/org/apache/tools/ant/taskdefs/optional/depend/ src/main/org/apache/tools/an
Author: jglick Date: Wed Oct 3 16:44:10 2007 New Revision: 581748 URL: http://svn.apache.org/viewvc?rev=581748&view=rev Log: Various microoptimizations to reduce I/O load of common tasks, esp. no-op and . Many inner loops altered to make just 1-2 system calls rather than 4-5. You can easily see how wasteful the previous code was, and find the culprits, by patching r/o java.io.File methods and adding to -Xbootclasspath/p (or use AspectJ). E.g.: public boolean isDirectory() { System.err.println("isDirectory: " + this); if (Math.random() < .01) Thread.dumpStack(); // as before... } Ant still makes an order of magnitude more system calls to do what seem like simple operations than you would think necessary, but this patch should at least improve the situation. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Rmic.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java ant/core/trunk/src/main/org/apache/tools/ant/util/ResourceUtils.java ant/core/trunk/src/main/org/apache/tools/ant/util/SourceFileScanner.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=581748&r1=581747&r2=581748&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Wed Oct 3 16:44:10 2007 @@ -196,6 +196,10 @@ Other changes: -- + +* Various small optimizations speed up common tasks such as on large + filesets, reducing both I/O and CPU usage. + * Profiling logger has been added with basic profiling capabilities. *
svn commit: r581753 - in /ant/core/branches/ANT_17_BRANCH: ./ src/main/org/apache/tools/ant/ src/main/org/apache/tools/ant/taskdefs/ src/main/org/apache/tools/ant/taskdefs/optional/depend/ src/main/or
Author: jglick Date: Wed Oct 3 16:58:14 2007 New Revision: 581753 URL: http://svn.apache.org/viewvc?rev=581753&view=rev Log: optimizations; merge of rev 581748 from trunk Modified: ant/core/branches/ANT_17_BRANCH/WHATSNEW ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/DirectoryScanner.java ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/Rmic.java ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/depend/Depend.java ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/ResourceUtils.java ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/SourceFileScanner.java Modified: ant/core/branches/ANT_17_BRANCH/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/WHATSNEW?rev=581753&r1=581752&r2=581753&view=diff == --- ant/core/branches/ANT_17_BRANCH/WHATSNEW (original) +++ ant/core/branches/ANT_17_BRANCH/WHATSNEW Wed Oct 3 16:58:14 2007 @@ -130,6 +130,12 @@ Other changes: -- + +* Various small optimizations speed up common tasks such as on large + filesets, reducing both I/O and CPU usage. + +* Profiling logger has been added with basic profiling capabilities. + *
svn commit: r582364 - /ant/core/trunk/src/main/org/apache/tools/ant/types/Resource.java
Author: jglick Date: Fri Oct 5 10:53:03 2007 New Revision: 582364 URL: http://svn.apache.org/viewvc?rev=582364&view=rev Log: Javadoc clarification for Resource.getLastModified. 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?rev=582364&r1=582363&r2=582364&view=diff == --- 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 Oct 5 10:53:03 2007 @@ -172,10 +172,11 @@ } /** - * Tells the modification time in milliseconds since 01.01.1970 . + * Tells the modification time in milliseconds since 01.01.1970 (the "epoch"). * - * @return 0 if the resource does not exist to mirror the behavior - * of [EMAIL PROTECTED] java.io.File File}. + * @return the modification time, if that is meaningful (e.g. for a file resource which exists); + * 0 if the resource does not exist, to mirror the behavior of [EMAIL PROTECTED] java.io.File#lastModified}; + * or 0 if the notion of modification time is meaningless for this class of resource (e.g. an inline string) */ public long getLastModified() { if (isReference()) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r470108 - /ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java
Author: jglick Date: Wed Nov 1 13:33:01 2006 New Revision: 470108 URL: http://svn.apache.org/viewvc?view=rev&rev=470108 Log: #40019 revision: ${user.variant} need not be set. Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java?view=diff&rev=470108&r1=470107&r2=470108 == --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java Wed Nov 1 13:33:01 2006 @@ -174,7 +174,6 @@ public void testWithRegex() throws Exception { executeTarget("testWithRegex"); assertDebuglogContaining("ant.home="); -assertDebuglogContaining("user.variant="); } private void testEchoPrefixVarious(String target) throws Exception { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r470124 - /ant/core/trunk/build.xml
Author: jglick Date: Wed Nov 1 14:34:00 2006 New Revision: 470124 URL: http://svn.apache.org/viewvc?view=rev&rev=470124 Log: Permit VM args to be inserted when running JUnit tests, for JPDA debugger integration. 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=470124&r1=470123&r2=470124 == --- ant/core/trunk/build.xml (original) +++ ant/core/trunk/build.xml Wed Nov 1 14:34:00 2006 @@ -1628,6 +1628,7 @@ + + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r470125 - in /ant/core/trunk/src: main/org/apache/tools/ant/types/Path.java tests/junit/org/apache/tools/ant/types/PathTest.java
Author: jglick Date: Wed Nov 1 14:35:09 2006 New Revision: 470125 URL: http://svn.apache.org/viewvc?view=rev&rev=470125 Log: If someone tries to append a path to itself, choke gracefully, not with a StackOverflowError. Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java?view=diff&rev=470125&r1=470124&r2=470125 == --- ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/Path.java Wed Nov 1 14:35:09 2006 @@ -19,7 +19,6 @@ package org.apache.tools.ant.types; import java.io.File; -import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.Locale; @@ -238,6 +237,9 @@ * @since Ant 1.6 */ public void add(Path path) throws BuildException { +if (path == this) { +throw circularReference(); +} if (path.getProject() == null) { path.setProject(getProject()); } Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java?view=diff&rev=470125&r1=470124&r2=470125 == --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/types/PathTest.java Wed Nov 1 14:35:09 2006 @@ -549,4 +549,15 @@ assertEquals(project.resolveFile("build").getAbsolutePath(), l[0]); } +public void testRecursion() { +Path p = new Path(project); +try { +p.append(p); +assertEquals(0, p.list().length); +} catch (BuildException x) { +String m = x.toString(); +assertTrue(m, m.indexOf("circular") != -1); +} +} + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r470902 - /ant/core/trunk/WHATSNEW
Author: jglick Date: Fri Nov 3 08:55:42 2006 New Revision: 470902 URL: http://svn.apache.org/viewvc?view=rev&rev=470902 Log: Typo in old changelog entry. Modified: ant/core/trunk/WHATSNEW Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=470902&r1=470901&r2=470902 == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Fri Nov 3 08:55:42 2006 @@ -3509,7 +3509,7 @@ Fixed bugs: --- -* doesn't use deprectated methods anymore. +* no longer uses deprecated methods. * javadoc's failonerror attribute works again - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r481322 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/IntrospectionHelper.java src/main/org/apache/tools/ant/taskdefs/AntStructure.java
Author: jglick Date: Fri Dec 1 09:50:46 2006 New Revision: 481322 URL: http://svn.apache.org/viewvc?view=rev&rev=481322 Log: #41058: permit Java 5 enumerations to work like EnumeratedAttribute. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AntStructure.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=481322&r1=481321&r2=481322 == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Fri Dec 1 09:50:46 2006 @@ -51,6 +51,9 @@ * Do not uppercase the drive letters systematically in FileUtils#normalize. +* Java 5 enumerations may now be used as values in XML attributes in place of + EnumeratedAttribute. Bugzilla 41058. + Changes from Ant 1.7.0Beta3 to Ant 1.7.0RC1 === 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=481322&r1=481321&r2=481322 == --- ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java Fri Dec 1 09:50:46 2006 @@ -1008,6 +1008,25 @@ } } }; +} else if (reflectedArg.getSuperclass() != null && reflectedArg.getSuperclass().getName().equals("java.lang.Enum")) { +return new AttributeSetter(m) { +public void set(Project p, Object parent, String value) +throws InvocationTargetException, IllegalAccessException, BuildException { +try { +m.invoke(parent, new Object[] { +reflectedArg.getMethod("valueOf", new Class[] {String.class}). +invoke(null, new Object[] {value})}); +} catch (InvocationTargetException x) { +if (x.getTargetException() instanceof IllegalArgumentException) { +throw new BuildException("'" + value + "' is not a permitted value for " + reflectedArg.getName()); +} else { +throw new BuildException(x.getTargetException()); +} +} catch (Exception x) { +throw new BuildException(x); +} +} +}; // worst case. look for a public String constructor and use it // also supports new Whatever(Project, String) as for Path or Reference // This is used (deliberately) for all primitives/wrappers other than Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AntStructure.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AntStructure.java?view=diff&rev=481322&r1=481321&r2=481322 == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AntStructure.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AntStructure.java Fri Dec 1 09:50:46 2006 @@ -370,6 +370,24 @@ } catch (IllegalAccessException ie) { sb.append("CDATA "); } +} else if (type.getSuperclass() != null && type.getSuperclass().getName().equals("java.lang.Enum")) { +try { +Object[] values = (Object[]) type.getMethod("values", null).invoke(null, null); +if (values.length == 0) { +sb.append("CDATA "); +} else { +sb.append('('); +for (int i = 0; i < values.length; i++) { +if (i != 0) { +sb.append(" | "); +} +sb.append(type.getMethod("name", null).invoke(values[i], null)); +} +sb.append(") "); +} +} catch (Exception x) { +sb.append("CDATA "); +} } else { sb.append("CDATA "); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r481329 - /ant/core/trunk/docs/manual/develop.html
Author: jglick Date: Fri Dec 1 10:10:20 2006 New Revision: 481329 URL: http://svn.apache.org/viewvc?view=rev&rev=481329 Log: Forgot to document #41058! Modified: ant/core/trunk/docs/manual/develop.html Modified: ant/core/trunk/docs/manual/develop.html URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/develop.html?view=diff&rev=481329&r1=481328&r2=481329 == --- ant/core/trunk/docs/manual/develop.html (original) +++ ant/core/trunk/docs/manual/develop.html Fri Dec 1 10:10:20 2006 @@ -171,6 +171,15 @@ inner AddAsisRemove class used in setCr for an example. + A (Java 5) enumeration. Ant will call the setter with the enum constant + matching the value given in the build file. This is easier than using + EnumeratedAttribute and can result in cleaner code, but of course + your task will not run on JDK 1.4 or earlier. Note that any override of + toString() in the enumeration is ignored; the build file must use + the declared name (see Enum.getName()). You may wish to use lowercase + enum constant names, in contrast to usual Java style, to look better in build files. + As of Ant 1.7.0. + What happens if more than one setter method is present for a given - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r481618 - /ant/core/trunk/docs/manual/CoreTasks/makeurl.html
Author: jglick Date: Sat Dec 2 12:21:43 2006 New Revision: 481618 URL: http://svn.apache.org/viewvc?view=rev&rev=481618 Log: Docs improvements. Modified: ant/core/trunk/docs/manual/CoreTasks/makeurl.html Modified: ant/core/trunk/docs/manual/CoreTasks/makeurl.html URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/makeurl.html?view=diff&rev=481618&r1=481617&r2=481618 == --- ant/core/trunk/docs/manual/CoreTasks/makeurl.html (original) +++ ant/core/trunk/docs/manual/CoreTasks/makeurl.html Sat Dec 2 12:21:43 2006 @@ -34,7 +34,6 @@ Makeurl Task -This task takes one or more filenames and turns them into URLs, which it then assigns to a property. @@ -62,7 +61,19 @@ -This task takes one or more filenames and turns them into URLs, which it then assigns to a property. Useful when setting up RMI codebases. Nested filesets are supported; if present, these are turned into the url with the given separator between them (default = " "). Example <makeurl file="${user.home}/.m2/repository" property="m2.repository.url" /> Sets the property m2.repository.url to the file: URL of the local Maven2 repository. <makeurl property="codebase"> <fileset dir="lib includes="*.jar"/> </makeurl> Set the property codebase to the three URLs of the files provided as nested elements. +This task takes one or more filenames and turns them into URLs, which it then assigns to a property. +Useful when setting up RMI or JNLP codebases, for example. +Nested filesets are supported; if present, these are turned into the URLs with the supplied separator between them (default: space). + +Examples: + +<makeurl file="${user.home}/.m2/repository" property="m2.repository.url"/> + +Sets the property m2.repository.url to the file: URL of the local Maven2 repository. + +<makeurl property="codebase"><fileset dir="lib includes="*.jar"/></makeurl> + +Set the property codebase to the three URLs of the files provided as nested elements. @@ -105,13 +116,13 @@ file - the name of a file to be converted into a URL + name of a file to be converted into a URL File - - Optional + + optional, if a nested fileset or path is supplied @@ -120,11 +131,14 @@ property - set the name of a property to fill with the URL + name of a property to set to the URL String + + required + @@ -132,11 +146,14 @@ separator - set the separator for the multi-url option. + separator for the multi-URL option String + + optional + @@ -144,11 +161,14 @@ validate - set this flag to trigger validation that every named file exists. Optional: default=true + validate that every named file exists boolean + + optional; default: true + @@ -177,7 +197,7 @@ fileset (org.apache.tools.ant.types.FileSet) -a fileset of jar files to include in the URL, each separated by the separator +A fileset of JAR files to include in the URL list, each separated by the separator. @@ -192,7 +212,7 @@ path (org.apache.tools.ant.types.Path) -add a path to the URL. All elements in the path will be converted to individual URL entries +Add a path to the URL. All elements in the path will be converted to individual URL entries. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r481878 - /ant/core/trunk/xdocs/external.xml
Author: jglick Date: Sun Dec 3 12:34:44 2006 New Revision: 481878 URL: http://svn.apache.org/viewvc?view=rev&rev=481878 Log: #41098: Virtual Ant. Modified: ant/core/trunk/xdocs/external.xml Modified: ant/core/trunk/xdocs/external.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/xdocs/external.xml?view=diff&rev=481878&r1=481877&r2=481878 == --- ant/core/trunk/xdocs/external.xml (original) +++ ant/core/trunk/xdocs/external.xml Sun Dec 3 12:34:44 2006 @@ -3621,6 +3621,38 @@ + + + Instead of manually creating build scripts in XML, Virtual Ant provides a fully virtual file system + where you can run your tasks in real time and see the results. Everything that you do is recorded and + turned into an Ant build script. + + + +Compatibility: + + Ant 1.6.5 onwards + + + +URL: + + http://www.placidsystems.com/virtualant/";>http://www.placidsystems.com/virtualant/ + + + +Contact: + + mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED] + + + +License: +Commercial; OpenSource licenses available too. + + + + WSAD features Ant integrate by virtue of being built on the Eclipse tools platform. @@ -3678,4 +3710,4 @@ - \ No newline at end of file + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r483652 - /ant/core/trunk/WHATSNEW
Author: jglick Date: Thu Dec 7 12:40:25 2006 New Revision: 483652 URL: http://svn.apache.org/viewvc?view=rev&rev=483652 Log: Minor edits. Modified: ant/core/trunk/WHATSNEW Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=483652&r1=483651&r2=483652 == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Dec 7 12:40:25 2006 @@ -4,9 +4,9 @@ Changes that could break older environments: --- -* Initial support for JDK6 scripting
svn commit: r483668 - in /ant/core/trunk/src/main/org/apache/tools/ant/util: ScriptRunnerBase.java optional/JavaxScriptRunner.java optional/ScriptRunner.java
Author: jglick Date: Thu Dec 7 13:07:38 2006 New Revision: 483668 URL: http://svn.apache.org/viewvc?view=rev&rev=483668 Log: Correcting typo. Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java ant/core/trunk/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java ant/core/trunk/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java?view=diff&rev=483668&r1=483667&r2=483668 == --- ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/util/ScriptRunnerBase.java Thu Dec 7 13:07:38 2006 @@ -32,8 +32,9 @@ /** * This is a common abstract base case for script runners. - * These classes need to implement executeScript, evalulateScript + * These classes need to implement executeScript, evaluateScript * and supportsLanguage. + * @since Ant 1.7.0 */ public abstract class ScriptRunnerBase { /** Whether to keep the engine between calls to execute/eval */ @@ -115,7 +116,7 @@ *execution. * @return the result of evalulating the script. */ -public abstract Object evalulateScript(String execName); +public abstract Object evaluateScript(String execName); /** * Check if a script engine can be created for 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=483668&r1=483667&r2=483668 == --- 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 Thu Dec 7 13:07:38 2006 @@ -15,6 +15,7 @@ * limitations under the License. * */ + package org.apache.tools.ant.util.optional; import org.apache.tools.ant.BuildException; @@ -25,10 +26,9 @@ import org.apache.tools.ant.util.ReflectUtil; import org.apache.tools.ant.util.ReflectWrapper; - /** - * This class is used to run javax.script scripts - * + * This class is used to run scripts using JSR 223. + * @since Ant 1.7.0 */ public class JavaxScriptRunner extends ScriptRunnerBase { private ReflectWrapper engine; @@ -66,7 +66,7 @@ * @exception BuildException if someting goes wrong exectuing the script. */ public void executeScript(String execName) throws BuildException { -evalulateScript(execName); +evaluateScript(execName); } /** @@ -77,7 +77,7 @@ * @return the result of the evalulation * @exception BuildException if someting goes wrong exectuing the script. */ -public Object evalulateScript(String execName) throws BuildException { +public Object evaluateScript(String execName) throws BuildException { checkLanguage(); ClassLoader origLoader = replaceContextLoader(); try { Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java?view=diff&rev=483668&r1=483667&r2=483668 == --- ant/core/trunk/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/util/optional/ScriptRunner.java Thu Dec 7 13:07:38 2006 @@ -119,7 +119,7 @@ * @return the result of the evalulation * @exception BuildException if someting goes wrong exectuing the script. */ -public Object evalulateScript(String execName) +public Object evaluateScript(String execName) throws BuildException { checkLanguage(); ClassLoader origLoader = replaceContextLoader(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r483672 - in /ant/core/trunk: build.xml src/main/org/apache/tools/ant/types/optional/ScriptFilter.java
Author: jglick Date: Thu Dec 7 13:24:20 2006 New Revision: 483672 URL: http://svn.apache.org/viewvc?view=rev&rev=483672 Log: It is now possible to build Ant without BSF and then run using JSR scripting. Modified: ant/core/trunk/build.xml ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java Modified: ant/core/trunk/build.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/build.xml?view=diff&rev=483672&r1=483671&r2=483672 == --- ant/core/trunk/build.xml (original) +++ ant/core/trunk/build.xml Thu Dec 7 13:24:20 2006 @@ -241,11 +241,8 @@ - - - - - + + Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java?view=diff&rev=483672&r1=483671&r2=483672 == --- ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java Thu Dec 7 13:24:20 2006 @@ -15,13 +15,14 @@ * limitations under the License. * */ + package org.apache.tools.ant.types.optional; import org.apache.tools.ant.filters.TokenFilter; import java.io.File; import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.util.optional.ScriptRunner; - +import org.apache.tools.ant.util.ScriptRunnerBase; +import org.apache.tools.ant.util.ScriptRunnerHelper; /** * Most of this is CAP (Cut And Paste) from the Script task @@ -40,7 +41,7 @@ /** the token used by the script */ private String token; -private ScriptRunner runner = new ScriptRunner(); +private ScriptRunnerHelper runner = new ScriptRunnerHelper(); /** * Defines the language (required). @@ -61,7 +62,6 @@ return; } initialized = true; -runner.bindToComponent(this); } /** @@ -93,7 +93,9 @@ public String filter(String token) { init(); setToken(token); -runner.executeScript("ant_filter"); +ScriptRunnerBase srb = runner.getScriptRunner(); +srb.bindToComponent(this); +srb.executeScript("ant_filter"); return getToken(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r485112 - /ant/core/trunk/docs/manual/OptionalTasks/script.html
Author: jglick Date: Sat Dec 9 16:48:13 2006 New Revision: 485112 URL: http://svn.apache.org/viewvc?view=rev&rev=485112 Log: 223, not 233. 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=485112&r1=485111&r2=485112 == --- ant/core/trunk/docs/manual/OptionalTasks/script.html (original) +++ ant/core/trunk/docs/manual/OptionalTasks/script.html Sat Dec 9 16:48:13 2006 @@ -29,7 +29,7 @@ Execute a script in a http://jakarta.apache.org/bsf"; target="_top">Apache BSF or -https://scripting.dev.java.net";>JSR 233 supported language. +https://scripting.dev.java.net";>JSR 223 supported language. Note: This task depends on external libraries not included in the Ant distribution. @@ -37,9 +37,9 @@ for more information. -The task may use the BSF scripting manager or the JSR 233 manager that +The task may use the BSF scripting manager or the JSR 223 manager that is included in JDK6 and higher. This is controlled by the manager -attribute. The JSR 233 scripting manager is indicated by "javax". +attribute. The JSR 223 scripting manager is indicated by "javax". All items (tasks, targets, etc) of the running project are accessible from the script, using either their name or - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r489532 - /ant/core/trunk/xdocs/external.xml
Author: jglick Date: Thu Dec 21 17:01:27 2006 New Revision: 489532 URL: http://svn.apache.org/viewvc?view=rev&rev=489532 Log: Update for NB 6.0 + Ant 1.7.0. Modified: ant/core/trunk/xdocs/external.xml Modified: ant/core/trunk/xdocs/external.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/xdocs/external.xml?view=diff&rev=489532&r1=489531&r2=489532 == --- ant/core/trunk/xdocs/external.xml (original) +++ ant/core/trunk/xdocs/external.xml Thu Dec 21 17:01:27 2006 @@ -3554,7 +3554,7 @@ Compatibility: -bundles 1.6.5 for NetBeans 5.0 and 5.5 +bundles 1.6.5 for NetBeans 5.0 and 5.5; 1.7.0 for NetBeans 6.0 URL: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491150 - in /ant/core/trunk: WHATSNEW src/etc/testcases/taskdefs/javadoc/javadoc.xml src/main/org/apache/tools/ant/taskdefs/Javadoc.java src/tests/junit/org/apache/tools/ant/taskdefs/Java
Author: jglick Date: Fri Dec 29 17:44:10 2006 New Revision: 491150 URL: http://svn.apache.org/viewvc?view=rev&rev=491150 Log: #41264: In Ant 1.7.0, in does not by default include only **/*.java as the documentation claims and earlier revisions did. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/etc/testcases/taskdefs/javadoc/javadoc.xml ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavadocTest.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=491150&r1=491149&r2=491150 == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Fri Dec 29 17:44:10 2006 @@ -6,6 +6,11 @@ Fixed bugs: --- + +* In Ant 1.7.0, in does not by default include only + **/*.java as the documentation claims and earlier revisions did. + Bugzilla report 41264. + * SPI support in jar was broken. Bugzilla report 41201. Modified: ant/core/trunk/src/etc/testcases/taskdefs/javadoc/javadoc.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/javadoc/javadoc.xml?view=diff&rev=491150&r1=491149&r2=491150 == --- ant/core/trunk/src/etc/testcases/taskdefs/javadoc/javadoc.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/javadoc/javadoc.xml Fri Dec 29 17:44:10 2006 @@ -139,4 +139,16 @@ + + + + +public class stuff1 {} +public class stuff2 {} +x=4 + + + + + Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java?view=diff&rev=491150&r1=491149&r2=491150 == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javadoc.java Fri Dec 29 17:44:10 2006 @@ -2199,11 +2199,12 @@ if (rc instanceof FileSet) { FileSet fs = (FileSet) rc; if (!fs.hasPatterns() && !fs.hasSelectors()) { -fs = (FileSet) fs.clone(); -fs.createInclude().setName("**/*.java"); +FileSet fs2 = (FileSet) fs.clone(); +fs2.createInclude().setName("**/*.java"); if (includeNoSourcePackages) { -fs.createInclude().setName("**/package.html"); +fs2.createInclude().setName("**/package.html"); } +rc = fs2; } } Iterator iter = rc.iterator(); Modified: ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavadocTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavadocTest.java?view=diff&rev=491150&r1=491149&r2=491150 == --- ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavadocTest.java (original) +++ ant/core/trunk/src/tests/junit/org/apache/tools/ant/taskdefs/JavadocTest.java Fri Dec 29 17:44:10 2006 @@ -131,4 +131,9 @@ public void testDoublyNestedFilesetNoPatterns() throws Exception { executeTarget("doublyNestedFilesetNoPatterns"); } + +public void testNonJavaIncludes() throws Exception { // #41264 +executeTarget("nonJavaIncludes"); +} + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491821 - /ant/core/trunk/xdocs/index.xml
Author: jglick Date: Tue Jan 2 07:54:19 2007 New Revision: 491821 URL: http://svn.apache.org/viewvc?view=rev&rev=491821 Log: Home page still says manual is for 1.6.5! Modified: ant/core/trunk/xdocs/index.xml Modified: ant/core/trunk/xdocs/index.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/xdocs/index.xml?view=diff&rev=491821&r1=491820&r2=491821 == --- ant/core/trunk/xdocs/index.xml (original) +++ ant/core/trunk/xdocs/index.xml Tue Jan 2 07:54:19 2007 @@ -122,7 +122,7 @@ -You can view the documentation for the current release (Apache Ant 1.6.5) +You can view the documentation for the current release (Apache Ant 1.7.0) online - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r498519 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Author: jglick Date: Sun Jan 21 20:04:15 2007 New Revision: 498519 URL: http://svn.apache.org/viewvc?view=rev&rev=498519 Log: #41422: in Ant 1.7.0 could throw NPE if no was defined. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=498519&r1=498518&r2=498519 == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Sun Jan 21 20:04:15 2007 @@ -7,6 +7,9 @@ Fixed bugs: --- +* in Ant 1.7.0 could throw NPE if no was defined. + Bugzilla report 41422. + * In Ant 1.7.0, in does not by default include only **/*.java as the documentation claims and earlier revisions did. Bugzilla report 41264. 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?view=diff&rev=498519&r1=498518&r2=498519 == --- 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 Sun Jan 21 20:04:15 2007 @@ -756,7 +756,10 @@ if (splitJunit) { Path path = new Path(getProject()); path.add(antRuntimeClasses); -path.add(getCommandline().getClasspath()); +Path extra = getCommandline().getClasspath(); +if (extra != null) { +path.add(extra); +} mirrorLoader = new SplitLoader(myLoader, path); } else { mirrorLoader = myLoader; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r499080 - /ant/core/trunk/docs/manual/install.html
Author: jglick Date: Tue Jan 23 08:59:06 2007 New Revision: 499080 URL: http://svn.apache.org/viewvc?view=rev&rev=499080 Log: #38799 cont'd: clearer docs on avoiding -lib. Modified: ant/core/trunk/docs/manual/install.html Modified: ant/core/trunk/docs/manual/install.html URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/install.html?view=diff&rev=499080&r1=499079&r2=499080 == --- ant/core/trunk/docs/manual/install.html (original) +++ ant/core/trunk/docs/manual/install.html Tue Jan 23 08:59:06 2007 @@ -256,6 +256,19 @@ the JAR files visible to all Java applications, and causes no end of support calls. + + +In some <classpath> accepted by the task itself. +For example, as of Ant 1.7.0 you can run the <junit> +task without junit.jar in Ant's own classpath, so long as +it is included (along with your program and tests) in the classpath +passed when running the task. Where possible, this option is generally +to be preferred, as the Ant script itself can determine the best path +to load the library from: via relative path from the basedir (if you +keep the library under version control with your project), according +to Ant properties, environment variables, Ivy downloads, whatever you like. + + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r499378 - /ant/core/trunk/docs/manual/install.html
Author: jglick Date: Wed Jan 24 04:22:40 2007 New Revision: 499378 URL: http://svn.apache.org/viewvc?view=rev&rev=499378 Log: More on $CLASSPATH. Modified: ant/core/trunk/docs/manual/install.html Modified: ant/core/trunk/docs/manual/install.html URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/install.html?view=diff&rev=499378&r1=499377&r2=499378 == --- ant/core/trunk/docs/manual/install.html (original) +++ ant/core/trunk/docs/manual/install.html Wed Jan 24 04:22:40 2007 @@ -235,39 +235,45 @@ The external libraries required by each of the optional tasks is detailed in the Library Dependencies section. These external -libraries must be added to Ant's classpath, in any of the following ways +libraries must be added to Ant's classpath, in any of the following ways: -In ANT_HOME/lib. This makes the JAR files available to all -Ant users and builds - - -In ${user.home}/.ant/lib . This is a new feature since Ant1.6, -and allows different users to add new libraries to Ant. All JAR files + +In ANT_HOME/lib. This makes the JAR files available to all +Ant users and builds. + + + +In ${user.home}/.ant/lib (as of Ant 1.6). This +allows different users to add new libraries to Ant. All JAR files added to this directory are available to command-line Ant. - + - + On the command line with a -lib parameter. This lets you add new JAR files on a case-by-case basis. - + -In the CLASSPATH environment variable. Avoid this; it makes + +In the CLASSPATH environment variable. Avoid this; it makes the JAR files visible to all Java applications, and causes -no end of support calls. +no end of support calls. See below for details. + - + In some <classpath> accepted by the task itself. For example, as of Ant 1.7.0 you can run the <junit> task without junit.jar in Ant's own classpath, so long as it is included (along with your program and tests) in the classpath -passed when running the task. Where possible, this option is generally +passed when running the task. + +Where possible, this option is generally to be preferred, as the Ant script itself can determine the best path to load the library from: via relative path from the basedir (if you keep the library under version control with your project), according to Ant properties, environment variables, Ivy downloads, whatever you like. - + @@ -277,10 +283,10 @@ added to a project are automatically added to ant's classpath. -The CLASSPATH environment variable +The CLASSPATH environment variable -The CLASSPATH environment variable is a source of many Ant support queries. As +The CLASSPATH environment variable is a source of many Ant support queries. As the round trip time for diagnosis on the Ant user mailing list can be slow, and because filing bug reports complaining about 'ant.bat' not working will be rejected by the developers as WORKSFORME "this is a configuration problem, not a @@ -290,21 +296,21 @@ -Do not ever set CLASSPATH. Ant does not need it, it only causes confusion +Do not ever set CLASSPATH. Ant does not need it, it only causes confusion and breaks things. If you ignore the previous rule, do not ever, ever, put quotes in the -CLASSPATH, even if there is a space in a directory. This will break Ant, and it +CLASSPATH, even if there is a space in a directory. This will break Ant, and it is not needed. If you ignore the first rule, do not ever, ever, have a trailing backslash -in a CLASSPATH, as it breaks Ant's ability to quote the string. Again, this is -not needed for the correct operation of the CLASSPATH environment variable, even +in a CLASSPATH, as it breaks Ant's ability to quote the string. Again, this is +not needed for the correct operation of the CLASSPATH environment variable, even if a DOS directory is to be added to the path. -You can stop Ant using the CLASSPATH environment variable by setting the +You can stop Ant using the CLASSPATH environment variable by setting the -noclasspath option on the command line. This is an easy way to test for classpath-related problems. @@ -312,14 +318,29 @@ -The usual symptom of CLASSPATH problems is that ant will not run with some error -about not being able to find org.apache.tools.Ant.main, or, if you have got the +The usual symptom of CLASSPATH problems is that ant will not run with some error +about not being able to find org.apache.tools.ant.launch.Launcher, or, if you have got the quotes/backslashes wrong, some very weird Java startup error. To see if this is -the case, r
cvs commit: ant/xdocs contributors.xml
jglick 2004/10/19 17:42:33 Modified:xdocscontributors.xml Log: If this works, my CVS access is working OK... Revision ChangesPath 1.30 +10 -0 ant/xdocs/contributors.xml Index: contributors.xml === RCS file: /home/cvs/ant/xdocs/contributors.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- contributors.xml 16 Aug 2004 14:57:50 - 1.29 +++ contributors.xml 20 Oct 2004 00:42:33 - 1.30 @@ -199,6 +199,16 @@ project in a spirit of co-operation over competition. + +Jesse Glick (jesse dot glick at sun dot com) + +Jesse has been using Java since 1998 and joined Sun Microsystems as +part of the company that produced the NetBeans IDE. After discovering +Ant in the 1.2 days, he wrote most of NetBeans' Ant integration. +Recently he has worked on the NetBeans 4.0 project system, based heavily +on Ant as a build tool. + + Jason Hunter (jh at servlets.com) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks tempfile.html
jglick 2004/11/30 13:57:17 Modified:docs/manual/CoreTasks tempfile.html Log: 1. Removing mention of JDK 1.1 which is no longer supported anyway. 2. More readable HTML source formatting - reduce merge conflicts, e.g. Revision ChangesPath 1.6 +20 -1 ant/docs/manual/CoreTasks/tempfile.html Index: tempfile.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/tempfile.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- tempfile.html 19 Nov 2004 09:07:09 - 1.5 +++ tempfile.html 30 Nov 2004 21:57:17 - 1.6 @@ -46,7 +46,26 @@ -This task sets a property to the name of a temporary file. Unlike the Java1.2 method to create a temporary file, this task does work on Java1.1. Also, it does not actually create the temporary file, but it does guarantee that the file did not exist when the task was executed. Examples <tempfile property="temp.file"/> create a temporary file <tempfile property="temp.file" suffix=".xml"/> create a temporary file with the .xml suffix. <tempfile property="temp.file" destDir="build"/> create a temp file in the build subdir + + This task sets a property to the name of a temporary file. + Unlike java.io.File.createTempFile, + this task does not actually create the temporary file, but it does guarantee that the + file did not exist when the task was executed. + + Examples: + + <tempfile property="temp.file"/> + + create a temporary file + + <tempfile property="temp.file" suffix=".xml"/> + + create a temporary file with the .xml suffix + + <tempfile property="temp.file" destDir="build"/> + + create a temporary file in the build subdirectory + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks ant.html
jglick 2004/11/30 20:02:33 Modified:docs/manual/CoreTasks ant.html Log: s/can not/cannot/ Revision ChangesPath 1.29 +2 -2 ant/docs/manual/CoreTasks/ant.html Index: ant.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/ant.html,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- ant.html 19 Nov 2004 09:07:09 - 1.28 +++ ant.html 1 Dec 2004 04:02:33 - 1.29 @@ -33,7 +33,7 @@ to the new project and any project created in that project regardless of the setting of inheritAll. This allows you to parameterize your subprojects. Properties defined on the command line -can not be overridden by nested <property> elements. +cannot be overridden by nested <property> elements. References to data types can also be passed to the new project, but by default they are not. If you set the inheritrefs attribute to @@ -272,4 +272,4 @@ Reserved. - \ No newline at end of file + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs TempFile.java
jglick 2004/12/02 13:59:13 Modified:src/main/org/apache/tools/ant/taskdefs TempFile.java Log: Small Javadoc change. CVS: -- CVS: PR: CVS: If this change addresses a PR in the problem report tracking CVS: database, then enter the PR number(s) here. CVS: Obtained from: CVS: If this change has been taken from another system, such as NCSA, CVS: then name the system in this line, otherwise delete it. CVS: Submitted by: CVS: If this code has been contributed to Apache by someone else; i.e., CVS: they sent us a patch or a new module, then include their name/email CVS: address here. If this is your work then delete this line. CVS: Reviewed by: CVS: If we are doing pre-commit code reviews and someone else has CVS: reviewed your changes, include their name(s) here. CVS: If you have not had it reviewed then delete this line. Revision ChangesPath 1.13 +1 -2 ant/src/main/org/apache/tools/ant/taskdefs/TempFile.java Index: TempFile.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/TempFile.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- TempFile.java 9 Mar 2004 16:48:06 - 1.12 +++ TempFile.java 2 Dec 2004 21:59:12 - 1.13 @@ -23,8 +23,7 @@ /** * This task sets a property to the name of a temporary file. - * Unlike the Java1.2 method to create a temporary file, this task - * does work on Java1.1. Also, it does not actually create the + * Unlike [EMAIL PROTECTED] File#createTempFile}, this task does not actually create the * temporary file, but it does guarantee that the file did not * exist when the task was executed. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ImportTask.java
jglick 2004/12/02 14:06:16 Modified:src/main/org/apache/tools/ant/taskdefs ImportTask.java Log: Trivial Javadoc formatting edits. Revision ChangesPath 1.29 +8 -9 ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java Index: ImportTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- ImportTask.java 28 Apr 2004 09:01:08 - 1.28 +++ ImportTask.java 2 Dec 2004 22:06:15 - 1.29 @@ -29,27 +29,26 @@ import java.util.Vector; /** - * * Task to import another build file into the current project. * * It must be 'top level'. On execution it will read another Ant file * into the same Project. + * * * Important: we have not finalized how relative file references - * will be resolved in deep/complex build hierarchies -such as what happens + * will be resolved in deep/complex build hierarchies - such as what happens * when an imported file imports another file. Use absolute references for * enhanced build file stability, especially in the imported files. - * - * Examples + * + * Examples: * - * <import file="../common-targets.xml" /> + * <import file="../common-targets.xml"/> * - * Import targets from a file in a parent directory. - * + * Import targets from a file in a parent directory. * - * <import file="${deploy-platform}.xml" /> + * <import file="${deploy-platform}.xml"/> * - * Import the project defined by the property deploy-platform + * Import the project defined by the property deploy-platform. * * @since Ant1.6 * @ant.task category="control" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/helper SingleCheckExecutor.java KeepGoingExecutor.java DefaultExecutor.java
jglick 2004/12/06 22:43:42 Modified:src/main/org/apache/tools/ant/helper SingleCheckExecutor.java KeepGoingExecutor.java DefaultExecutor.java Log: Improving Javadoc of Executor impls to be more informative. :-) Matt please check. Revision ChangesPath 1.2 +2 -0 ant/src/main/org/apache/tools/ant/helper/SingleCheckExecutor.java Index: SingleCheckExecutor.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/SingleCheckExecutor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SingleCheckExecutor.java 31 Aug 2004 22:32:53 - 1.1 +++ SingleCheckExecutor.java 7 Dec 2004 06:43:42 - 1.2 @@ -27,6 +27,8 @@ /** * "Single-check" Target executor implementation. + * Differs from [EMAIL PROTECTED] DefaultExecutor} in that the dependencies for all + * targets are computed together, so that shared dependencies are run just once. * @since Ant 1.6.3 */ public class SingleCheckExecutor implements Executor { 1.2 +3 -0 ant/src/main/org/apache/tools/ant/helper/KeepGoingExecutor.java Index: KeepGoingExecutor.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/KeepGoingExecutor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- KeepGoingExecutor.java31 Aug 2004 22:32:53 - 1.1 +++ KeepGoingExecutor.java7 Dec 2004 06:43:42 - 1.2 @@ -25,6 +25,9 @@ /** * "Keep-going" Target executor implementation. + * Differs from [EMAIL PROTECTED] DefaultExecutor} in that a failure in one target does + * not halt execution; all targets are attempted, in order. The last failure, + * if any, is reported to the caller. * @since Ant 1.6.3 */ public class KeepGoingExecutor implements Executor { 1.2 +2 -0 ant/src/main/org/apache/tools/ant/helper/DefaultExecutor.java Index: DefaultExecutor.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/DefaultExecutor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DefaultExecutor.java 31 Aug 2004 22:32:53 - 1.1 +++ DefaultExecutor.java 7 Dec 2004 06:43:42 - 1.2 @@ -25,6 +25,8 @@ /** * Default Target executor implementation. + * Runs each target individually (including all of its dependencies), + * halting immediately upon error. * @since Ant 1.6.3 */ public class DefaultExecutor implements Executor { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Ant.java
jglick 2004/12/06 22:44:34 Modified:src/main/org/apache/tools/ant/taskdefs Ant.java Log: Minor stylistic refactoring. Revision ChangesPath 1.109 +3 -2 ant/src/main/org/apache/tools/ant/taskdefs/Ant.java Index: Ant.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v retrieving revision 1.108 retrieving revision 1.109 diff -u -r1.108 -r1.109 --- Ant.java 22 Nov 2004 09:23:27 - 1.108 +++ Ant.java 7 Dec 2004 06:44:34 - 1.109 @@ -31,6 +31,7 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.DefaultLogger; +import org.apache.tools.ant.Executor; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.ProjectHelper; @@ -64,7 +65,7 @@ public class Ant extends Task { /** Target Executor */ -private static SingleCheckExecutor executor = new SingleCheckExecutor(); +private static final Executor EXECUTOR = new SingleCheckExecutor(); /** the basedir where is executed the build file */ private File dir = null; @@ -398,7 +399,7 @@ try { log("Entering " + antFile + "...", Project.MSG_VERBOSE); newProject.fireSubBuildStarted(); -executor.executeTargets(newProject, +EXECUTOR.executeTargets(newProject, (String[]) (locals.toArray(new String[locals.size()]))); } catch (BuildException ex) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs BuildNumber.java
jglick 2004/12/06 22:45:32 Modified:src/main/org/apache/tools/ant/taskdefs BuildNumber.java Log: Minor simplification: task.log(...) ~ task.getProject().log(...). Revision ChangesPath 1.18 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java Index: BuildNumber.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- BuildNumber.java 9 Mar 2004 16:48:04 - 1.17 +++ BuildNumber.java 7 Dec 2004 06:45:32 - 1.18 @@ -98,7 +98,7 @@ try { output.close(); } catch (final IOException ioe) { -getProject().log("error closing output stream " + ioe, Project.MSG_ERR); +log("error closing output stream " + ioe, Project.MSG_ERR); } } myFile = savedFile; @@ -157,7 +157,7 @@ try { input.close(); } catch (final IOException ioe) { -getProject().log("error closing input stream " + ioe, Project.MSG_ERR); +log("error closing input stream " + ioe, Project.MSG_ERR); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/optional AbstractXSLTLiaisonTest.java
jglick 2004/12/07 01:02:33 Modified:src/testcases/org/apache/tools/ant/taskdefs/optional AbstractXSLTLiaisonTest.java Log: 1. Never use new File(url.getFile()); it is not safe with all paths. 2. Using File.deleteOnExit for temp files, just in case the VM croaks. Revision ChangesPath 1.9 +10 -8 ant/src/testcases/org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java Index: AbstractXSLTLiaisonTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- AbstractXSLTLiaisonTest.java 9 Feb 2004 21:05:44 - 1.8 +++ AbstractXSLTLiaisonTest.java 7 Dec 2004 09:02:33 - 1.9 @@ -1,5 +1,3 @@ -package org.apache.tools.ant.taskdefs.optional; - /* * Copyright 2001,2004 The Apache Software Foundation * @@ -17,15 +15,17 @@ * */ -import junit.framework.TestCase; -import org.apache.tools.ant.taskdefs.XSLTLiaison; -import org.w3c.dom.Document; +package org.apache.tools.ant.taskdefs.optional; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; import java.io.File; import java.io.FileNotFoundException; import java.net.URL; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import junit.framework.TestCase; +import org.apache.tools.ant.taskdefs.XSLTLiaison; +import org.apache.tools.ant.util.FileUtils; +import org.w3c.dom.Document; /** * Abtract testcase for XSLTLiaison. @@ -54,7 +54,7 @@ if (url == null){ throw new FileNotFoundException("Unable to load '" + name + "' from classpath"); } -return new File(url.getFile()); +return new File(FileUtils.newFileUtils().fromURI(url.toExternalForm())); } /** keep it simple stupid */ @@ -64,6 +64,7 @@ liaison.addParam("param", "value"); File in = getFile("/taskdefs/optional/xsltliaison-in.xml"); File out = new File("xsltliaison.tmp"); +out.deleteOnExit(); // just to be sure try { liaison.transform(in, out); } finally { @@ -76,6 +77,7 @@ liaison.setStylesheet(xsl); File in = getFile("/taskdefs/optional/xsltliaison-encoding-in.xml"); File out = new File("xsltliaison-encoding.tmp"); +out.deleteOnExit(); // just to be sure try { liaison.transform(in, out); Document doc = parseXML(out); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant build.xml
jglick 2004/12/07 01:10:39 Modified:src/testcases/org/apache/tools/ant/util FileUtilsTest.java src/testcases/org/apache/tools/ant/types/selectors PresentSelectorTest.java BaseSelectorTest.java src/testcases/org/apache/tools/ant/types XMLCatalogTest.java PathTest.java FilterSetTest.java CommandlineJavaTest.java src/testcases/org/apache/tools/ant/taskdefs/optional/junit JUnitReportTest.java src/testcases/org/apache/tools/ant/taskdefs/optional/i18n TranslateTest.java src/testcases/org/apache/tools/ant/taskdefs/optional ReplaceRegExpTest.java PropertyFileTest.java JspcTest.java ANTLRTest.java src/testcases/org/apache/tools/ant/taskdefs XmlPropertyTest.java TouchTest.java TarTest.java ManifestTest.java InitializeClassTest.java ImportTest.java FixCrLfTest.java ExecTaskTest.java src/testcases/org/apache/tools/ant DirectoryScannerTest.java BuildFileTest.java .build.xml Log: Trying to make unit tests independent of CWD. Revision ChangesPath 1.30 +13 -8 ant/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java Index: FileUtilsTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- FileUtilsTest.java8 Aug 2004 21:03:21 - 1.29 +++ FileUtilsTest.java7 Dec 2004 09:10:38 - 1.30 @@ -322,18 +322,18 @@ * Test contentEquals */ public void testContentEquals() throws IOException { -assertTrue("Non existing files", fu.contentEquals(new File("foo"), - new File("bar"))); +assertTrue("Non existing files", fu.contentEquals(new File(System.getProperty("root"), "foo"), + new File(System.getProperty("root"), "bar"))); assertTrue("One exists, the other one doesn\'t", - !fu.contentEquals(new File("foo"), new File("build.xml"))); + !fu.contentEquals(new File(System.getProperty("root"), "foo"), new File(System.getProperty("root"), "build.xml"))); assertTrue("Don\'t compare directories", - !fu.contentEquals(new File("src"), new File("src"))); + !fu.contentEquals(new File(System.getProperty("root"), "src"), new File(System.getProperty("root"), "src"))); assertTrue("File equals itself", - fu.contentEquals(new File("build.xml"), -new File("build.xml"))); + fu.contentEquals(new File(System.getProperty("root"), "build.xml"), +new File(System.getProperty("root"), "build.xml"))); assertTrue("Files are different", - !fu.contentEquals(new File("build.xml"), - new File("docs.xml"))); + !fu.contentEquals(new File(System.getProperty("root"), "build.xml"), + new File(System.getProperty("root"), "docs.xml"))); } /** @@ -409,9 +409,14 @@ assertEquals("file:///SYS:/foo", fu.toURI("sys:\\foo")); } assertEquals("file:///" + dosRoot + "foo", fu.toURI("/foo")); +/* May fail if the directory ${user.dir}/foo/ exists + * (and anyway is the tested behavior actually desirable?): assertEquals("file:./foo", fu.toURI("./foo")); + */ assertEquals("file:///" + dosRoot + "foo", fu.toURI("\\foo")); +/* See above: assertEquals("file:./foo", fu.toURI(".\\foo")); + */ assertEquals("file:///" + dosRoot + "foo%20bar", fu.toURI("/foo bar")); assertEquals("file:///" + dosRoot + "foo%20bar", fu.toURI("\\foo bar")); assertEquals("file:///" + dosRoot + "foo%23bar",
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs ReplaceTest.java
jglick 2004/12/07 01:11:47 Modified:src/testcases/org/apache/tools/ant/taskdefs ReplaceTest.java Log: Unused constant. Revision ChangesPath 1.15 +0 -1 ant/src/testcases/org/apache/tools/ant/taskdefs/ReplaceTest.java Index: ReplaceTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ReplaceTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ReplaceTest.java 9 Mar 2004 16:48:57 - 1.14 +++ ReplaceTest.java 7 Dec 2004 09:11:47 - 1.15 @@ -27,7 +27,6 @@ */ public class ReplaceTest extends BuildFileTest { -private static final String TEST_PATH = "src/etc/testcases/taskdefs/replace/"; public ReplaceTest(String name) { super(name); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/optional XalanLiaisonTest.java
jglick 2004/12/07 01:13:04 Modified:src/testcases/org/apache/tools/ant/taskdefs/optional XalanLiaisonTest.java Log: Just moving license to top of file for consistency. Revision ChangesPath 1.11 +2 -2 ant/src/testcases/org/apache/tools/ant/taskdefs/optional/XalanLiaisonTest.java Index: XalanLiaisonTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/XalanLiaisonTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- XalanLiaisonTest.java 9 Mar 2004 16:49:01 - 1.10 +++ XalanLiaisonTest.java 7 Dec 2004 09:13:04 - 1.11 @@ -1,5 +1,3 @@ -package org.apache.tools.ant.taskdefs.optional; - /* * Copyright 2001-2002,2004 The Apache Software Foundation * @@ -16,6 +14,8 @@ * limitations under the License. * */ + +package org.apache.tools.ant.taskdefs.optional; import org.apache.tools.ant.taskdefs.XSLTLiaison; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks javac.html
jglick 2004/12/10 15:16:09 Modified:docs/manual/CoreTasks javac.html Log: The manual strongly encourages you to specify source/target levels, yet it gave no examples that did so! Putting in some usages to plant the bug in people's minds. (Especially important for people just starting to use JDK 1.5, which changed the default source level.) Revision ChangesPath 1.49 +14 -4 ant/docs/manual/CoreTasks/javac.html Index: javac.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/javac.html,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- javac.html19 Nov 2004 09:07:09 - 1.48 +++ javac.html10 Dec 2004 23:16:08 - 1.49 @@ -416,31 +416,39 @@ destdir="${build}" classpath="xyz.jar" debug="on" + source="1.4" /> compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. The classpath used includes xyz.jar, and compiling with -debug information is on. +debug information is on. The source level is 1.4, +so you can use assert statements. <javac srcdir="${src}" destdir="${build}" fork="true" + source="1.2" + target="1.2" /> compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. This will fork off the javac -compiler using the default javac executable. +compiler using the default javac executable. +The source level is 1.2 (similar to 1.1 or 1.3) and +the class files should be runnable under JDK 1.2+ as well. <javac srcdir="${src}" destdir="${build}" fork="java$$javac.exe" + source="1.5" /> compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. This will fork off the javac compiler, using the executable named java$javac.exe. Note -that the $ sign needs to be escaped by a second one. +that the $ sign needs to be escaped by a second one. +The source level is 1.5, so you can use generics. <javac srcdir="${src}" destdir="${build}" @@ -455,7 +463,9 @@ The classpath used includes xyz.jar, and debug information is on. Only files under mypackage/p1 and mypackage/p2 are used. All files in and below the mypackage/p1/testpackage -directory are excluded from compilation. +directory are excluded from compilation. +You didn't specify a source or target level, +so the actual values used will depend on which JDK you ran Ant with. <javac srcdir="${src}:${src2}" destdir="${build}" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks javac.html
jglick 2004/12/10 15:17:34 Modified:docs/manual/CoreTasks Tag: ANT_16_BRANCH javac.html Log: merge Revision ChangesPath No revision No revision 1.42.2.7 +14 -4 ant/docs/manual/CoreTasks/javac.html Index: javac.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/javac.html,v retrieving revision 1.42.2.6 retrieving revision 1.42.2.7 diff -u -r1.42.2.6 -r1.42.2.7 --- javac.html19 Nov 2004 09:10:00 - 1.42.2.6 +++ javac.html10 Dec 2004 23:17:34 - 1.42.2.7 @@ -416,31 +416,39 @@ destdir="${build}" classpath="xyz.jar" debug="on" + source="1.4" /> compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. The classpath used includes xyz.jar, and compiling with -debug information is on. +debug information is on. The source level is 1.4, +so you can use assert statements. <javac srcdir="${src}" destdir="${build}" fork="true" + source="1.2" + target="1.2" /> compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. This will fork off the javac -compiler using the default javac executable. +compiler using the default javac executable. +The source level is 1.2 (similar to 1.1 or 1.3) and +the class files should be runnable under JDK 1.2+ as well. <javac srcdir="${src}" destdir="${build}" fork="java$$javac.exe" + source="1.5" /> compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. This will fork off the javac compiler, using the executable named java$javac.exe. Note -that the $ sign needs to be escaped by a second one. +that the $ sign needs to be escaped by a second one. +The source level is 1.5, so you can use generics. <javac srcdir="${src}" destdir="${build}" @@ -455,7 +463,9 @@ The classpath used includes xyz.jar, and debug information is on. Only files under mypackage/p1 and mypackage/p2 are used. All files in and below the mypackage/p1/testpackage -directory are excluded from compilation. +directory are excluded from compilation. +You didn't specify a source or target level, +so the actual values used will depend on which JDK you ran Ant with. <javac srcdir="${src}:${src2}" destdir="${build}" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java
jglick 2004/12/10 15:18:22 Modified:src/main/org/apache/tools/ant/util FileUtils.java Log: If we can use File.getParentFile, there is presumably no reason to use FileUtils.getParentFile, right? Revision ChangesPath 1.76 +4 -3 ant/src/main/org/apache/tools/ant/util/FileUtils.java Index: FileUtils.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- FileUtils.java7 Dec 2004 23:32:31 - 1.75 +++ FileUtils.java10 Dec 2004 23:18:22 - 1.76 @@ -1030,12 +1030,13 @@ } /** - * This was originally an emulation of File.getParentFile for JDK 1.1, - * but it is now implemented using that method (Ant1.7 onwards). + * This was originally an emulation of [EMAIL PROTECTED] File#getParentFile} for JDK 1.1, + * but it is now implemented using that method (Ant 1.7 onwards). * @param f the file whose parent is required. * @return the given file's parent, or null if the file does not have a * parent. * @since 1.10 + * @deprecated Just use [EMAIL PROTECTED] File#getParentFile} directly. */ public File getParentFile(File f) { return (f == null) ? null : f.getParentFile(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant check.xml
jglick 2004/12/10 15:19:28 Modified:.check.xml Log: 1. Make checkstyle target work independently of CWD. 2. Add a target to display the text report inline, for easy hyperlink navigation. Revision ChangesPath 1.13 +13 -8 ant/check.xml Index: check.xml === RCS file: /home/cvs/ant/check.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- check.xml 14 Sep 2003 09:12:08 - 1.12 +++ check.xml 10 Dec 2004 23:19:28 - 1.13 @@ -18,13 +18,13 @@ - + - - - - - + + + + + @@ -35,7 +35,7 @@ - + @@ -60,6 +60,11 @@ out="${checkstyle.reportdir}/report.txt"> + + + + ${report} +
cvs commit: ant/docs faq.html
jglick 2005/01/02 10:28:16 Modified:xdocsfaq.xml docs faq.html Log: Typo ("UFT8"). PR: 32907 Reported by: Jed Smith <[EMAIL PROTECTED]> Revision ChangesPath 1.66 +1 -1 ant/xdocs/faq.xml Index: faq.xml === RCS file: /home/cvs/ant/xdocs/faq.xml,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- faq.xml 13 Dec 2004 22:51:19 - 1.65 +++ faq.xml 2 Jan 2005 18:28:15 - 1.66 @@ -601,7 +601,7 @@ If your file names contain national characters you should know that Sun's jar utility like Ant's -<jar> uses UFT8 to encode their names while +<jar> uses UTF-8 to encode their names while <zip> uses your platforms default encoding. Use the encoding attribute of <zip> if necessary. 1.113 +1 -1 ant/docs/faq.html Index: faq.html === RCS file: /home/cvs/ant/docs/faq.html,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- faq.html 13 Dec 2004 22:51:19 - 1.112 +++ faq.html 2 Jan 2005 18:28:15 - 1.113 @@ -978,7 +978,7 @@ MANIFEST you can simply use <zip>. If your file names contain national characters you should know that Sun's jar utility like Ant's -<jar> uses UFT8 to encode their names while +<jar> uses UTF-8 to encode their names while <zip> uses your platforms default encoding. Use the encoding attribute of <zip> if necessary. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs faq.html
jglick 2005/01/02 10:31:06 Modified:xdocsTag: ANT_16_BRANCH faq.xml docs Tag: ANT_16_BRANCH faq.html Log: Merge of #32907. Revision ChangesPath No revision No revision 1.38.2.18 +1 -1 ant/xdocs/faq.xml Index: faq.xml === RCS file: /home/cvs/ant/xdocs/faq.xml,v retrieving revision 1.38.2.17 retrieving revision 1.38.2.18 diff -u -r1.38.2.17 -r1.38.2.18 --- faq.xml 21 Sep 2004 12:07:54 - 1.38.2.17 +++ faq.xml 2 Jan 2005 18:31:06 - 1.38.2.18 @@ -584,7 +584,7 @@ If your file names contain national characters you should know that Sun's jar utility like Ant's -<jar> uses UFT8 to encode their names while +<jar> uses UTF-8 to encode their names while <zip> uses your platforms default encoding. Use the encoding attribute of <zip> if necessary. No revision No revision 1.77.2.19 +1 -1 ant/docs/faq.html Index: faq.html === RCS file: /home/cvs/ant/docs/faq.html,v retrieving revision 1.77.2.18 retrieving revision 1.77.2.19 diff -u -r1.77.2.18 -r1.77.2.19 --- faq.html 21 Sep 2004 12:07:53 - 1.77.2.18 +++ faq.html 2 Jan 2005 18:31:06 - 1.77.2.19 @@ -944,7 +944,7 @@ MANIFEST you can simply use <zip>. If your file names contain national characters you should know that Sun's jar utility like Ant's -<jar> uses UFT8 to encode their names while +<jar> uses UTF-8 to encode their names while <zip> uses your platforms default encoding. Use the encoding attribute of <zip> if necessary. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant docs.xml ReleaseInstructions
jglick 2005/01/02 10:34:39 Modified:.docs.xml ReleaseInstructions Log: Make it possible to use docs.xml even without a jakarta-site2 checkout. Revision ChangesPath 1.6 +33 -10ant/docs.xml Index: docs.xml === RCS file: /home/cvs/ant/docs.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- docs.xml 6 Jul 2003 09:03:17 - 1.5 +++ docs.xml 2 Jan 2005 18:34:39 - 1.6 @@ -1,22 +1,44 @@ + +Build documentation - XDocs and Javadoc. +For building XDocs, edit xdocs/**/*.xml first. +If ../jakarta-site2 does not exist, set -Dsite.dir=... for it, +or just use -Dvelocity.dir=.../velocity-4.x if you have downloaded Velocity somewhere. + +XXX for no apparent reason, your CWD must be the main Ant source dir, or this will fail: +.../docs.xml:64: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource './site.vsl' + + - - - - - - + + + + + + + + + - + + + + + + + + + + @@ -30,7 +52,7 @@ - + @@ -46,11 +68,12 @@ - + - + + 1.24 +3 -3 ant/ReleaseInstructions Index: ReleaseInstructions === RCS file: /home/cvs/ant/ReleaseInstructions,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- ReleaseInstructions 2 Jul 2004 10:09:13 - 1.23 +++ ReleaseInstructions 2 Jan 2005 18:34:39 - 1.24 @@ -65,9 +65,9 @@ * xdocs/srcdownload.xml * xdocs/bindownload.xml -Generate the html files by invoking ant on docs.xml - you need -jakarta-site2 checked out for this. Commit the modified/generated -files +Generate the html files by invoking ant on docs.xml +(use -projecthelp for instructions). +Commit the modified/generated files 6. Ensure you have all the external libraries that Ant uses in your lib/optional directory. To find out what libraries you need, execute - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Available.java
jglick 2005/01/24 18:29:43 Modified:src/main/org/apache/tools/ant/taskdefs Available.java Log: Log warnings as warnings. Revision ChangesPath 1.65 +4 -2 ant/src/main/org/apache/tools/ant/taskdefs/Available.java Index: Available.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- Available.java11 Jan 2005 16:34:57 - 1.64 +++ Available.java25 Jan 2005 02:29:43 - 1.65 @@ -165,7 +165,8 @@ */ public void setType(String type) { log("DEPRECATED - The setType(String) method has been deprecated." -+ " Use setType(Available.FileDir) instead."); ++ " Use setType(Available.FileDir) instead.", +Project.MSG_WARN); this.type = new FileDir(); this.type.setValue(type); } @@ -211,7 +212,8 @@ + " property." + StringUtils.LINE_SEP + " Build file should not reuse the same property" -+ " name for different values."); ++ " name for different values.", +Project.MSG_WARN); } // NB: this makes use of Project#setProperty rather than Project#setNewProperty // due to backwards compatiblity reasons - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Java.java PumpStreamHandler.java Redirector.java StreamPumper.java
jglick 2005/01/27 08:36:11 Modified:.WHATSNEW docs/manual/CoreTasks java.html src/main/org/apache/tools/ant/taskdefs Java.java PumpStreamHandler.java Redirector.java StreamPumper.java Log: Permit to accept standard input from console. PR: 24918 Revision ChangesPath 1.731 +4 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.730 retrieving revision 1.731 diff -u -r1.730 -r1.731 --- WHATSNEW 27 Jan 2005 12:42:09 - 1.730 +++ WHATSNEW 27 Jan 2005 16:36:11 - 1.731 @@ -24,6 +24,10 @@ Fixed bugs: --- +* Programs run with can now accept standard input + from the Ant console. (Programs run with could + already do so.) Bugzilla Report 24918. + * Translate task does not remove tokens when a key is not found. It logs a verbose message. Bugzilla Report 13936. 1.36 +7 -7 ant/docs/manual/CoreTasks/java.html Index: java.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/java.html,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- java.html 10 Jan 2005 10:59:31 - 1.35 +++ java.html 27 Jan 2005 16:36:11 - 1.36 @@ -15,10 +15,9 @@ If odd things go wrong when you run this task, set fork="true" to use a new JVM. -Note that you cannot interact with a forked VM, the only way to -send input to it is via the input and inputstring attributes. Also note that -in Ant 1.6, any attempt to read input in the forked VM will receive an -EOF (-1). This is a change from Ant 1.5, where such an attempt would block. +As of Ant 1.7, you can interact with a forked VM, as well as +sending input to it via the input and inputstring +attributes. Parameters @@ -157,14 +156,16 @@ A file from which the executed command's standard input is taken. This attribute is mutually exclusive with the inputstring attribute -No +No; default is to take standard input from console +(unless spawn="true") inputstring A string which serves as the input stream for the executed command. This attribute is mutually exclusive with the input attribute. -No +No; default is to take standard input from console +(unless spawn="true") newenvironment @@ -353,4 +354,3 @@ - 1.97 +8 -6 ant/src/main/org/apache/tools/ant/taskdefs/Java.java Index: Java.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v retrieving revision 1.96 retrieving revision 1.97 diff -u -r1.96 -r1.97 --- Java.java 22 Nov 2004 09:23:27 - 1.96 +++ Java.java 27 Jan 2005 16:36:11 - 1.97 @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 The Apache Software Foundation + * Copyright 2000-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ import org.apache.tools.ant.types.RedirectorElement; import org.apache.tools.ant.taskdefs.condition.Os; import org.apache.tools.ant.util.JavaEnvUtils; +import org.apache.tools.ant.util.KeepAliveInputStream; /** * Launcher for Java applications. Allows use of @@ -639,11 +640,8 @@ */ public int handleInput(byte[] buffer, int offset, int length) throws IOException { -if (redirector.getInputStream() != null) { -return redirector.handleInput(buffer, offset, length); -} else { -return super.handleInput(buffer, offset, length); -} +// Should work whether or not redirector.inputStream == null: +return redirector.handleInput(buffer, offset, length); } /** @@ -702,6 +700,10 @@ if (redirectorElement != null) { redirectorElement.configure(redirector); } +if (!spawn && input == null && inputString == null) { +// #24918: send standard input to the process by default. +redirector.setInputStream(new KeepAliveInputStream(getProject().getDefaultInputStream())); +} } /** 1.21 +20 -10 ant/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java Index: PumpStreamHandler.java === RC
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Java.java PumpStreamHandler.java Redirector.java StreamPumper.java
jglick 2005/03/16 08:52:27 Modified:.Tag: ANT_16_BRANCH WHATSNEW docs/manual/CoreTasks Tag: ANT_16_BRANCH java.html src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH Java.java PumpStreamHandler.java Redirector.java StreamPumper.java Log: Merging console input fix to Ant 1.6.3. PR: 24918 Revision ChangesPath No revision No revision 1.503.2.200 +4 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.199 retrieving revision 1.503.2.200 diff -u -r1.503.2.199 -r1.503.2.200 --- WHATSNEW 15 Mar 2005 20:57:30 - 1.503.2.199 +++ WHATSNEW 16 Mar 2005 16:52:25 - 1.503.2.200 @@ -129,6 +129,10 @@ Fixed bugs: --- +* Programs run with can now accept standard input + from the Ant console. (Programs run with could + already do so.) Bugzilla 24918. + * AbstractCvsTask prematurely closed its outputStream and errorStream. Bugzilla 30097. No revision No revision 1.24.2.12 +7 -7 ant/docs/manual/CoreTasks/java.html Index: java.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/java.html,v retrieving revision 1.24.2.11 retrieving revision 1.24.2.12 diff -u -r1.24.2.11 -r1.24.2.12 --- java.html 10 Mar 2005 13:07:43 - 1.24.2.11 +++ java.html 16 Mar 2005 16:52:26 - 1.24.2.12 @@ -16,10 +16,9 @@ If odd things go wrong when you run this task, set fork="true" to use a new JVM. -Note that you cannot interact with a forked VM, the only way to -send input to it is via the input and inputstring attributes. Also note that -in Ant 1.6, any attempt to read input in the forked VM will receive an -EOF (-1). This is a change from Ant 1.5, where such an attempt would block. +As of Ant 1.6.3, you can interact with a forked VM, as well as +sending input to it via the input and inputstring +attributes. Parameters @@ -156,14 +155,16 @@ A file from which the executed command's standard input is taken. This attribute is mutually exclusive with the inputstring attribute -No +No; default is to take standard input from console +(unless spawn="true") inputstring A string which serves as the input stream for the executed command. This attribute is mutually exclusive with the input attribute. -No +No; default is to take standard input from console +(unless spawn="true") newenvironment @@ -314,4 +315,3 @@ - No revision No revision 1.77.2.12 +8 -6 ant/src/main/org/apache/tools/ant/taskdefs/Java.java Index: Java.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v retrieving revision 1.77.2.11 retrieving revision 1.77.2.12 diff -u -r1.77.2.11 -r1.77.2.12 --- Java.java 23 Jun 2004 19:17:12 - 1.77.2.11 +++ Java.java 16 Mar 2005 16:52:27 - 1.77.2.12 @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 The Apache Software Foundation + * Copyright 2000-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import org.apache.tools.ant.types.Assertions; import org.apache.tools.ant.types.Permissions; import org.apache.tools.ant.types.RedirectorElement; +import org.apache.tools.ant.util.KeepAliveInputStream; /** * Launcher for Java applications. Allows use of @@ -624,11 +625,8 @@ */ public int handleInput(byte[] buffer, int offset, int length) throws IOException { -if (redirector.getInputStream() != null) { -return redirector.handleInput(buffer, offset, length); -} else { -return super.handleInput(buffer, offset, length); -} +// Should work whether or not redirector.inputStream == null: +return redirector.handleInput(buffer, offset, length); } /** @@ -687,6 +685,10 @@ if (redirectorElement != null) { redirectorElement.configure(redirector); } +if (!spawn && input == null && inputString == null) { +// #24918: send standard input to the process by default. +redirector.setInputStream
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs PumpStreamHandler.java Redirector.java StreamPumper.java
jglick 2005/03/16 08:56:03 Modified:.WHATSNEW docs/manual/CoreTasks java.html src/main/org/apache/tools/ant/taskdefs PumpStreamHandler.java Redirector.java StreamPumper.java Log: Backdating "since" notices for #24918 (console input for ): 1.7 -> 1.6.3. Revision ChangesPath 1.781 +4 -4 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.780 retrieving revision 1.781 diff -u -r1.780 -r1.781 --- WHATSNEW 15 Mar 2005 13:35:28 - 1.780 +++ WHATSNEW 16 Mar 2005 16:56:03 - 1.781 @@ -36,10 +36,6 @@ Fixed bugs: --- -* Programs run with can now accept standard input - from the Ant console. (Programs run with could - already do so.) Bugzilla Report 24918. - * Translate task does not remove tokens when a key is not found. It logs a verbose message. Bugzilla Report 13936. @@ -283,6 +279,10 @@ Fixed bugs: --- +* Programs run with can now accept standard input + from the Ant console. (Programs run with could + already do so.) Bugzilla 24918. + * AbstractCvsTask prematurely closed its outputStream and errorStream. Bugzilla 30097. 1.40 +1 -1 ant/docs/manual/CoreTasks/java.html Index: java.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/java.html,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- java.html 14 Mar 2005 20:09:54 - 1.39 +++ java.html 16 Mar 2005 16:56:03 - 1.40 @@ -16,7 +16,7 @@ If odd things go wrong when you run this task, set fork="true" to use a new JVM. -As of Ant 1.7, you can interact with a forked VM, as well as +As of Ant 1.6.3, you can interact with a forked VM, as well as sending input to it via the input and inputstring attributes. 1.23 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java Index: PumpStreamHandler.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- PumpStreamHandler.java28 Jan 2005 11:22:12 - 1.22 +++ PumpStreamHandler.java16 Mar 2005 16:56:03 - 1.23 @@ -219,7 +219,7 @@ /** * Creates a stream pumper to copy the given input stream to the * given output stream. Used for standard input. - * @since Ant 1.7 + * @since Ant 1.6.3 */ /*protected*/ StreamPumper createInputPump(InputStream is, OutputStream os, boolean closeWhenExhausted) { 1.27 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/Redirector.java Index: Redirector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Redirector.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- Redirector.java 10 Feb 2005 22:32:20 - 1.26 +++ Redirector.java 16 Mar 2005 16:56:03 - 1.27 @@ -231,7 +231,7 @@ * Set a stream to use as input. * * @param inputStream the stream from which input will be read - * @since Ant 1.7 + * @since Ant 1.6.3 */ /*public*/ void setInputStream(InputStream inputStream) { this.inputStream = inputStream; 1.23 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java Index: StreamPumper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/StreamPumper.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- StreamPumper.java 28 Jan 2005 10:15:34 - 1.22 +++ StreamPumper.java 16 Mar 2005 16:56:03 - 1.23 @@ -66,7 +66,7 @@ /** * Set whether data should be flushed through to the output stream. * @param autoflush if true, push through data; if false, let it be buffered - * @since Ant 1.7 + * @since Ant 1.6.3 */ /*public*/ void setAutoflush(boolean autoflush) { this.autoflush = autoflush; @@ -134,7 +134,7 @@ * Note that it may continue to block on the input stream * but it will really stop the thread as soon as it gets EOF * or any byte, and it will be marked as finished. - * @since Ant 1.7 + * @since Ant 1.6.3 */ /*public*/ synchronized void stop() {
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Execute.java
jglick 2005/03/28 13:42:13 Modified:.Tag: ANT_16_BRANCH WHATSNEW src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH Execute.java Log: Stop a forked process if the thread running is stopped. [merge] PR: 31928 Revision ChangesPath No revision No revision 1.503.2.209 +3 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.208 retrieving revision 1.503.2.209 diff -u -r1.503.2.208 -r1.503.2.209 --- WHATSNEW 25 Mar 2005 12:29:22 - 1.503.2.208 +++ WHATSNEW 28 Mar 2005 21:42:13 - 1.503.2.209 @@ -141,6 +141,9 @@ Fixed bugs: --- +* Killing a thread running (e.g. from an IDE) would + not stop the forked process. Bugzilla 31928. + * Programs run with can now accept standard input from the Ant console. (Programs run with could already do so.) Bugzilla 24918. No revision No revision 1.68.2.11 +4 -0 ant/src/main/org/apache/tools/ant/taskdefs/Execute.java Index: Execute.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v retrieving revision 1.68.2.10 retrieving revision 1.68.2.11 diff -u -r1.68.2.10 -r1.68.2.11 --- Execute.java 9 Mar 2005 18:56:25 - 1.68.2.10 +++ Execute.java 28 Mar 2005 21:42:13 - 1.68.2.11 @@ -480,6 +480,10 @@ watchdog.checkException(); } return getExitValue(); +} catch (ThreadDeath t) { +// #31928: forcibly kill it before continuing. +process.destroy(); +throw t; } finally { // remove the process to the list of those to destroy if the VM exits // - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Execute.java
jglick 2005/03/28 13:43:18 Modified:.WHATSNEW src/main/org/apache/tools/ant/taskdefs Execute.java Log: #31928: stop a forked process if the thread running is stopped. Revision ChangesPath 1.795 +3 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.794 retrieving revision 1.795 diff -u -r1.794 -r1.795 --- WHATSNEW 25 Mar 2005 12:28:59 - 1.794 +++ WHATSNEW 28 Mar 2005 21:43:18 - 1.795 @@ -317,6 +317,9 @@ Fixed bugs: --- +* Killing a thread running (e.g. from an IDE) would + not stop the forked process. Bugzilla 31928. + * Programs run with can now accept standard input from the Ant console. (Programs run with could already do so.) Bugzilla 24918. 1.94 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/Execute.java Index: Execute.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- Execute.java 10 Mar 2005 12:50:57 - 1.93 +++ Execute.java 28 Mar 2005 21:43:18 - 1.94 @@ -27,11 +27,8 @@ import java.io.StringReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; -import java.util.Map; -import java.util.Set; import java.util.Vector; import org.apache.tools.ant.BuildException; @@ -40,7 +37,6 @@ import org.apache.tools.ant.taskdefs.condition.Os; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.util.FileUtils; -import org.apache.tools.ant.util.JavaEnvUtils; /** * Runs an external program. @@ -485,6 +481,10 @@ watchdog.checkException(); } return getExitValue(); +} catch (ThreadDeath t) { +// #31928: forcibly kill it before continuing. +process.destroy(); +throw t; } finally { // remove the process to the list of those to destroy if // the VM exits - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/util ReferencesTest.java
jglick 2005/03/28 14:42:09 Modified:src/main/org/apache/tools/ant/util WeakishReference.java src/main/org/apache/tools/ant/util/optional WeakishReference12.java Removed: src/testcases/org/apache/tools/ant/util ReferencesTest.java Log: #32463: deprecate WeakishReference since we can assume JDK 1.2 APIs now. Revision ChangesPath 1.19 +2 -1 ant/src/main/org/apache/tools/ant/util/WeakishReference.java Index: WeakishReference.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/WeakishReference.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- WeakishReference.java 21 Jan 2005 17:29:46 - 1.18 +++ WeakishReference.java 28 Mar 2005 22:42:09 - 1.19 @@ -23,6 +23,7 @@ * This is a weak reference on java1.2 and up, that is all * platforms Ant1.6 supports. * @since ant1.6 + * @deprecated Just use [EMAIL PROTECTED] java.lang.ref.WeakReference} directly. */ public abstract class WeakishReference { @@ -46,7 +47,7 @@ /** * A hard reference for Java 1.1. - * Hopefully nobody is using this. + * @deprecated Hopefully nobody is using this. */ public static class HardReference extends WeakishReference { private Object object; 1.9 +1 -1 ant/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java Index: WeakishReference12.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/optional/WeakishReference12.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- WeakishReference12.java 9 Mar 2004 16:48:54 - 1.8 +++ WeakishReference12.java 28 Mar 2005 22:42:09 - 1.9 @@ -24,7 +24,7 @@ /** * This is a reference that really is is Weak, as it uses the * appropriate java.lang.ref class. - * + * @deprecated Just use [EMAIL PROTECTED] WeakReference} directly. */ public class WeakishReference12 extends WeakishReference { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/optional XsltTest.java
jglick 2005/03/28 15:22:12 Modified:.WHATSNEW docs/manual coretasklist.html tasksoverview.html docs/manual/CoreTasks style.html docs/manual/OptionalTasks dotnet.html src/etc/testcases/taskdefs/optional xslt.xml src/etc/testcases/taskdefs/style build.xml src/main/org/apache/tools/ant/taskdefs DependSet.java Javadoc.java XSLTProcess.java defaults.properties src/main/org/apache/tools/ant/taskdefs/optional/dotnet WsdlToDotnet.java src/testcases/org/apache/tools/ant/taskdefs StyleTest.java src/testcases/org/apache/tools/ant/taskdefs/optional XsltTest.java Log: #25832: deprecating the task names and . Revision ChangesPath 1.796 +3 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.795 retrieving revision 1.796 diff -u -r1.795 -r1.796 --- WHATSNEW 28 Mar 2005 21:43:18 - 1.795 +++ WHATSNEW 28 Mar 2005 23:22:10 - 1.796 @@ -79,6 +79,9 @@ Other changes: -- +* <WsdlToDotnet> and <style> are now deprecated in favor of <wsdltodotnet> and + <xslt>, respectively. Bugzilla report 25832. + * <echoproperties> now (alphanumerically) sorts the property list before echoing. Bugzilla report 18976. 1.59 +1 -2 ant/docs/manual/coretasklist.html Index: coretasklist.html === RCS file: /home/cvs/ant/docs/manual/coretasklist.html,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- coretasklist.html 7 Mar 2005 18:38:26 - 1.58 +++ coretasklist.html 28 Mar 2005 23:22:11 - 1.59 @@ -84,7 +84,6 @@ <a href="CoreTasks/signjar.html">SignJar</a><br> <a href="CoreTasks/sleep.html">Sleep</a><br> <a href="CoreTasks/sql.html">Sql</a><br> -<a href="CoreTasks/style.html">Style</a><br> <a href="CoreTasks/subant.html">Subant</a><br> <a href="CoreTasks/sync.html">Sync</a><br> <a href="CoreTasks/tar.html">Tar</a><br> @@ -102,7 +101,7 @@ <a href="CoreTasks/whichresource.html">WhichResource</a><br> <a href="CoreTasks/war.html">War</a><br> <a href="CoreTasks/xmlproperty.html">XmlProperty</a><br> -<a href="CoreTasks/style.html">Xslt</a><br> +<a href="CoreTasks/style.html">XSLT/<i>Style</i></a><br> <a href="CoreTasks/zip.html">Zip</a><br> </body> </html> 1.30 +1 -1 ant/docs/manual/tasksoverview.html Index: tasksoverview.html === RCS file: /home/cvs/ant/docs/manual/tasksoverview.html,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- tasksoverview.html7 Mar 2005 18:38:26 - 1.29 +++ tasksoverview.html28 Mar 2005 23:22:11 - 1.30 @@ -946,7 +946,7 @@ </tr> <tr valign="top"> -<td nowrap><a href="CoreTasks/style.html">Xslt/Style</a></td> +<td nowrap><a href="CoreTasks/style.html">XSLT</a></td> <td><p>Processes a set of documents via XSLT.</p></td> </tr> 1.38 +3 -2 ant/docs/manual/CoreTasks/style.html Index: style.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/style.html,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- style.html15 Mar 2005 16:12:44 - 1.37 +++ style.html28 Mar 2005 23:22:11 - 1.38 @@ -3,12 +3,13 @@ <head> <meta http-equiv="Content-Language" content="en-us"> <link rel="stylesheet" type="text/css" href="../stylesheets/style.css"/> -<title>Xslt/Style Task</title> +<title>XSLT Task</title> </head> <body> -<h2><a name="style">Xslt/Style</a></h2> +<h2><a name="style">XSLT</a></h2> +<p><em>The name <code>style</code> is a deprecated name for the same task.</em></p> <h3>Desc
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Javadoc.java
jglick 2005/03/29 10:23:47 Modified:.WHATSNEW docs/manual/CoreTasks javadoc.html src/main/org/apache/tools/ant/taskdefs Javadoc.java Log: #30606: add 'executable' attr to . Revision ChangesPath 1.797 +2 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.796 retrieving revision 1.797 diff -u -r1.796 -r1.797 --- WHATSNEW 28 Mar 2005 23:22:10 - 1.796 +++ WHATSNEW 29 Mar 2005 18:23:46 - 1.797 @@ -79,6 +79,8 @@ Other changes: -- +* can now take an attribute 'executable'. Bugzilla report 30606. + * and
cvs commit: ant/src/etc/testcases/taskdefs/optional/unix .cvsignore
jglick 2005/03/29 10:27:37 Added: src/etc/testcases/taskdefs/optional/unix .cvsignore Log: Ignore stray dir that can be left behind after an interrupted test. Revision ChangesPath 1.1 ant/src/etc/testcases/taskdefs/optional/unix/.cvsignore Index: .cvsignore === test-working - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/etc/testcases/taskdefs input.xml
jglick 2005/03/29 10:35:46 Modified:src/testcases/org/apache/tools/ant/util JavaEnvUtilsTest.java src/testcases/org/apache/tools/ant/types/selectors PresentSelectorTest.java DependSelectorTest.java DateSelectorTest.java src/testcases/org/apache/tools/ant/taskdefs/optional/net FTPTest.java src/testcases/org/apache/tools/ant/taskdefs ProcessDestroyerTest.java JavacTest.java InputTest.java ExecuteWatchdogTest.java ExecuteJavaTest.java CopyTest.java src/testcases/org/apache/tools/ant ProjectTest.java src/main/org/apache/tools/ant/util JavaEnvUtils.java src/main/org/apache/tools/ant/types Path.java src/main/org/apache/tools/ant/taskdefs/optional/sitraka Coverage.java src/main/org/apache/tools/ant/taskdefs/optional/javah SunJavah.java src/main/org/apache/tools/ant/taskdefs/compilers DefaultCompilerAdapter.java CompilerAdapterFactory.java src/etc/testcases/taskdefs input.xml Log: Removing old code testing for JDK 1.0 and 1.1. Revision ChangesPath 1.11 +3 -12 ant/src/testcases/org/apache/tools/ant/util/JavaEnvUtilsTest.java Index: JavaEnvUtilsTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/util/JavaEnvUtilsTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JavaEnvUtilsTest.java 6 Jan 2005 12:05:07 - 1.10 +++ JavaEnvUtilsTest.java 29 Mar 2005 18:35:45 - 1.11 @@ -69,15 +69,8 @@ FILE_UTILS.normalize(javaHome+"/..").getAbsolutePath(); assertTrue(j+" is normalized and in the JDK dir", j.startsWith(javaHomeParent)); - -if (JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_0 || -JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_1) { -assertTrue(j+" is normalized and in the JRE dir", - j.startsWith(javaHome)); -} else { -assertTrue(j+" is normalized and not in the JRE dir", - !j.startsWith(javaHome)); -} +assertTrue(j+" is normalized and not in the JRE dir", + !j.startsWith(javaHome)); } catch (AssertionFailedError e) { // java.home is bogus @@ -117,9 +110,7 @@ assertTrue(j+" is normalized and in the JDK dir", j.startsWith(javaHomeParent)); -if (JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_0 || -JavaEnvUtils.getJavaVersion() == JavaEnvUtils.JAVA_1_1 || -Os.isFamily("mac")) { +if (Os.isFamily("mac")) { assertTrue(j+" is normalized and in the JRE dir", j.startsWith(javaHome)); } else { 1.10 +1 -12 ant/src/testcases/org/apache/tools/ant/types/selectors/PresentSelectorTest.java Index: PresentSelectorTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/selectors/PresentSelectorTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- PresentSelectorTest.java 7 Dec 2004 09:10:38 - 1.9 +++ PresentSelectorTest.java 29 Mar 2005 18:35:45 - 1.10 @@ -19,17 +19,10 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; -import org.apache.tools.ant.util.*; -import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.types.Mapper; -import org.apache.tools.ant.util.FileNameMapper; -import org.apache.tools.ant.util.IdentityMapper; -import org.apache.tools.ant.util.GlobPatternMapper; import java.io.File; -import junit.framework.TestCase; -import junit.framework.AssertionFailedError; /** * Tests Present Selectors @@ -113,11 +106,7 @@ m = s.createMapper(); m.setType(flatten); results = selectionString(s); -if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { -assertEquals("TFFF", results); -} else { -assertEquals("TTTF", results); -} +assertEquals("TTTF"
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs/optional/junit JUnitTestListenerTest.java
jglick 2005/03/29 11:19:04 Modified:src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java JUnitTestRunner.java Added: src/testcases/org/apache/tools/ant/taskdefs/optional/junit JUnitTestListenerTest.java Log: #31885: logs more detailed events for individual tests it is running. Revision ChangesPath 1.116 +47 -9 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Index: JUnitTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v retrieving revision 1.115 retrieving revision 1.116 diff -u -r1.115 -r1.116 --- JUnitTask.java24 Mar 2005 08:35:49 - 1.115 +++ JUnitTask.java29 Mar 2005 19:19:04 - 1.116 @@ -34,6 +34,9 @@ import java.util.Map; import java.util.Properties; import java.util.Vector; +import junit.framework.AssertionFailedError; +import junit.framework.Test; +import junit.framework.TestResult; import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; @@ -41,7 +44,6 @@ import org.apache.tools.ant.taskdefs.Execute; import org.apache.tools.ant.taskdefs.ExecuteWatchdog; import org.apache.tools.ant.taskdefs.LogOutputStream; -import org.apache.tools.ant.taskdefs.LogStreamHandler; import org.apache.tools.ant.types.Assertions; import org.apache.tools.ant.types.Commandline; import org.apache.tools.ant.types.CommandlineJava; @@ -52,9 +54,7 @@ import org.apache.tools.ant.types.PropertySet; import org.apache.tools.ant.util.FileUtils; import org.apache.tools.ant.util.LoaderUtils; -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestResult; +import org.apache.tools.ant.taskdefs.PumpStreamHandler; /** * Runs JUnit tests. @@ -149,6 +149,11 @@ private ForkMode forkMode = new ForkMode("perTest"); private static final int STRING_BUFFER_SIZE = 128; +/** + * @since Ant 1.7 + */ +public static final String TESTLISTENER_PREFIX = +"junit.framework.TestListener: "; private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); @@ -829,6 +834,7 @@ cmd.createArgument().setValue("showoutput=" + String.valueOf(showOutput)); +cmd.createArgument().setValue("logtestlistenerevents=true"); // #31885 StringBuffer formatterArg = new StringBuffer(STRING_BUFFER_SIZE); final FormatterElement[] feArray = mergeFormatters(test); @@ -871,9 +877,9 @@ + "file.", e, getLocation()); } -Execute execute = new Execute(new LogStreamHandler(this, - Project.MSG_INFO, - Project.MSG_WARN), +Execute execute = new Execute(new JUnitLogStreamHandler(this, + Project.MSG_INFO, + Project.MSG_WARN), watchdog); execute.setCommandline(cmd.getCommandline()); execute.setAntRun(getProject()); @@ -941,7 +947,9 @@ * @since Ant 1.5 */ protected void handleOutput(String output) { -if (runner != null) { +if (output.startsWith(TESTLISTENER_PREFIX)) +log(output, Project.MSG_VERBOSE); +else if (runner != null) { runner.handleOutput(output); if (showOutput) { super.handleOutput(output); @@ -1063,7 +1071,8 @@ } runner = new JUnitTestRunner(test, test.getHaltonerror(), test.getFiltertrace(), - test.getHaltonfailure(), classLoader); + test.getHaltonfailure(), false, + true, classLoader); if (summary) { log("Running " + test.getName(), Project.MSG_INFO); @@ -1549,4 +1558,33 @@ public boolean timedOut = false; public boolean crashed = false; } + +/** + * @since Ant 1.7 + */ +protected static class JUnitLogOutputStream extends LogOutputStream { +private Task task; // local copy since LogOutputStream.task is private + +public JUnitLogOutputStream(Task task, int level) { +super(task, level); +this.task = task; +}
cvs commit: ant CONTRIBUTORS
jglick 2005/03/29 11:43:50 Modified:.CONTRIBUTORS Log: Mentioning Tom Ball, author of #31885. Revision ChangesPath 1.49 +1 -0 ant/CONTRIBUTORS Index: CONTRIBUTORS === RCS file: /home/cvs/ant/CONTRIBUTORS,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- CONTRIBUTORS 21 Mar 2005 13:52:45 - 1.48 +++ CONTRIBUTORS 29 Mar 2005 19:43:50 - 1.49 @@ -213,6 +213,7 @@ Tim Fennell Timothy Gerard Endres Tim Stephenson +Tom Ball Tom Dimock Tom Eugelink Ulrich Schmidt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/loader AntClassLoader2.java
jglick 2005/03/29 11:56:15 Modified:src/main/org/apache/tools/ant AntClassLoader.java Project.java src/main/org/apache/tools/ant/loader AntClassLoader2.java Log: #27285: simplify AntClassLoader by removing reflection hacks (and separate ACL2) only needed for JDK 1.1 support. Revision ChangesPath 1.93 +226 -59 ant/src/main/org/apache/tools/ant/AntClassLoader.java Index: AntClassLoader.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/AntClassLoader.java,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- AntClassLoader.java 14 Mar 2005 09:19:27 - 1.92 +++ AntClassLoader.java 29 Mar 2005 19:56:15 - 1.93 @@ -14,6 +14,7 @@ * limitations under the License. * */ + package org.apache.tools.ant; import java.io.ByteArrayOutputStream; @@ -21,14 +22,22 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; +import java.util.Collections; import java.util.Enumeration; +import java.util.HashMap; import java.util.Hashtable; +import java.util.Map; +import java.util.StringTokenizer; import java.util.Vector; +import java.util.jar.Attributes; +import java.util.jar.Attributes.Name; +import java.util.jar.JarFile; +import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.apache.tools.ant.types.Path; @@ -192,6 +201,9 @@ */ private Hashtable zipFiles = new Hashtable(); +/** Static map of jar file/time to manifiest class-path entries */ +private static Map/**/ pathMap = Collections.synchronizedMap(new HashMap()); + /** * The context loader saved when setting the thread's current * context loader. @@ -203,36 +215,6 @@ private boolean isContextLoaderSaved = false; /** - * Reflection method reference for getProtectionDomain; - * used to avoid 1.1-compatibility problems. - */ -private static Method getProtectionDomain = null; - -/** - * Reflection method reference for defineClassProtectionDomain; - * used to avoid 1.1-compatibility problems. - */ -private static Method defineClassProtectionDomain = null; - - -// Set up the reflection-based Java2 methods if possible -static { -try { -getProtectionDomain -= Class.class.getMethod("getProtectionDomain", new Class[0]); -Class protectionDomain -= Class.forName("java.security.ProtectionDomain"); -Class[] args = new Class[] {String.class, byte[].class, -Integer.TYPE, Integer.TYPE, protectionDomain}; -defineClassProtectionDomain -= ClassLoader.class.getDeclaredMethod("defineClass", args); -} catch (Exception e) { -// ignore failure to get access to 1.2+ methods -} -} - - -/** * Create an Ant Class Loader */ public AntClassLoader() { @@ -452,7 +434,9 @@ } /** - * Add a file to the path + * Add a file to the path. + * Reads the manifest, if available, and adds any additional class path jars + * specified in the manifest. * * @param pathComponent the file which is to be added to the path for * this class loader @@ -461,6 +445,66 @@ */ protected void addPathFile(File pathComponent) throws IOException { pathComponents.addElement(pathComponent); +if (pathComponent.isDirectory()) { +return; +} + +String absPathPlusTimeAndLength = +pathComponent.getAbsolutePath() + pathComponent.lastModified() + "-" ++ pathComponent.length(); +String classpath = (String) pathMap.get(absPathPlusTimeAndLength); +if (classpath == null) { +ZipFile jarFile = null; +InputStream manifestStream = null; +try { +jarFile = new ZipFile(pathComponent); +manifestStream += jarFile.getInputStream(new ZipEntry("META-INF/MANIFEST.MF")); + +if (manifestStream == null) { +return; +} +Reader manifestReader += new InputStreamReader(manifestStream, "UTF-8");
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteJava.java
jglick 2005/03/29 12:39:00 Modified:src/main/org/apache/tools/ant/taskdefs ExecuteJava.java Log: #32941: do not try to catch ThreadDeath when is halted. Revision ChangesPath 1.50 +4 -0 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java Index: ExecuteJava.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- ExecuteJava.java 11 Mar 2005 14:56:48 - 1.49 +++ ExecuteJava.java 29 Mar 2005 20:39:00 - 1.50 @@ -146,6 +146,7 @@ thread = new Thread(this, "ExecuteJava"); Task currentThreadTask = project.getThreadTask(Thread.currentThread()); +// XXX is the following really necessary? it is in the same thread group... project.registerThreadTask(thread, currentThreadTask); // if we run into a timeout, the run-away thread shall not // make the VM run forever - if no timeout occurs, Ant's @@ -180,6 +181,9 @@ + " classpath"); } catch (SecurityException e) { throw e; +} catch (ThreadDeath e) { +// XXX could perhaps also call thread.stop(); not sure if anyone cares +throw e; } catch (Throwable e) { throw new BuildException(e); } finally { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteJava.java
jglick 2005/03/29 12:40:01 Modified:src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH ExecuteJava.java Log: Merge of #32941: do not catch ThreadDeath when is halted. Revision ChangesPath No revision No revision 1.38.2.7 +2 -0 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java Index: ExecuteJava.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java,v retrieving revision 1.38.2.6 retrieving revision 1.38.2.7 diff -u -r1.38.2.6 -r1.38.2.7 --- ExecuteJava.java 4 Feb 2005 08:13:46 - 1.38.2.6 +++ ExecuteJava.java 29 Mar 2005 20:40:01 - 1.38.2.7 @@ -172,6 +172,8 @@ + " classpath"); } catch (SecurityException e) { throw e; +} catch (ThreadDeath e) { +throw e; } catch (Throwable e) { throw new BuildException(e); } finally { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant Project.java
jglick 2005/03/29 13:46:36 Modified:src/main/org/apache/tools/ant Project.java Log: Avoid hypothetical memory leak by not holding a strong reference to the thread or thread groups used as keys to report task associations. Revision ChangesPath 1.190 +7 -4 ant/src/main/org/apache/tools/ant/Project.java Index: Project.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.189 retrieving revision 1.190 diff -u -r1.189 -r1.190 --- Project.java 29 Mar 2005 19:56:15 - 1.189 +++ Project.java 29 Mar 2005 21:46:36 - 1.190 @@ -23,6 +23,7 @@ import java.io.InputStream; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.util.Collections; import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; @@ -31,6 +32,8 @@ import java.util.Vector; import java.util.Set; import java.util.HashSet; +import java.util.Map; +import java.util.WeakHashMap; import org.apache.tools.ant.input.DefaultInputHandler; import org.apache.tools.ant.input.InputHandler; import org.apache.tools.ant.helper.DefaultExecutor; @@ -157,11 +160,11 @@ */ private ClassLoader coreLoader = null; -/** Records the latest task to be executed on a thread (Thread to Task). */ -private Hashtable threadTasks = new Hashtable(); +/** Records the latest task to be executed on a thread. */ +private Map/**/ threadTasks = Collections.synchronizedMap(new WeakHashMap()); -/** Records the latest task to be executed on a thread Group. */ -private Hashtable threadGroupTasks = new Hashtable(); +/** Records the latest task to be executed on a thread group. */ +private Map/**/ threadGroupTasks = Collections.synchronizedMap(new WeakHashMap()); /** * Called to handle any input requests. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs AntStructure.java
jglick 2005/03/29 13:47:59 Modified:src/main/org/apache/tools/ant IntrospectionHelper.java ProjectHelper.java UnknownElement.java src/main/org/apache/tools/ant/helper ProjectHelperImpl.java src/main/org/apache/tools/ant/taskdefs AntStructure.java Log: #30162: try to avoid a memory leak in IntrospectionHelper.getHelper(). Revision ChangesPath 1.94 +14 -9 ant/src/main/org/apache/tools/ant/IntrospectionHelper.java Index: IntrospectionHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- IntrospectionHelper.java 16 Dec 2004 21:11:19 - 1.93 +++ IntrospectionHelper.java 29 Mar 2005 21:47:59 - 1.94 @@ -310,12 +310,7 @@ * @return a helper for the specified class */ public static synchronized IntrospectionHelper getHelper(Class c) { -IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c); -if (ih == null) { -ih = new IntrospectionHelper(c); -helpers.put(c, ih); -} -return ih; +return getHelper(null, c); } /** @@ -332,9 +327,19 @@ * @return a helper for the specified class */ public static IntrospectionHelper getHelper(Project p, Class c) { -IntrospectionHelper ih = getHelper(c); -// Cleanup at end of project -p.addBuildListener(ih); +IntrospectionHelper ih = (IntrospectionHelper) helpers.get(c); +if (ih == null) { +ih = new IntrospectionHelper(c); +if (p != null) { +// #30162: do *not* cache this if there is no project, as we +// cannot guarantee that the cache will be cleared. +helpers.put(c, ih); +} +} +if (p != null) { +// Cleanup at end of project +p.addBuildListener(ih); +} return ih; } 1.115 +3 -5 ant/src/main/org/apache/tools/ant/ProjectHelper.java Index: ProjectHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ProjectHelper.java,v retrieving revision 1.114 retrieving revision 1.115 diff -u -r1.114 -r1.115 --- ProjectHelper.java13 Dec 2004 16:43:51 - 1.114 +++ ProjectHelper.java29 Mar 2005 21:47:59 - 1.115 @@ -304,9 +304,7 @@ } IntrospectionHelper ih = -IntrospectionHelper.getHelper(target.getClass()); - -project.addBuildListener(ih); +IntrospectionHelper.getHelper(project, target.getClass()); for (int i = 0; i < attrs.getLength(); i++) { // reflect these into the target @@ -368,7 +366,7 @@ target = ((TypeAdapter) target).getProxy(); } -IntrospectionHelper.getHelper(target.getClass()).addText(project, +IntrospectionHelper.getHelper(project, target.getClass()).addText(project, target, text); } @@ -388,7 +386,7 @@ public static void storeChild(Project project, Object parent, Object child, String tag) { IntrospectionHelper ih -= IntrospectionHelper.getHelper(parent.getClass()); += IntrospectionHelper.getHelper(project, parent.getClass()); ih.storeElement(project, parent, child, tag); } 1.88 +1 -1 ant/src/main/org/apache/tools/ant/UnknownElement.java Index: UnknownElement.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- UnknownElement.java 3 Mar 2005 14:02:32 - 1.87 +++ UnknownElement.java 29 Mar 2005 21:47:59 - 1.88 @@ -320,7 +320,7 @@ String parentUri = getNamespace(); Class parentClass = parent.getClass(); -IntrospectionHelper ih = IntrospectionHelper.getHelper(parentClass); +IntrospectionHelper ih = IntrospectionHelper.getHelper(getProject(), parentClass); if (children != null) { 1.30 +1 -1 ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java Index: ProjectHelperImpl.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- ProjectHelperImpl.java6 Jan 2005 12:05:09 - 1
cvs commit: ant WHATSNEW
jglick 2005/03/29 13:48:36 Modified:.WHATSNEW Log: Updated from recent commits. Revision ChangesPath 1.798 +8 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.797 retrieving revision 1.798 diff -u -r1.797 -r1.798 --- WHATSNEW 29 Mar 2005 18:23:46 - 1.797 +++ WHATSNEW 29 Mar 2005 21:48:36 - 1.798 @@ -48,6 +48,9 @@ Fixed bugs: --- +* Memory leak from IntrospectionHelper.getHelper(Class) in embedded + environments. Bugzilla Report 30162. + * Translate task does not remove tokens when a key is not found. It logs a verbose message. Bugzilla Report 13936. @@ -79,6 +82,8 @@ Other changes: -- +* Log fine-grained events at verbose level from JUnit. Bugzilla report 31885. + * can now take an attribute 'executable'. Bugzilla report 30606. * and
cvs commit: ant WHATSNEW
jglick 2005/03/29 13:49:03 Modified:.Tag: ANT_16_BRANCH WHATSNEW Log: Updated from recent commits. Revision ChangesPath No revision No revision 1.503.2.210 +3 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.209 retrieving revision 1.503.2.210 diff -u -r1.503.2.209 -r1.503.2.210 --- WHATSNEW 28 Mar 2005 21:42:13 - 1.503.2.209 +++ WHATSNEW 29 Mar 2005 21:49:02 - 1.503.2.210 @@ -141,6 +141,9 @@ Fixed bugs: --- +* Do not pass on ThreadDeath when halting . Bugzilla + 32941. + * Killing a thread running (e.g. from an IDE) would not stop the forked process. Bugzilla 31928. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Javadoc.java
jglick 2005/03/30 08:56:19 Modified:.Tag: ANT_16_BRANCH WHATSNEW docs/manual/CoreTasks Tag: ANT_16_BRANCH javadoc.html src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH Javadoc.java Log: Merge of #30606: 'executable' attr for . Revision ChangesPath No revision No revision 1.503.2.211 +2 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.210 retrieving revision 1.503.2.211 diff -u -r1.503.2.210 -r1.503.2.211 --- WHATSNEW 29 Mar 2005 21:49:02 - 1.503.2.210 +++ WHATSNEW 30 Mar 2005 16:56:18 - 1.503.2.211 @@ -28,6 +28,8 @@ Other changes: -- +* can now take an attribute 'executable'. Bugzilla report 30606. + * New attribute ignorecontents for selector * Javadoc fixes for Location, Project, and RuntimeConfigurable No revision No revision 1.26.2.7 +46 -36ant/docs/manual/CoreTasks/javadoc.html Index: javadoc.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/javadoc.html,v retrieving revision 1.26.2.6 retrieving revision 1.26.2.7 diff -u -r1.26.2.6 -r1.26.2.7 --- javadoc.html 17 Mar 2005 09:38:59 - 1.26.2.6 +++ javadoc.html 30 Mar 2005 16:56:19 - 1.26.2.7 @@ -19,16 +19,16 @@ "changed" files, unlike the javac task. This means all packages will be processed each time this task is run. In general, however, this task is used much less frequently. -This task works seamlessly between different javadoc versions (1.1, -1.2 and 1.4), with the obvious restriction that the 1.2 attributes -will be ignored if run in a 1.1 VM. +This task works seamlessly between different javadoc versions (1.2 and 1.4), +with the obvious restriction that the 1.4 attributes +will be ignored if run in a 1.2 VM. NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the -same VM as ant without breaking functionality. For this reason, this task +same VM as Ant without breaking functionality. For this reason, this task always forks the VM. This overhead is not significant since javadoc is normally a heavy application and will be called infrequently. NOTE: the packagelist attribute allows you to specify the list of packages to document outside of the Ant file. It's a much better practice to include everything -inside the build.xml file. This option was added in order to make it easier to +inside the build.xml file. This option was added in order to make it easier to migrate from regular makefiles, where you would use this option of javadoc. The packages listed in packagelist are not checked, so the task performs even if some packages are missing or broken. Use this option if you wish to convert from @@ -40,9 +40,11 @@ versions, you are strongly encouraged to use javadoc instead. -In the table below, 1.1 means available if your current Java VM is -a 1.1 VM, 1.2 for either 1.2 or 1.3 and 1.4+ for any VM of at least version 1.4. 1.2+ -means any VM of at least version 1.2. +In the table below, 1.2 means available if your current Java VM is +a 1.2 VM (but not 1.3 or later), 1.4+ for any VM of at least version 1.4, otherwise +any VM of at least version 1.2 is acceptable. JDK 1.1 is no longer supported. +If you specify the executable attribute it is up to you +to ensure that this command supports the attributes you wish to use. Parameters @@ -94,7 +96,7 @@ packageList The name of a file containing the packages to process -1.2+ +all No @@ -107,7 +109,7 @@ Bootclasspath Override location of class files loaded by the bootstrap class loader -1.2+ +all No @@ -122,19 +124,19 @@ Override location of class files loaded by the bootstrap class loader by reference to a PATH defined elsewhere. -1.2+ +all No Extdirs Override location of installed extensions -1.2+ +all No Overview Read overview documentation from HTML file -1.2+ +all No @@ -177,13 +179,13 @@ Verbose Output messages about what Javadoc is doing -1.2+ +all No Locale Locale to be used, e.g. en_US or en_US_WIN -1.2+ +all No @@ -201,7 +203,7 @@ Use Create class and package usage pages -1.2+ +all No @@ -213,44 +215,44 @@ Splitindex S
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Javadoc.java
jglick 2005/03/30 08:59:26 Modified:.WHATSNEW docs/manual/CoreTasks javadoc.html src/main/org/apache/tools/ant/taskdefs Javadoc.java Log: Misc. cleanups relating to #30606. Revision ChangesPath 1.799 +4 -4 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.798 retrieving revision 1.799 diff -u -r1.798 -r1.799 --- WHATSNEW 29 Mar 2005 21:48:36 - 1.798 +++ WHATSNEW 30 Mar 2005 16:59:26 - 1.799 @@ -84,8 +84,6 @@ * Log fine-grained events at verbose level from JUnit. Bugzilla report 31885. -* can now take an attribute 'executable'. Bugzilla report 30606. - * and
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java
jglick 2005/03/30 09:06:40 Modified:src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java Log: Fixed missing braces. Revision ChangesPath 1.117 +5 -4 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Index: JUnitTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v retrieving revision 1.116 retrieving revision 1.117 diff -u -r1.116 -r1.117 --- JUnitTask.java29 Mar 2005 19:19:04 - 1.116 +++ JUnitTask.java30 Mar 2005 17:06:39 - 1.117 @@ -1505,7 +1505,7 @@ /** * Logs information about failed tests, potentially stops * processing (by throwing a BuildException) if a failure/error - * occured or sets a property. + * occurred or sets a property. * * @since Ant 1.6.2 */ @@ -1520,7 +1520,7 @@ /** * Logs information about failed tests, potentially stops * processing (by throwing a BuildException) if a failure/error - * occured or sets a property. + * occurred or sets a property. * * @since Ant 1.7 */ @@ -1571,10 +1571,11 @@ } protected void processLine(String line, int level) { -if (line.startsWith(TESTLISTENER_PREFIX)) +if (line.startsWith(TESTLISTENER_PREFIX)) { task.log(line, Project.MSG_VERBOSE); -else +} else { super.processLine(line, level); +} } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks exec.html
jglick 2005/03/30 09:08:27 Modified:src/testcases/org/apache/tools/ant BuildFileTest.java src/main/org/apache/tools/ant/util Watchdog.java src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTestRunner.java docs/manual/CoreTypes selectors-program.html docs/manual/CoreTasks exec.html Log: s/occured/occurred/g wherever possible - unfortunately we included the spelling error in several public method signatures. Just like java.lang.Cloneable. :-( Revision ChangesPath 1.35 +3 -3 ant/src/testcases/org/apache/tools/ant/BuildFileTest.java Index: BuildFileTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/BuildFileTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- BuildFileTest.java9 Mar 2005 22:56:39 - 1.34 +++ BuildFileTest.java30 Mar 2005 17:08:26 - 1.35 @@ -431,7 +431,7 @@ /** * Fired after the last target has finished. This event - * will still be thrown if an error occured during the build. + * will still be thrown if an error occurred during the build. * * @see BuildEvent#getException() */ @@ -449,7 +449,7 @@ /** * Fired when a target has finished. This event will - * still be thrown if an error occured during the build. + * still be thrown if an error occurred during the build. * * @see BuildEvent#getException() */ @@ -468,7 +468,7 @@ /** * Fired when a task has finished. This event will still - * be throw if an error occured during the build. + * be throw if an error occurred during the build. * * @see BuildEvent#getException() */ 1.14 +1 -1 ant/src/main/org/apache/tools/ant/util/Watchdog.java Index: Watchdog.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/Watchdog.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Watchdog.java 21 Jan 2005 17:37:28 - 1.13 +++ Watchdog.java 30 Mar 2005 17:08:27 - 1.14 @@ -62,7 +62,7 @@ } /** - * Inform the observers that a timeout has occured. + * Inform the observers that a timeout has occurred. */ protected final void fireTimeoutOccured() { Enumeration e = observers.elements(); 1.58 +7 -7 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java Index: JUnitTestRunner.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- JUnitTestRunner.java 29 Mar 2005 19:19:04 - 1.57 +++ JUnitTestRunner.java 30 Mar 2005 17:08:27 - 1.58 @@ -593,8 +593,8 @@ new java.io.BufferedReader(new java.io.FileReader(args[0])); String testCaseName; int code = 0; -boolean errorOccured = false; -boolean failureOccured = false; +boolean errorOccurred = false; +boolean failureOccurred = false; String line = null; while ((line = reader.readLine()) != null) { StringTokenizer st = new StringTokenizer(line, ","); @@ -604,11 +604,11 @@ t.setOutfile(st.nextToken()); code = launch(t, haltError, stackfilter, haltFail, showOut, logTestListenerEvents, props); -errorOccured = (code == ERRORS); -failureOccured = (code != SUCCESS); -if (errorOccured || failureOccured) { -if ((errorOccured && haltError) -|| (failureOccured && haltFail)) { +errorOccurred = (code == ERRORS); +failureOccurred = (code != SUCCESS); +if (errorOccurred || failureOccurred) { +if ((errorOccurred && haltError) +|| (failureOccurred && haltFail)) { registerNonCrash(noCrashFile); System.exit(code); } else { 1.8 +1 -1 ant/docs/manual/CoreTypes/selectors-progr
cvs commit: ant/docs/manual/CoreTasks loadproperties.html
jglick 2005/04/19 12:21:10 Modified:docs/manual/CoreTasks loadproperties.html Log: Noting a difference between and . Revision ChangesPath 1.11 +2 -0 ant/docs/manual/CoreTasks/loadproperties.html Index: loadproperties.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/loadproperties.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- loadproperties.html 7 Mar 2005 18:09:09 - 1.10 +++ loadproperties.html 19 Apr 2005 19:21:10 - 1.11 @@ -13,6 +13,8 @@ Load a file's contents as Ant properties. This is equivalent to <property file|resource="..."/> except that it supports nested <filterchain> elements. +Also if the file is missing, the build is halted with an error, rather +than a warning being printed. If you want to simulate property's - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/xdocs external.xml
jglick 2005/06/22 16:24:27 Modified:xdocsexternal.xml Log: Minor update. Revision ChangesPath 1.161 +1 -1 ant/xdocs/external.xml Index: external.xml === RCS file: /home/cvs/ant/xdocs/external.xml,v retrieving revision 1.160 retrieving revision 1.161 diff -u -r1.160 -r1.161 --- external.xml 13 Jun 2005 16:39:50 - 1.160 +++ external.xml 22 Jun 2005 23:24:27 - 1.161 @@ -3399,7 +3399,7 @@ Compatibility: -bundles Ant 1.6.2 as of NetBeans 4.1; 1.6.3 for NetBeans 4.2 (will be made available as a 4.1 update) +bundles Ant 1.6.2 as of NetBeans 4.1; 1.6.5 for NetBeans 4.2 (will be made available as a 4.1 update) URL: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r354240 - /ant/core/trunk/docs/manual/ide.html
Author: jglick Date: Mon Dec 5 16:16:52 2005 New Revision: 354240 URL: http://svn.apache.org/viewcvs?rev=354240&view=rev Log: Updating an ancient NetBeans reference. Modified: ant/core/trunk/docs/manual/ide.html Modified: ant/core/trunk/docs/manual/ide.html URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/ide.html?rev=354240&r1=354239&r2=354240&view=diff == --- ant/core/trunk/docs/manual/ide.html (original) +++ ant/core/trunk/docs/manual/ide.html Mon Dec 5 16:16:52 2005 @@ -45,7 +45,7 @@ http://ant.netbeans.org/";> NetBeans -NetBeans 3.4 has very good Ant integration indeed. +NetBeans IDE uses Ant as the basis for its project system starting with the 4.0 release. http://jedit.org/";> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r354260 - /ant/core/trunk/xdocs/external.xml
Author: jglick Date: Mon Dec 5 18:03:59 2005 New Revision: 354260 URL: http://svn.apache.org/viewcvs?rev=354260&view=rev Log: Another trivial update. Modified: ant/core/trunk/xdocs/external.xml Modified: ant/core/trunk/xdocs/external.xml URL: http://svn.apache.org/viewcvs/ant/core/trunk/xdocs/external.xml?rev=354260&r1=354259&r2=354260&view=diff == --- ant/core/trunk/xdocs/external.xml (original) +++ ant/core/trunk/xdocs/external.xml Mon Dec 5 18:03:59 2005 @@ -3512,7 +3512,7 @@ Compatibility: -bundles Ant 1.6.2 as of NetBeans 4.1; 1.6.5 for NetBeans 4.2 (will be made available as a 4.1 update) +bundles Ant 1.6.2 as of NetBeans 4.1; 1.6.5 for NetBeans 5.0 URL: @@ -3636,4 +3636,4 @@ - \ No newline at end of file + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r359077 - /ant/core/trunk/docs/manual/CoreTasks/presetdef.html
Author: jglick Date: Mon Dec 26 08:51:31 2005 New Revision: 359077 URL: http://svn.apache.org/viewcvs?rev=359077&view=rev Log: Mentioning workaround from #38040 re. eagerly evaluated properties. Modified: ant/core/trunk/docs/manual/CoreTasks/presetdef.html Modified: ant/core/trunk/docs/manual/CoreTasks/presetdef.html URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/CoreTasks/presetdef.html?rev=359077&r1=359076&r2=359077&view=diff == --- ant/core/trunk/docs/manual/CoreTasks/presetdef.html (original) +++ ant/core/trunk/docs/manual/CoreTasks/presetdef.html Mon Dec 26 08:51:31 2005 @@ -146,6 +146,21 @@ [showmessage] message is 'Message 2' + +It is possible to use a trick to evaluate properties when the definition is +made rather than used. This can be useful if you do not expect some +properties to be available in child builds run with +<ant ... inheritall="false">: + + +<macrodef name="showmessage-presetdef"> + <attribute name="messageval"/> + <presetdef name="showmessage"> +<echo>message is '@{messageval}'</echo> + </presetdef> +</macrodef> +<showmessage-presetdef messageval="${message}"/> + Copyright © 2003-2005 Apache Software Foundation. All rights Reserved. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r359327 - /ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java
Author: jglick Date: Tue Dec 27 16:06:00 2005 New Revision: 359327 URL: http://svn.apache.org/viewcvs?rev=359327&view=rev Log: More helpful error message. Modified: ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java?rev=359327&r1=359326&r2=359327&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java Tue Dec 27 16:06:00 2005 @@ -1312,7 +1312,7 @@ */ public synchronized String[] getIncludedFiles() { if (filesIncluded == null) { -throw new IllegalStateException(); +throw new IllegalStateException("Must call scan() first"); } String[] files = new String[filesIncluded.size()]; filesIncluded.copyInto(files); @@ -1327,7 +1327,7 @@ */ public synchronized int getIncludedFilesCount() { if (filesIncluded == null) { -throw new IllegalStateException(); +throw new IllegalStateException("Must call scan() first"); } return filesIncluded.size(); } @@ -1395,7 +1395,7 @@ */ public synchronized String[] getIncludedDirectories() { if (dirsIncluded == null) { -throw new IllegalStateException(); +throw new IllegalStateException("Must call scan() first"); } String[] directories = new String[dirsIncluded.size()]; dirsIncluded.copyInto(directories); @@ -1410,7 +1410,7 @@ */ public synchronized int getIncludedDirsCount() { if (dirsIncluded == null) { -throw new IllegalStateException(); +throw new IllegalStateException("Must call scan() first"); } return dirsIncluded.size(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r359329 - in /ant/core/trunk: WHATSNEW src/etc/testcases/taskdefs/presetdef.xml src/main/org/apache/tools/ant/UnknownElement.java src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.
Author: jglick Date: Tue Dec 27 16:09:58 2005 New Revision: 359329 URL: http://svn.apache.org/viewcvs?rev=359329&view=rev Log: #38056: NPE when using presetdef under obscure circumstances. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=359329&r1=359328&r2=359329&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Tue Dec 27 16:09:58 2005 @@ -67,7 +67,8 @@ Fixed bugs: --- -* Some potential NullPointerExceptions, Bugzilla Report 37765 + +* Some potential NullPointerExceptions, Bugzilla Reports 37765 and 38056 * Problem when adding multiple filter files, Bugzilla Report 37341 Modified: ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml?rev=359329&r1=359328&r2=359329&view=diff == --- ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/presetdef.xml Tue Dec 27 16:09:58 2005 @@ -118,4 +118,13 @@ + + + + + + + + + Modified: ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java?rev=359329&r1=359328&r2=359329&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Tue Dec 27 16:09:58 2005 @@ -41,7 +41,7 @@ /** * Holds the namespace of the element. */ -private String namespace; +private String namespace = ""; /** * Holds the namespace qname of the element. @@ -111,7 +111,7 @@ getProject()); namespace = helper.getCurrentAntlibUri(); } -this.namespace = namespace; +this.namespace = namespace == null ? "" : namespace; } /** Return the qname of the XML element associated with this component. Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java?rev=359329&r1=359328&r2=359329&view=diff == --- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java (original) +++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java Tue Dec 27 16:09:58 2005 @@ -80,6 +80,10 @@ "correct_taskname_badel", "element message", "javac doesn't support the"); } +public void testPresetdefWithNestedElementTwice() { // #38056 +executeTarget("presetdef-with-nested-element-twice"); +executeTarget("presetdef-with-nested-element-twice"); +} /** * A test class to check default properties - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r380869 - /ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java
Author: jglick Date: Fri Feb 24 15:49:55 2006 New Revision: 380869 URL: http://svn.apache.org/viewcvs?rev=380869&view=rev Log: Test failed if run on a system with UTF-8 encoding as the default. Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java?rev=380869&r1=380868&r2=380869&view=diff == --- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java (original) +++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java Fri Feb 24 15:49:55 2006 @@ -124,7 +124,7 @@ } public void testSpecialSignsInHtmlPath() throws Exception { executeTarget("testSpecialSignsInHtmlPath"); -File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%§&-!report/index.html"); +File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r380872 - /ant/core/trunk/src/testcases/org/apache/tools/ant/types/AssertionsTest.java
Author: jglick Date: Fri Feb 24 16:22:21 2006 New Revision: 380872 URL: http://svn.apache.org/viewcvs?rev=380872&view=rev Log: Correct test failure when running with -ea. Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/types/AssertionsTest.java Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/types/AssertionsTest.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/types/AssertionsTest.java?rev=380872&r1=380871&r2=380872&view=diff == --- ant/core/trunk/src/testcases/org/apache/tools/ant/types/AssertionsTest.java (original) +++ ant/core/trunk/src/testcases/org/apache/tools/ant/types/AssertionsTest.java Fri Feb 24 16:22:21 2006 @@ -85,6 +85,9 @@ } public void testNofork() { +if (AssertionsTest.class.desiredAssertionStatus()) { +return; // ran Ant tests with -ea and this would fail spuriously +} expectLogContaining("test-nofork", "Assertion statements are currently ignored in non-forked mode"); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r380876 - /ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java
Author: jglick Date: Fri Feb 24 16:50:48 2006 New Revision: 380876 URL: http://svn.apache.org/viewcvs?rev=380876&view=rev Log: More helpful diagnostic message for an obscure mistake I once made... 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/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/ComponentHelper.java?rev=380876&r1=380875&r2=380876&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 Fri Feb 24 16:50:48 2006 @@ -496,10 +496,14 @@ if (c == null || !(Task.class.isAssignableFrom(c))) { return null; } -Task task = (Task) createComponent(taskType); -if (task == null) { +Object _task = createComponent(taskType); +if (_task == null) { return null; } +if (!(_task instanceof Task)) { +throw new BuildException("Expected a Task from '" + taskType + "' but got an instance of " + _task.getClass().getName() + " instead"); +} +Task task = (Task) _task; task.setTaskType(taskType); // set default value, can be changed by the user - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r380877 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java
Author: jglick Date: Fri Feb 24 16:58:11 2006 New Revision: 380877 URL: http://svn.apache.org/viewcvs?rev=380877&view=rev Log: Avoid catching ThreadDeath; just pass it on. Cf. http://www.netbeans.org/nonav/issues/show_bug.cgi?id=47191 Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java?rev=380877&r1=380876&r2=380877&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Java.java Fri Feb 24 16:58:11 2006 @@ -203,6 +203,8 @@ log(e); return 0; } +} catch (ThreadDeath t) { +throw t; // cf. NB #47191 } catch (Throwable t) { if (failOnError) { throw new BuildException(t, getLocation()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r381467 - in /ant/core/trunk: ./ docs/manual/ docs/manual/OptionalTasks/ src/main/org/apache/tools/ant/ src/main/org/apache/tools/ant/taskdefs/optional/junit/ xdocs/
Author: jglick Date: Mon Feb 27 14:24:26 2006 New Revision: 381467 URL: http://svn.apache.org/viewcvs?rev=381467&view=rev Log: #38799: task should work so long as junit.jar present in even if not among Ant libs. Added: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirror.java (with props) ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java (with props) Modified: ant/core/trunk/WHATSNEW ant/core/trunk/docs/manual/OptionalTasks/junit.html ant/core/trunk/docs/manual/install.html ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FormatterElement.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitResultFormatter.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/SummaryJUnitResultFormatter.java ant/core/trunk/xdocs/faq.xml Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=381467&r1=381466&r2=381467&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Mon Feb 27 14:24:26 2006 @@ -1,4 +1,4 @@ -Changes from current Ant 1.6.5 version to current RCS version +Changes from current Ant 1.6.5 version to current SVN version = Changes that could break older environments: @@ -76,6 +76,8 @@ Fixed bugs: --- + +* can now work with junit.jar in its . Bugzilla Report 38799. * Some potential NullPointerExceptions, Bugzilla Reports 37765 and 38056 Modified: ant/core/trunk/docs/manual/OptionalTasks/junit.html URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/OptionalTasks/junit.html?rev=381467&r1=381466&r2=381467&view=diff == --- ant/core/trunk/docs/manual/OptionalTasks/junit.html (original) +++ ant/core/trunk/docs/manual/OptionalTasks/junit.html Mon Feb 27 14:24:26 2006 @@ -19,12 +19,12 @@ Note: -You must have junit.jar and the class files for the -<junit> task in the same classpath. +You must have junit.jar available. You can do one of: + -Put both junit.jar and the optional tasks jar file in +Put both junit.jar and ant-junit.jar in ANT_HOME/lib. @@ -32,15 +32,23 @@ include their locations in your CLASSPATH environment variable. -Do neither of the above, and instead, specify their locations using -a <classpath> element in the build file. - +Add both JARs to your classpath using -lib. + + +Specify the locations of both JARs using +a <classpath> element in a <taskdef> in the build file. + + +Leave ant-junit.jar in its default location in ANT_HOME/lib +but include junit.jar in the <classpath> passed +to <junit>. (since Ant 1.7) + + + See the FAQ for details. - - Tests are defined by nested test or batchtest tags (see nested elements). @@ -217,6 +225,9 @@ element that represents a PATH like structure. +As of Ant 1.7, this classpath may be used to refer to junit.jar +as well as your tests and the tested code. + jvmarg If fork is enabled, additional parameters may be passed to @@ -580,7 +591,7 @@ ${reports.tests}. -Copyright © 2000-2005 The Apache Software Foundation. All rights +Copyright © 2000-2006 The Apache Software Foundation. All rights Reserved. Modified: ant/core/trunk/docs/manual/install.html URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/install.html?rev=381467&r1=381466&r2=381467&view=diff == --- ant/core/trunk/docs/manual/install.html (original) +++ ant/core/trunk/docs/manual/install.html Mon Feb 27 14:24:26 2006 @@ -456,7 +456,7 @@ junit.jar -junit tasks +<junit> task. May be in classpath passed to task rather than Ant's classpath. http://www.junit.org/"; target="_top">http://www.junit.org/ @@ -698,7 +698,7 @@ -Copyright © 2000-2005 The Apache Software Foundation. All rights +Copyright © 2000-2006 The Apache Software Foundation. All rights Reserved. Modified: ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java?rev=381467&r1=381466&r2=381467&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/AntClassLoader.java (original) +++ ant/core/trunk/src/main/org/a
svn commit: r381780 - in /ant/core/trunk: WHATSNEW docs/manual/OptionalTasks/junit.html src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java src/main/org/apache/tools/ant/taskdef
Author: jglick Date: Tue Feb 28 13:07:15 2006 New Revision: 381780 URL: http://svn.apache.org/viewcvs?rev=381780&view=rev Log: #38811: support for JUnit 4.0. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/docs/manual/OptionalTasks/junit.html ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=381780&r1=381779&r2=381780&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Tue Feb 28 13:07:15 2006 @@ -77,6 +77,8 @@ Fixed bugs: --- +* now supports JUnit 4. Bugzilla Report 38811. + * can now work with junit.jar in its . Bugzilla Report 38799. * Some potential NullPointerExceptions, Bugzilla Reports 37765 and 38056 Modified: ant/core/trunk/docs/manual/OptionalTasks/junit.html URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/OptionalTasks/junit.html?rev=381780&r1=381779&r2=381780&view=diff == --- ant/core/trunk/docs/manual/OptionalTasks/junit.html (original) +++ ant/core/trunk/docs/manual/OptionalTasks/junit.html Tue Feb 28 13:07:15 2006 @@ -12,7 +12,8 @@ version of the framework can be found at http://www.junit.org";>http://www.junit.org. This task has been tested with JUnit 3.0 up to JUnit 3.8.1; it won't -work with versions prior to JUnit 3.0. +work with versions prior to JUnit 3.0. It also works with JUnit 4.0, including +"pure" JUnit 4 tests using only annotations and no JUnit4TestAdapter. Note: This task depends on external libraries not included in the Ant distribution. See Library Dependencies for more information. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java?rev=381780&r1=381779&r2=381780&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java Tue Feb 28 13:07:15 2006 @@ -35,6 +35,7 @@ import java.util.Vector; import junit.framework.AssertionFailedError; import junit.framework.Test; +import junit.framework.TestFailure; import junit.framework.TestListener; import junit.framework.TestResult; import junit.framework.TestSuite; @@ -99,7 +100,13 @@ "junit.textui.TestRunner", "java.lang.reflect.Method.invoke(", "sun.reflect.", -"org.apache.tools.ant." +"org.apache.tools.ant.", +// JUnit 4 support: +"org.junit.", +"junit.framework.JUnit4TestAdapter", +// See wrapListener for reason: +"Caused by: java.lang.AssertionError", +" more", }; @@ -141,6 +148,9 @@ /** Do we print TestListener events? */ private boolean logTestListenerEvents = false; +/** Turned on if we are using JUnit 4 for this test suite. see #38811 */ +private boolean junit4; + /** * Constructor for fork=true or when the user hasn't specified a * classpath. @@ -212,9 +222,9 @@ public void run() { res = new TestResult(); -res.addListener(this); +res.addListener(wrapListener(this)); for (int i = 0; i < formatters.size(); i++) { -res.addListener((TestListener) formatters.elementAt(i)); +res.addListener(wrapListener((TestListener) formatters.elementAt(i))); } ByteArrayOutputStream errStrm = new ByteArrayOutputStream(); @@ -255,6 +265,19 @@ try { try { +Class junit4TestAdapterClass = null; +// Note that checking for JDK 5 directly won't work; under JDK 4, this will already have failed. +try { +if (loader == null) { +junit4TestAdapterClass = Class.forName("junit.framework.JUnit4TestAdapter"); +} else { +junit4TestAdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, loader); +} +} catch (ClassNotFoundException e) { +// OK, fall back to JUnit 3. +} +junit4 = junit4TestAdapt
svn commit: r382127 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Author: jglick Date: Wed Mar 1 11:13:16 2006 New Revision: 382127 URL: http://svn.apache.org/viewcvs?rev=382127&view=rev Log: Tweak: in case junit-3.8.1.jar and junit-4.0.jar are on CP but in that order, and running JDK 1.4-, at least run JUnit 3.x tests. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java?rev=382127&r1=382126&r2=382127&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java Wed Mar 1 11:13:16 2006 @@ -266,8 +266,12 @@ try { Class junit4TestAdapterClass = null; -// Note that checking for JDK 5 directly won't work; under JDK 4, this will already have failed. +// Check for JDK 5 first. Will *not* help on JDK 1.4 if only junit-4.0.jar in +// CP because in that case linkage of whole task will already have +// failed! But will help if CP has junit-3.8.1.jar:junit-4.0.jar. +// In that case first C.fN will fail with CNFE and we will avoid UnsupportedClassVersionError. try { +Class.forName("java.lang.annotation.Annotation"); if (loader == null) { junit4TestAdapterClass = Class.forName("junit.framework.JUnit4TestAdapter"); } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r411043 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java
Author: jglick Date: Thu Jun 1 22:26:13 2006 New Revision: 411043 URL: http://svn.apache.org/viewvc?rev=411043&view=rev Log: Just using a more explicitly qualified class name. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java?rev=411043&r1=411042&r2=411043&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskMirrorImpl.java Thu Jun 1 22:26:13 2006 @@ -38,7 +38,7 @@ this.task = task; } -public void addVmExit(JUnitTest test, JUnitResultFormatterMirror _formatter, +public void addVmExit(JUnitTest test, JUnitTaskMirror.JUnitResultFormatterMirror _formatter, OutputStream out, final String message) { JUnitResultFormatter formatter = (JUnitResultFormatter) _formatter; formatter.setOutput(out); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r411044 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit: JUnitVersionHelper.java XMLJUnitResultFormatter.java
Author: jglick Date: Thu Jun 1 22:27:26 2006 New Revision: 411044 URL: http://svn.apache.org/viewvc?rev=411044&view=rev Log: Stefan pointed out that the XML formatter was mistakenly using "JUnit4TestFacade" as the "class name" for simple TestCase's run under JUnit 4. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.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?rev=411044&r1=411043&r2=411044&view=diff == --- 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 Thu Jun 1 22:27:26 2006 @@ -93,4 +93,22 @@ return "unknown"; } +/** + * Tries to find the name of the class which a test represents + * across JUnit 3 and 4. + */ +static String getTestCaseClassName(Test test) { +String className = test.getClass().getName(); +if (className.equals("junit.framework.JUnit4TestCaseFacade")) { +// JUnit 4 wraps solo tests this way. We can extract +// the original test name with a little hack. +String name = test.toString(); +int paren = name.lastIndexOf('('); +if (paren != -1 && name.endsWith(")")) { +className = name.substring(paren + 1, name.length() - 1); +} +} +return className; +} + } Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java?rev=411044&r1=411043&r2=411044&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLJUnitResultFormatter.java Thu Jun 1 22:27:26 2006 @@ -200,7 +200,7 @@ // a TestSuite can contain Tests from multiple classes, // even tests with the same name - disambiguate them. currentTest.setAttribute(ATTR_CLASSNAME, - test.getClass().getName()); +JUnitVersionHelper.getTestCaseClassName(test)); rootElement.appendChild(currentTest); testElements.put(test, currentTest); } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r411046 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Echo.java
Author: jglick Date: Thu Jun 1 22:28:04 2006 New Revision: 411046 URL: http://svn.apache.org/viewvc?rev=411046&view=rev Log: Missing @since. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Echo.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Echo.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Echo.java?rev=411046&r1=411045&r2=411046&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Echo.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Echo.java Thu Jun 1 22:28:04 2006 @@ -131,6 +131,7 @@ * Declare the encoding to use when outputting to a file; * Use "" for the platform's default encoding. * @param encoding + * @since 1.7 */ public void setEncoding(String encoding) { this.encoding = encoding; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r411047 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ide/
Author: jglick Date: Thu Jun 1 22:29:30 2006 New Revision: 411047 URL: http://svn.apache.org/viewvc?rev=411047&view=rev Log: Deleting empty package. Removed: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ide/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r423831 - /ant/core/trunk/src/main/org/apache/tools/bzip2/CBZip2InputStream.java
Author: jglick Date: Thu Jul 20 01:50:09 2006 New Revision: 423831 URL: http://svn.apache.org/viewvc?rev=423831&view=rev Log: Javadoc typo only. Modified: ant/core/trunk/src/main/org/apache/tools/bzip2/CBZip2InputStream.java Modified: ant/core/trunk/src/main/org/apache/tools/bzip2/CBZip2InputStream.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/bzip2/CBZip2InputStream.java?rev=423831&r1=423830&r2=423831&view=diff == --- ant/core/trunk/src/main/org/apache/tools/bzip2/CBZip2InputStream.java (original) +++ ant/core/trunk/src/main/org/apache/tools/bzip2/CBZip2InputStream.java Thu Jul 20 01:50:09 2006 @@ -127,7 +127,7 @@ private CBZip2InputStream.Data data; /** - * Constructs a new CBZip2InputStream which decompresses bytes readed from + * Constructs a new CBZip2InputStream which decompresses bytes read from * the specified stream. * * Although BZip2 headers are marked with the magic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r425875 - in /ant/core/trunk/src: main/org/apache/tools/ant/types/DirSet.java testcases/org/apache/tools/ant/types/DirSetTest.java
Author: jglick Date: Wed Jul 26 15:15:12 2006 New Revision: 425875 URL: http://svn.apache.org/viewvc?rev=425875&view=rev Log: Expressing a as a string should show matching dirs, not files! Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/DirSet.java ant/core/trunk/src/testcases/org/apache/tools/ant/types/DirSetTest.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/DirSet.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/DirSet.java?rev=425875&r1=425874&r2=425875&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/types/DirSet.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/DirSet.java Wed Jul 26 15:15:12 2006 @@ -18,7 +18,7 @@ package org.apache.tools.ant.types; import java.util.Iterator; - +import org.apache.tools.ant.DirectoryScanner; import org.apache.tools.ant.types.resources.FileResourceIterator; /** @@ -89,6 +89,25 @@ */ public boolean isFilesystemOnly() { return true; +} + +/** + * Returns included directories as a list of semicolon-separated paths. + * + * @return a String of included directories. + */ +public String toString() { +DirectoryScanner ds = getDirectoryScanner(getProject()); +String[] dirs = ds.getIncludedDirectories(); +StringBuffer sb = new StringBuffer(); + +for (int i = 0; i < dirs.length; i++) { +if (i > 0) { +sb.append(';'); +} +sb.append(dirs[i]); +} +return sb.toString(); } } Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/types/DirSetTest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/types/DirSetTest.java?rev=425875&r1=425874&r2=425875&view=diff == --- ant/core/trunk/src/testcases/org/apache/tools/ant/types/DirSetTest.java (original) +++ ant/core/trunk/src/testcases/org/apache/tools/ant/types/DirSetTest.java Wed Jul 26 15:15:12 2006 @@ -17,6 +17,8 @@ package org.apache.tools.ant.types; +import java.io.File; +import java.io.FileOutputStream; import org.apache.tools.ant.BuildException; /** @@ -39,7 +41,7 @@ FileSet fs = new FileSet(); fs.setProject(getProject()); getProject().addReference("dummy", fs); -ds.setRefid(new Reference("dummy")); +ds.setRefid(new Reference(getProject(), "dummy")); try { ds.getDir(getProject()); fail("DirSet created from FileSet reference"); @@ -50,13 +52,31 @@ ds = (DirSet) getInstance(); ds.setProject(getProject()); getProject().addReference("dummy2", ds); -fs.setRefid(new Reference("dummy2")); +fs.setRefid(new Reference(getProject(), "dummy2")); try { fs.getDir(getProject()); fail("FileSet created from DirSet reference"); } catch (BuildException e) { assertEquals("dummy2 doesn\'t denote a FileSet", e.getMessage()); } +} + +public void testToString() throws Exception { +File tmp = File.createTempFile("DirSetTest", ""); +tmp.delete(); +File a = new File(tmp, "a"); +a.mkdirs(); +File b = new File(tmp, "b"); +File bc = new File(b, "c"); +bc.mkdirs(); +new FileOutputStream(new File(a, "x")).close(); +new FileOutputStream(new File(b, "x")).close(); +new FileOutputStream(new File(bc, "x")).close(); +DirSet ds = new DirSet(); +ds.setProject(getProject()); +ds.setDir(tmp); +ds.setIncludes("b/"); +assertEquals("b;b" + File.separator + "c", ds.toString()); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r425879 - in /ant/core/trunk/src/main/org/apache/tools/ant/helper: ProjectHelper2.java ProjectHelperImpl.java
Author: jglick Date: Wed Jul 26 15:29:50 2006 New Revision: 425879 URL: http://svn.apache.org/viewvc?rev=425879&view=rev Log: People should not think that "file:../master.xml" is a meaningful URI. Ant historically supports it but normal XML parsers do not. Modified: ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java?rev=425879&r1=425878&r2=425879&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java Wed Jul 26 15:29:50 2006 @@ -477,6 +477,11 @@ File file = new File(path); if (!file.isAbsolute()) { file = FILE_UTILS.resolveFile(context.getBuildFileParent(), path); +context.getProject().log( +"Warning: '" + systemId + "' in " + context.getBuildFile() + +" should be expressed simply as '" + path.replace('\\', '/') + +"' for compliance with other XML tools", +Project.MSG_WARN); } context.getProject().log("file=" + file, Project.MSG_DEBUG); try { Modified: ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java?rev=425879&r1=425878&r2=425879&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java Wed Jul 26 15:29:50 2006 @@ -296,6 +296,11 @@ File file = new File(path); if (!file.isAbsolute()) { file = FILE_UTILS.resolveFile(helperImpl.buildFileParent, path); +helperImpl.project.log( +"Warning: '" + systemId + "' in " + helperImpl.buildFile + +" should be expressed simply as '" + path.replace('\\', '/') + +"' for compliance with other XML tools", +Project.MSG_WARN); } try { InputSource inputSource = new InputSource(new FileInputStream(file)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r426172 - /ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java
Author: jglick Date: Thu Jul 27 11:02:20 2006 New Revision: 426172 URL: http://svn.apache.org/viewvc?rev=426172&view=rev Log: Correcting use of deprecated API. Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java?rev=426172&r1=426171&r2=426172&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java Thu Jul 27 11:02:20 2006 @@ -17,12 +17,12 @@ package org.apache.tools.ant.input; -import java.io.DataInputStream; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.util.Enumeration; import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.util.KeepAliveInputStream; /** * Prompts on System.err, reads input from System.in @@ -45,15 +45,14 @@ */ public void handleInput(InputRequest request) throws BuildException { String prompt = getPrompt(request); -DataInputStream in = null; +BufferedReader r = null; try { -in = -new DataInputStream(new KeepAliveInputStream(getInputStream())); +r = new BufferedReader(new InputStreamReader(getInputStream())); do { System.err.println(prompt); System.err.flush(); try { -String input = in.readLine(); +String input = r.readLine(); request.setInput(input); } catch (IOException e) { throw new BuildException("Failed to read input from" @@ -61,9 +60,9 @@ } } while (!request.isInputValid()); } finally { -if (in != null) { +if (r != null) { try { -in.close(); +r.close(); } catch (IOException e) { throw new BuildException("Failed to close input.", e); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r426173 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/input/InputRequest.java src/main/org/apache/tools/ant/taskdefs/Input.java
Author: jglick Date: Thu Jul 27 11:03:19 2006 New Revision: 426173 URL: http://svn.apache.org/viewvc?rev=426173&view=rev Log: InputHandler implementations may now call InputRequest.getDefaultValue() if they wish. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/input/InputRequest.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=426173&r1=426172&r2=426173&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Jul 27 11:03:19 2006 @@ -250,12 +250,16 @@ * would fetch files that were up to date, because it used > in a remote/local timestamp comparison, not >=. Bugzilla 35607. - + * passes the current file (name + directory) to the stylesheet/transformation. xsl-parameter name is configurable. Bugzilla report 21042. Other changes: -- + +* InputHandler implementations may now call InputRequest.getDefaultValue() + if they wish. + * Took in bugzilla report 39320. * Improve compatibility with GNU Classpath and java versions prior to 1.5. Bugzilla 39027. Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/InputRequest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/input/InputRequest.java?rev=426173&r1=426172&r2=426173&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/input/InputRequest.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/input/InputRequest.java Thu Jul 27 11:03:19 2006 @@ -25,6 +25,7 @@ public class InputRequest { private String prompt; private String input; +private String defaultValue; /** * Construct an InputRequest. @@ -68,6 +69,22 @@ */ public String getInput() { return input; +} + +/** + * Gets a configured default value. + * @since Ant 1.7.0 + */ +public String getDefaultValue() { +return defaultValue; +} + +/** + * Configures a default value. + * @since Ant 1.7.0 + */ +public void setDefaultValue(String d) { +defaultValue = d; } } Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java?rev=426173&r1=426172&r2=426173&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Input.java Thu Jul 27 11:03:19 2006 @@ -221,6 +221,7 @@ } else { request = new InputRequest(message); } +request.setDefaultValue(defaultvalue); InputHandler h = handler == null ? getProject().getInputHandler() - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r426184 - /ant/core/trunk/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java
Author: jglick Date: Thu Jul 27 11:21:08 2006 New Revision: 426184 URL: http://svn.apache.org/viewvc?rev=426184&view=rev Log: Actually permit validargs and defaultvalue together in the default handler. Formerly, would just prompt you again if you just pressed Enter. Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java?rev=426184&r1=426183&r2=426184&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/input/MultipleChoiceInputRequest.java Thu Jul 27 11:21:08 2006 @@ -51,6 +51,6 @@ * @return true if the input is one of the allowed values. */ public boolean isInputValid() { -return choices.contains(getInput()); +return choices.contains(getInput()) || ("".equals(getInput()) && getDefaultValue() != null); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r426186 - /ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java
Author: jglick Date: Thu Jul 27 11:21:52 2006 New Revision: 426186 URL: http://svn.apache.org/viewvc?rev=426186&view=rev Log: Display the default value for an input prompt sensibly. Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java?rev=426186&r1=426185&r2=426186&view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/input/DefaultInputHandler.java Thu Jul 27 11:21:52 2006 @@ -82,23 +82,34 @@ */ protected String getPrompt(InputRequest request) { String prompt = request.getPrompt(); +String def = request.getDefaultValue(); if (request instanceof MultipleChoiceInputRequest) { StringBuffer sb = new StringBuffer(prompt); -sb.append("("); +sb.append(" ("); Enumeration e = ((MultipleChoiceInputRequest) request).getChoices().elements(); boolean first = true; while (e.hasMoreElements()) { if (!first) { -sb.append(","); +sb.append(", "); +} +String next = (String) e.nextElement(); +if (next.equals(def)) { +sb.append('['); +} +sb.append(next); +if (next.equals(def)) { +sb.append(']'); } -sb.append(e.nextElement()); first = false; } sb.append(")"); -prompt = sb.toString(); +return sb.toString(); +} else if (def != null) { +return prompt + " [" + def + "]"; +} else { +return prompt; } -return prompt; } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r426481 - /ant/core/trunk/WHATSNEW
Author: jglick Date: Fri Jul 28 04:41:14 2006 New Revision: 426481 URL: http://svn.apache.org/viewvc?rev=426481&view=rev Log: More info re. #28621. Modified: ant/core/trunk/WHATSNEW Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=426481&r1=426480&r2=426481&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Fri Jul 28 04:41:14 2006 @@ -258,7 +258,7 @@ -- * InputHandler implementations may now call InputRequest.getDefaultValue() - if they wish. + if they wish. The default handler uses this also. Bugzilla report 28621. * Took in bugzilla report 39320. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r429887 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/ProcessDestroyer.java
Author: jglick Date: Tue Aug 8 16:43:07 2006 New Revision: 429887 URL: http://svn.apache.org/viewvc?rev=429887&view=rev Log: Avoid a useless exception being (sometimes) thrown if a task is halted with Thread.stop(). 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?rev=429887&r1=429886&r2=429887&view=diff == --- 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 Tue Aug 8 16:43:07 2006 @@ -142,7 +142,10 @@ // eligible for garbage collection // Cf.: http://developer.java.sun.com/developer/bugParade/bugs/4533087.html destroyProcessThread.setShouldDestroy(false); -destroyProcessThread.start(); +if (!destroyProcessThread.getThreadGroup().isDestroyed()) { +// start() would throw IllegalThreadStateException from ThreadGroup.add if it were destroyed +destroyProcessThread.start(); +} // this should return quickly, since it basically is a NO-OP. try { destroyProcessThread.join(2); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r431458 - /ant/core/trunk/WHATSNEW
Author: jglick Date: Mon Aug 14 15:47:11 2006 New Revision: 431458 URL: http://svn.apache.org/viewvc?rev=431458&view=rev Log: Mention of #39683. Modified: ant/core/trunk/WHATSNEW Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=431458&r1=431457&r2=431458&view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Mon Aug 14 15:47:11 2006 @@ -101,6 +101,9 @@ Fixed bugs: --- + +* Converting a to a string was broken. Bugzilla Report 39683. + * Manifests have improved line length handling, taking care of encoding. Bug reports 37548 / 34425. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]