Re: Your archive
Please have a look at the attached file. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Patch] javadoc and style fixes for org.apache.tools.ant.taskdefs.optional.extension.resolvers
- renamed variables (m_destdir -destdir) - added javadoc for public methods and normal doc for private methods - slight tweak to remove Unneccessary nested... complaint from Eclipse Kev - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Patch] javadoc and variable names org.apache.tools.ant.taskdefs.optional.extension.resolvers
- added javadoc and normal doc where appropriate - renamed variables from m_* Kev - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Patch] javadoc and variable names org.apache.tools.ant.taskdefs.optional.extension.resolvers
- added javadoc and normal doc where appropriate - renamed variables from m_* Kev Index: AntResolver.java === RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java,v retrieving revision 1.10 diff -u -r1.10 AntResolver.java --- AntResolver.java9 Mar 2004 16:48:26 - 1.10 +++ AntResolver.java10 Dec 2004 05:46:57 - @@ -29,63 +29,87 @@ * * @version $Revision: 1.10 $ $Date: 2004/03/09 16:48:26 $ */ -public class AntResolver -implements ExtensionResolver { -private File m_antfile; -private File m_destfile; -private String m_target; - -public void setAntfile(File antfile) { -m_antfile = antfile; +public class AntResolver implements ExtensionResolver { +private File antfile; +private File destfile; +private String target; + +/** + * Sets the ant file + * @param antfile the ant file to set + */ +public void setAntfile(final File antfile) { +this.antfile = antfile; } -public void setDestfile(File destfile) { -m_destfile = destfile; +/** + * Sets the destination file + * @param destfile the destination file + */ +public void setDestfile(final File destfile) { +this.destfile = destfile; } +/** + * Sets the target + * @param target the target + */ public void setTarget(final String target) { -m_target = target; +this.target = target; } +/** + * Returns the resolved file + * @param extension the extension + * @param project the project + * @return the file resolved + * @throws BuildException if the file cannot be resolved + */ public File resolve(final Extension extension, - final Project project) -throws BuildException { + final Project project) throws BuildException { validate(); final Ant ant = (Ant) project.createTask(ant); ant.setInheritAll(false); -ant.setAntfile(m_antfile.getName()); +ant.setAntfile(antfile.getName()); try { final File dir = -m_antfile.getParentFile().getCanonicalFile(); +antfile.getParentFile().getCanonicalFile(); ant.setDir(dir); } catch (final IOException ioe) { throw new BuildException(ioe.getMessage(), ioe); } -if (null != m_target) { -ant.setTarget(m_target); +if (null != target) { +ant.setTarget(target); } ant.execute(); -return m_destfile; +return destfile; } - + +/* + * Validates URL + */ private void validate() { -if (null == m_antfile) { +if (null == antfile) { final String message = Must specify Buildfile; throw new BuildException(message); } -if (null == m_destfile) { +if (null == destfile) { final String message = Must specify destination file; throw new BuildException(message); } } +/** + * Returns a string representation + * @return the string representation + */ public String toString() { -return Ant[ + m_antfile + == + m_destfile + ]; +return Ant[ + antfile + == + destfile + ]; } } Index: LocationResolver.java === RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/LocationResolver.java,v retrieving revision 1.10 diff -u -r1.10 LocationResolver.java --- LocationResolver.java 9 Mar 2004 16:48:27 - 1.10 +++ LocationResolver.java 10 Dec 2004 05:46:57 - @@ -27,26 +27,38 @@ * * @version $Revision: 1.10 $ $Date: 2004/03/09 16:48:27 $ */ -public class LocationResolver -implements ExtensionResolver { -private String m_location; +public class LocationResolver implements ExtensionResolver { +private String location; +/** + * Sets the location for this resolver + * @param location the location + */ public void setLocation(final String location) { -m_location = location; +this.location = location; } +/** + * Returns the resolved file + * @param extension the extension + * @param project the project + * @return the file resolved + * @throws BuildException if there\'s no location set + */ public File resolve(final Extension extension, -final Project project) -throws BuildException { -if (null == m_location) { +final Project project) throws BuildException { +if (null == location) { final String message = No location specified for resolver; throw new
[Patch] javadoc and style fixes for org.apache.tools.ant.taskdefs.optional.extension.resolvers
- renamed variables (m_destdir -destdir) - added javadoc for public methods and normal doc for private methods - slight tweak to remove Unneccessary nested... complaint from Eclipse Kev Index: URLResolver.java === RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/URLResolver.java,v retrieving revision 1.10 diff -u -r1.10 URLResolver.java --- URLResolver.java9 Mar 2004 16:48:27 - 1.10 +++ URLResolver.java10 Dec 2004 05:50:12 - @@ -29,45 +29,66 @@ * * @version $Revision: 1.10 $ $Date: 2004/03/09 16:48:27 $ */ -public class URLResolver -implements ExtensionResolver { -private File m_destfile; -private File m_destdir; -private URL m_url; - +public class URLResolver implements ExtensionResolver { +private File destfile; +private File destdir; +private URL url; + +/** + * Sets the URL + * @param url the url + */ public void setUrl(final URL url) { -m_url = url; +this.url = url; } +/** + * Sets the destination file + * @param destfile the destination file + */ public void setDestfile(final File destfile) { -m_destfile = destfile; +this.destfile = destfile; } +/** + * Sets the destination directory + * @param destdir the destination directory + */ public void setDestdir(final File destdir) { -m_destdir = destdir; +this.destdir = destdir; } +/** + * Returns the file resolved from URL and directory + * @param extension the extention + * @param project the project + * @return file the file resolved + * @throws BuildException if the URL is invalid + */ public File resolve(final Extension extension, - final Project project) -throws BuildException { + final Project project) throws BuildException { validate(); - + final File file = getDest(); final Get get = (Get) project.createTask(get); get.setDest(file); -get.setSrc(m_url); +get.setSrc(url); get.execute(); return file; } +/* + * Gets the destination file + */ private File getDest() { -if (null != m_destfile) { -return m_destfile; +File result; +if (null != destfile) { +result = destfile; } else { -final String file = m_url.getFile(); -String filename = null; +final String file = url.getFile(); +String filename; if (null == file || file.length() = 1) { filename = default.file; } else { @@ -77,27 +98,34 @@ } filename = file.substring(index); } - -return new File(m_destdir, filename); +result = new File(destdir, filename); } +return result; } +/* + * Validates URL + */ private void validate() { -if (null == m_url) { +if (null == url) { final String message = Must specify URL; throw new BuildException(message); } -if (null == m_destdir null == m_destfile) { +if (null == destdir null == destfile) { final String message = Must specify destination file or directory; throw new BuildException(message); -} else if (null != m_destdir null != m_destfile) { +} else if (null != destdir null != destfile) { final String message = Must not specify both destination file or directory; throw new BuildException(message); } } +/** + * Returns a string representation of the URL + * @return the string representation + */ public String toString() { -return URL[ + m_url + ]; +return URL[ + url + ]; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Patch] removed deprecated methods and changed variable scope (private-protected) ProjectHelperImpl
- swapped out deprecated code where the replacement code was obvious - left some deprecated methods where I wasn't sure - changed visibility of class variables from private to protected still showing 1700+ warnings/errors :( Kev Index: ProjectHelperImpl.java === RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java,v retrieving revision 1.28 diff -u -r1.28 ProjectHelperImpl.java --- ProjectHelperImpl.java 12 Nov 2004 15:14:59 - 1.28 +++ ProjectHelperImpl.java 10 Dec 2004 06:22:47 - @@ -55,33 +55,33 @@ * SAX 1 style parser used to parse the given file. This may * in fact be a SAX 2 XMLReader wrapped in an XMLReaderAdapter. */ -private org.xml.sax.Parser parser; +protected org.xml.sax.Parser parser; /** The project to configure. */ -private Project project; +protected Project project; /** The configuration file to parse. */ private File buildFile; /** * Parent directory of the build file. Used for resolving entities * and setting the project's base directory. */ -private File buildFileParent; +protected File buildFileParent; /** * Locator for the configuration file parser. * Used for giving locations of errors etc. */ -private Locator locator; +protected Locator locator; /** * Target that all other targets will depend upon implicitly. * * pThis holds all tasks and data type definitions that have * been placed outside of targets./p */ -private Target implicitTarget = new Target(); +protected Target implicitTarget = new Target(); /** * helper for path - URI and URI - path conversions. */ -private static FileUtils fu = FileUtils.newFileUtils(); +protected static FileUtils fu = FileUtils.newFileUtils(); /** * default constructor @@ -404,7 +404,7 @@ } if (def != null !def.equals()) { -helperImpl.project.setDefaultTarget(def); +helperImpl.project.setDefault(def); } else { throw new BuildException(The default attribute is required); } @@ -428,8 +428,7 @@ if ((new File(baseDir)).isAbsolute()) { helperImpl.project.setBasedir(baseDir); } else { -File resolvedBaseDir = helperImpl.project.resolveFile(baseDir, -helperImpl.buildFileParent); +File resolvedBaseDir = fu.resolveFile(helperImpl.buildFileParent, baseDir); helperImpl.project.setBaseDir(resolvedBaseDir); } } @@ -600,7 +599,7 @@ * * @since Ant 1.6 */ -private static void handleElement(ProjectHelperImpl helperImpl, +protected static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent, Target target, String elementName, AttributeList attrs) @@ -1022,7 +1021,7 @@ * * @see #configure(Object,AttributeList,Project) */ -private void configureId(Object target, AttributeList attr) { +protected void configureId(Object target, AttributeList attr) { String id = attr.getValue(id); if (id != null) { project.addReference(id, target); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Parallel.java
jkf 2004/12/09 14:17:24 Modified:src/main/org/apache/tools/ant/taskdefs Parallel.java Log: In bug 32566 someone asked about the thread safety requirements in Ant. This made me perform a quick check on the main flow of the Ant project from a threading perspective. The only cause for wich the tasks specified in the build file may be executed in another thread is the parallel task. The parallel task does not ensure all variables are stored in memory before the new threads start. Revision ChangesPath 1.30 +8 -0 ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java Index: Parallel.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- Parallel.java 1 Apr 2004 13:06:45 - 1.29 +++ Parallel.java 9 Dec 2004 22:17:24 - 1.30 @@ -266,6 +266,14 @@ } synchronized (semaphore) { +// When we leave this block we can be sure all data is really +// stored in main memory before the new threads start, the new +// threads will for sure load the data from main memory. +// +// This probably is slightly paranoid. +} + +synchronized (semaphore) { // start any daemon threads if (daemons != null) { for (int i = 0; i daemons.length; ++i) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Parallel.java
jkf 2004/12/09 15:06:47 Modified:src/main/org/apache/tools/ant/taskdefs Parallel.java Log: Checkstyle updates. (removed trailing spaces just added, updated javadoc, removed an undocumented BuildException which was neither thrown according to interface nor according to methods implementation.) Revision ChangesPath 1.31 +18 -8 ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java Index: Parallel.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Parallel.java 9 Dec 2004 22:17:24 - 1.30 +++ Parallel.java 9 Dec 2004 23:06:47 - 1.31 @@ -56,9 +56,10 @@ /** * Add a nested task to execute parallel (asynchron). * p - * @param nestedTask Nested task to be executed in parallel + * @param nestedTask Nested task to be executed in parallel. + *must not be null. */ -public void addTask(Task nestedTask) throws BuildException { +public void addTask(Task nestedTask) { tasks.add(nestedTask); } } @@ -107,6 +108,7 @@ /** * Add a group of daemon threads + * @param daemonTasks The tasks to be executed as daemon. */ public void addDaemons(TaskList daemonTasks) { if (this.daemonTasks != null) { @@ -266,13 +268,13 @@ } synchronized (semaphore) { -// When we leave this block we can be sure all data is really -// stored in main memory before the new threads start, the new +// When we leave this block we can be sure all data is really +// stored in main memory before the new threads start, the new // threads will for sure load the data from main memory. // // This probably is slightly paranoid. } - + synchronized (semaphore) { // start any daemon threads if (daemons != null) { @@ -315,7 +317,7 @@ outer: while (threadNumber numTasks stillRunning) { for (int i = 0; i maxRunning; i++) { -if (running[i] == null || running[i].finished) { +if (running[i] == null || running[i].isFinished()) { running[i] = runnables[threadNumber++]; Thread thread = new Thread(group, running[i]); thread.start(); @@ -340,7 +342,7 @@ outer2: while (stillRunning) { for (int i = 0; i maxRunning; ++i) { -if (running[i] != null !running[i].finished) { +if (running[i] != null !running[i].isFinished()) { //System.out.println(Thread + i + is still alive ); // still running - wait for it try { @@ -405,7 +407,7 @@ private class TaskRunnable implements Runnable { private Throwable exception; private Task task; -boolean finished; +private boolean finished; /** * Construct a new TaskRunnable.p @@ -442,6 +444,14 @@ */ public Throwable getException() { return exception; +} + +/** + * Provides the indicator that the task has been finished. + * @return Returns true when the task is finished. + */ +boolean isFinished() { +return finished; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CVS-Snapshot
Is there some script not working any more? The homepage [1] has a link to cvs/snapshot [2], but there is nothing. Just for comparison ... Forrest has, httpd has, lenya has, maven not, spamassasin has, ... Jan [1] http://ant.apache.org/cvs.html [2] http://cvs.apache.org/snapshots/ant/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers AntResolver.java LocationResolver.java URLResolver.java
peterreilly2004/12/10 02:58:19 Modified: src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers AntResolver.java LocationResolver.java URLResolver.java Log: checkstyle changes Obtained from: Kevin Jackson Revision ChangesPath 1.11 +46 -22 ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java Index: AntResolver.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- AntResolver.java 9 Mar 2004 16:48:26 - 1.10 +++ AntResolver.java 10 Dec 2004 10:58:19 - 1.11 @@ -29,63 +29,87 @@ * * @version $Revision$ $Date$ */ -public class AntResolver -implements ExtensionResolver { -private File m_antfile; -private File m_destfile; -private String m_target; - -public void setAntfile(File antfile) { -m_antfile = antfile; +public class AntResolver implements ExtensionResolver { +private File antfile; +private File destfile; +private String target; + +/** + * Sets the ant file + * @param antfile the ant file to set + */ +public void setAntfile(final File antfile) { +this.antfile = antfile; } -public void setDestfile(File destfile) { -m_destfile = destfile; +/** + * Sets the destination file + * @param destfile the destination file + */ +public void setDestfile(final File destfile) { +this.destfile = destfile; } +/** + * Sets the target + * @param target the target + */ public void setTarget(final String target) { -m_target = target; +this.target = target; } +/** + * Returns the resolved file + * @param extension the extension + * @param project the project + * @return the file resolved + * @throws BuildException if the file cannot be resolved + */ public File resolve(final Extension extension, - final Project project) -throws BuildException { + final Project project) throws BuildException { validate(); final Ant ant = (Ant) project.createTask(ant); ant.setInheritAll(false); -ant.setAntfile(m_antfile.getName()); +ant.setAntfile(antfile.getName()); try { final File dir = -m_antfile.getParentFile().getCanonicalFile(); +antfile.getParentFile().getCanonicalFile(); ant.setDir(dir); } catch (final IOException ioe) { throw new BuildException(ioe.getMessage(), ioe); } -if (null != m_target) { -ant.setTarget(m_target); +if (null != target) { +ant.setTarget(target); } ant.execute(); -return m_destfile; +return destfile; } +/* + * Validates URL + */ private void validate() { -if (null == m_antfile) { +if (null == antfile) { final String message = Must specify Buildfile; throw new BuildException(message); } -if (null == m_destfile) { +if (null == destfile) { final String message = Must specify destination file; throw new BuildException(message); } } +/** + * Returns a string representation + * @return the string representation + */ public String toString() { -return Ant[ + m_antfile + == + m_destfile + ]; +return Ant[ + antfile + == + destfile + ]; } } 1.11 +23 -11 ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/LocationResolver.java Index: LocationResolver.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/LocationResolver.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- LocationResolver.java 9 Mar 2004 16:48:27 - 1.10 +++ LocationResolver.java 10 Dec 2004 10:58:19 - 1.11 @@ -27,26 +27,38 @@ * * @version $Revision$ $Date$ */ -public class LocationResolver -implements ExtensionResolver { -private String m_location; +public class LocationResolver implements ExtensionResolver { +private String location; +/** + * Sets the location for this resolver + * @param location the location + */ public void
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers AntResolver.java LocationResolver.java URLResolver.java
peterreilly2004/12/10 02:58:36 Modified: src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers Tag: ANT_16_BRANCH AntResolver.java LocationResolver.java URLResolver.java Log: sync Revision ChangesPath No revision No revision 1.6.2.5 +47 -23 ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java Index: AntResolver.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/AntResolver.java,v retrieving revision 1.6.2.4 retrieving revision 1.6.2.5 diff -u -r1.6.2.4 -r1.6.2.5 --- AntResolver.java 9 Mar 2004 17:01:46 - 1.6.2.4 +++ AntResolver.java 10 Dec 2004 10:58:36 - 1.6.2.5 @@ -29,63 +29,87 @@ * * @version $Revision$ $Date$ */ -public class AntResolver -implements ExtensionResolver { -private File m_antfile; -private File m_destfile; -private String m_target; - -public void setAntfile(File antfile) { -m_antfile = antfile; +public class AntResolver implements ExtensionResolver { +private File antfile; +private File destfile; +private String target; + +/** + * Sets the ant file + * @param antfile the ant file to set + */ +public void setAntfile(final File antfile) { +this.antfile = antfile; } -public void setDestfile(File destfile) { -m_destfile = destfile; +/** + * Sets the destination file + * @param destfile the destination file + */ +public void setDestfile(final File destfile) { +this.destfile = destfile; } +/** + * Sets the target + * @param target the target + */ public void setTarget(final String target) { -m_target = target; +this.target = target; } +/** + * Returns the resolved file + * @param extension the extension + * @param project the project + * @return the file resolved + * @throws BuildException if the file cannot be resolved + */ public File resolve(final Extension extension, - final Project project) -throws BuildException { + final Project project) throws BuildException { validate(); final Ant ant = (Ant) project.createTask(ant); ant.setInheritAll(false); -ant.setAntfile(m_antfile.getName()); +ant.setAntfile(antfile.getName()); try { final File dir = -m_antfile.getParentFile().getCanonicalFile(); +antfile.getParentFile().getCanonicalFile(); ant.setDir(dir); } catch (final IOException ioe) { throw new BuildException(ioe.getMessage(), ioe); } -if (null != m_target) { -ant.setTarget(m_target); +if (null != target) { +ant.setTarget(target); } ant.execute(); -return m_destfile; +return destfile; } - + +/* + * Validates URL + */ private void validate() { -if (null == m_antfile) { +if (null == antfile) { final String message = Must specify Buildfile; throw new BuildException(message); } -if (null == m_destfile) { +if (null == destfile) { final String message = Must specify destination file; throw new BuildException(message); } } +/** + * Returns a string representation + * @return the string representation + */ public String toString() { -return Ant[ + m_antfile + == + m_destfile + ]; +return Ant[ + antfile + == + destfile + ]; } } 1.6.2.5 +23 -11 ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/LocationResolver.java Index: LocationResolver.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/resolvers/LocationResolver.java,v retrieving revision 1.6.2.4 retrieving revision 1.6.2.5 diff -u -r1.6.2.4 -r1.6.2.5 --- LocationResolver.java 9 Mar 2004 17:01:46 - 1.6.2.4 +++ LocationResolver.java 10 Dec 2004 10:58:36 - 1.6.2.5 @@ -27,26 +27,38 @@ * * @version $Revision$ $Date$ */ -public class LocationResolver -implements ExtensionResolver { -private String m_location; +public class LocationResolver implements ExtensionResolver { +private String location; +/** + * Sets the location for
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
On Wed, 8 Dec 2004, Matt Benson [EMAIL PROTECTED] wrote: Hmm... maybe we should just change the unit test to read the files (using loadfile with a striplinebreaks filter) into properties and compare those rather than using FileUtils.contentEquals(...)? +1 Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
On Wed, 8 Dec 2004, Dominique Devienne [EMAIL PROTECTED] wrote: Isn't the alternative simply to check in the expected files are binary to avoid line ending conversions at all? Won't work since the result of running checksum produces platfirm dependent line ends. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
On Wed, 08 Dec 2004, Martijn Kruithof [EMAIL PROTECTED] wrote: I actually used the same technique as proposed in the bug report on the recorder test cases. Stefan modified that one in such a way that not the files from cvs are fixed but copies of those files. I mainly did so since otherwise you modify your working copy (at least if the original line endings when the files have been checked in are different from your local platform). We shouldn't change the files we've checked out. We already modify the timestamp of jar.xml on each testrun and CVS thinks it has been changed until you do the next cvs up. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CVS-Snapshot
On Fri, 10 Dec 2004, Jan Materne [EMAIL PROTECTED] wrote: Just for comparison ... Forrest has, httpd has, lenya has, maven not, spamassasin has, ... Hmm, looks as if the script stopped working for the project that have not converted to SVN yet. Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
If this is related to MD5 checksums, they've recently been proven to not be conclusive proof that the content of the file is the same as the checksum, ie two different files can create the same checksum under certain conditions. Not sure if this is relevant to the discussion http://developers.slashdot.org/article.pl?sid=04/12/07/2019244tid=93tid=172tid=8 /we can create 'doppelganger' blocks (my term) anywhere inside a file that may be swapped out, one for another, without altering the final MD5 hash. This lets us create any number of binary-inequal files with the same md5sum. But MD5 uses an appendable cascade construction -- in other words, if you happen to find yourself with two files that MD5 to the same hash, an arbitrary payload can be applied to both files and they'll still have the same hash./ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Patch] another variable visibility change - ScriptDef
Just to remove whiny messages - although the compiler believes it will also help performance Kev Index: ScriptDef.java === RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java,v retrieving revision 1.15 diff -u -r1.15 ScriptDef.java --- ScriptDef.java 7 Jul 2004 15:16:40 - 1.15 +++ ScriptDef.java 10 Dec 2004 11:40:12 - @@ -86,7 +86,7 @@ */ public static class Attribute { /** The attribute name */ -private String name; +protected String name; /** * Set the attribute name @@ -112,13 +112,13 @@ */ public static class NestedElement { /** The name of the neseted element */ -private String name; +protected String name; /** The Ant type to which this nested element corresponds. */ -private String type; +protected String type; /** The class to be created for this nested element */ -private String className; +protected String className; /** * set the tag name for this nested element - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Patch] removed deprecated methods and changed variable scope (private-protected) ProjectHelperImpl
Kev Jackson wrote: - swapped out deprecated code where the replacement code was obvious - left some deprecated methods where I wasn't sure - changed visibility of class variables from private to protected We will not be changing private to protected. As much as possible all fields should be private and there should be very few protected methods. For current released code, it is not possible to change protected fields to private fields due to BC consideration. still showing 1700+ warnings/errors :( but it is coming down! 8-) Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Patch] removed deprecated methods and changed variable scope (private-protected) ProjectHelperImpl
Kev Jackson wrote: We will not be changing private to protected. As much as possible all fields should be private and there should be very few protected methods. For current released code, it is not possible to change protected fields to private fields due to BC consideration. OK, I agree that all fields *should* be private, but in these cases, the fields are in inner classes (I never declare more than one class in a source file, so I'm not sure that all of these are inner classes, but bear with me), so the visibility of the field is restricted to the Class that the inner class is in correct? And as such it is actually private to other classes even if it's declared protected. Yes you are correct about the visiblity, however it is not necessary to do this (even if eclipse does whine!). The problem is that there will be a big pile of good protected keywords when one is looking for bad protected keywords, the rule no protected fields is easier to follow than no protected fields, except where eclipse whines! Peter Or have I got my visibility/scope rules muddled. still showing 1700+ warnings/errors :( but it is coming down! 8-) Slowly, very slowly! Kev - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32631] New: - allow includes / excludes for fileset references
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32631. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32631 Summary: allow includes / excludes for fileset references Product: Ant Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Core tasks AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] If you define the following fileset as the whole webapp: fileset id=webapp !-- ... -- /fileset .. then the following constrained reference should include only the WEB-INF directory of the webapp: fileset refid=webapp includes=WEB-INF/**/ -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32631] - allow includes / excludes for fileset references
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32631. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32631 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 14:06 --- The attributes includes and excludes are - simply spoken - an easier way for defining the include/exclude selectors. fileset dir=. includes=WEB-INF// is the same as fileset dir=. include name=WEB-INF// /fileset Adding these two attributes together with refid would result in the question why not using all the other selectors too. That would result in a completely different meaning. refid refers to an existing ProjectComponent (not only filesets) as it was defined earlier. You want to use that as a template for defining new. But you can solve your need: fileset id=webapp.only ... includes=WEB-INF// fileset id=webapp.rest ... excludes=WEB-INF// Then uses both references. copy|javac|... fileset refid=webapp.only/ fileset refid=webapp.rest/ / -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32632] New: - pattern / nested patternset in filterset
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32632. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32632 Summary: pattern / nested patternset in filterset Product: Ant Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Core tasks AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] filters / filterchains / filterreaders should all allow for patterns and nested patternsets. copy todir=${deploy.dir} fileset refid=webapp/ filterset filter token=DATE value=${TODAY}/ patternset id=sources include name=**/*.xml/ /patternset /filterset /copy This should apply the filters of the filterset only to files of the fileset matching the patterns of the patternset. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32631] - allow includes / excludes for fileset references
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32631. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32631 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 14:16 --- .. then allow all selectors. With http://antifact.sf.net you can import filesets from other modules. Every module exports its artifacts as filesets with ids. If you import filesets (artifacts) from other modules / build files, you don't define the filesets yourself. They are defined by someone else. You can only use them as they are. Then it would be handy, if you could refine the using my proposed construct. This extensions is IMHO much better than nested filesets or sets of filesets as described in other feature requests. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks copy.html
peterreilly2004/12/10 05:17:51 Modified:docs/manual/CoreTasks copy.html Log: document using a filenamemapper type in place of the mapper element Revision ChangesPath 1.29 +5 -3 ant/docs/manual/CoreTasks/copy.html Index: copy.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/copy.html,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- copy.html 7 Dec 2004 23:42:41 - 1.28 +++ copy.html 10 Dec 2004 13:17:51 - 1.29 @@ -151,6 +151,10 @@ href=../CoreTypes/mapper.htmlmapper/a element. The default mapper used by codelt;copygt;/code is the a href=../CoreTypes/mapper.html#identity-mapperidentity mapper/a./p + p +emSince Ant 1.6.3/em, +one can use a filenamemapper type in place of the mapper element. + /p h4filterset/h4 pa href=../CoreTypes/filterset.htmlFilterSet/as are used to replace @@ -199,9 +203,7 @@ pre lt;copy todir=quot;../backup/dirquot;gt; lt;fileset dir=quot;src_dirquot;/gt; -lt;mappergt; -lt;globmapper from=quot;*quot; to=quot;*.bakquot;/gt; -lt;/mappergt; +lt;globmapper from=quot;*quot; to=quot;*.bakquot;/gt; lt;/copygt; /pre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Copy.java
peterreilly2004/12/10 05:21:54 Modified:docs/manual/CoreTasks Tag: ANT_16_BRANCH copy.html src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH Copy.java Log: sync: copy's filenamemapper type support Revision ChangesPath No revision No revision 1.19.2.10 +5 -3 ant/docs/manual/CoreTasks/copy.html Index: copy.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/copy.html,v retrieving revision 1.19.2.9 retrieving revision 1.19.2.10 diff -u -r1.19.2.9 -r1.19.2.10 --- copy.html 7 Dec 2004 23:43:22 - 1.19.2.9 +++ copy.html 10 Dec 2004 13:21:50 - 1.19.2.10 @@ -152,6 +152,10 @@ href=../CoreTypes/mapper.htmlmapper/a element. The default mapper used by codelt;copygt;/code is the a href=../CoreTypes/mapper.html#identity-mapperidentity mapper/a./p + p +emSince Ant 1.6.3/em, +one can use a filenamemapper type in place of the mapper element. + /p h4filterset/h4 pa href=../CoreTypes/filterset.htmlFilterSet/as are used to replace @@ -200,9 +204,7 @@ pre lt;copy todir=quot;../backup/dirquot;gt; lt;fileset dir=quot;src_dirquot;/gt; -lt;mappergt; -lt;globmapper from=quot;*quot; to=quot;*.bakquot;/gt; -lt;/mappergt; +lt;globmapper from=quot;*quot; to=quot;*.bakquot;/gt; lt;/copygt; /pre No revision No revision 1.66.2.7 +11 -1 ant/src/main/org/apache/tools/ant/taskdefs/Copy.java Index: Copy.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v retrieving revision 1.66.2.6 retrieving revision 1.66.2.7 diff -u -r1.66.2.6 -r1.66.2.7 --- Copy.java 1 Sep 2004 07:02:23 - 1.66.2.6 +++ Copy.java 10 Dec 2004 13:21:51 - 1.66.2.7 @@ -290,6 +290,16 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ +public void add(FileNameMapper fileNameMapper) { +createMapper().add(fileNameMapper); +} + + +/** * Sets the character encoding * @param encoding the character encoding * @since 1.32, Ant 1.5 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
About macrodef in the trenches
This past two weeks, I've worked on coming up with a generic build file for our multiple projects, which I'd say are 80% to 99% common from one project to the next. Of course, I'm using heavily import, target overriding, and macrodef, but even with these fine features, it's not always easy to accomodate the variations from one build to the next, especially if I want to avoid having to rewrite whole tasks/targets. To achieve this maximum reuse, and minimum overriding, i.e. to avoid being forced to rewrite whole tasks, I've defined complex macros with built-in conditionals, and lots of default attributes. Alas, there's no default 'value' for macro elements, so providing default tags for a macro element is currently not possible. I believe this lack of element default makes macrodef less powerful that it can be. So finally today I had a look at the macrodef code, and tried to understand how things worked under the hood. I was surprised to find out I understood the code ;-) (if I glossed over most of the UE/RC cuisine that is). BTW, I'm amazed this can all be implemented in a couple of tasks with no changes to the framework itself. The new fully dynamic nature of Ant 1.6 (everything's a UE) is powerful indeed! I then proceeded to copy MacroDef/MacroInstance to my own antlib, and amazingly after repackaging and adding a single import, everything worked fine. (I duplicate the code because we only use an official Ant release.) I then tweaked macrodef to add the following features: 1) Everytime a macro attribute or element is explicitly defined in a macro instance (where the macro is used), I define an additional macro attribute (local property in the code) which allows to find out in the macro body whether the attribute or element was explicitly used/specified. When an 'foo' attribute is used, I define '@foo?' with value of true. When an 'bar' element is used, I define 'bar?' with value of true My macro bodies/impls then do things or not (or differently) based on this info. For example: bm:macrodef name=my-copy ... attribute name=tos default=/dev/null / sequential ... bm:sequential ifTrue=@[EMAIL PROTECTED] copy file=@{tos} tofile=... / /bm:sequential /sequential /bm:macrodef bm:macrodef name=my-module-image ... element name=sources optional=true / sequential ... bm:sequential ifTrue=@[EMAIL PROTECTED] zip destfile=@{todir}/sdk/src.zip sources / /zip /bm:sequential /sequential /bm:macrodef 2) Allow defining an macro element 'default value'. Instead of the default being inside the macrodef element, its inside the macro sequential where the element is used. I did it this way because the implementation was easier, and it makes it easy to read the macro impl, although it could be confusing to some I guess?! If a macro element is not explicitly specified in the macro instance, and the element is optional, then the 'default value' from the macro definition is used. If specified, the macro instance value is used as usual otherwise. For example: bm:macrodef name=my-register ... element name=patterns optional=true / sequential ds:register ... ... fileset dir=@{dir} patterns include name=**/*.class / exclude name=**/test/*Test.class / /patterns /fileset /ds:register /sequential /bm:macrodef The macro above defaults the patterns element to 1 include + 1 exclude. 3) When coming up with elements a macro could contain, I often end up wanting to contain a classpath macro element that I want to pass in to java or another task taking a classpath. If I can't use the single implicit element for some reason, I then have to do something ugly: macrodef name=ugly ... element name=my-classpath optional=true / sequential ... java ... my-classpath / /java /sequential /macrodef and I'm forced to use: ugly my-classpath classpath refid=classpath / /my-classpath /ugly If I throw in element defaults from (2), the macro becomes: macrodef name=ugly ... element name=my-classpath optional=true / sequential ... java ... my-classpath classpath refid=classpath / /my-classpath /java /sequential /macrodef To work around this, I added a new useContentOnly attribute to element, which defaults to true for BC, but when false, allows to pass in the element itself as-is, as defined in the macro definition or instance. I can now do macrodef name=nicer ... element name=classpath optional=true useContentOnly=false / sequential ... java ... classpath refid=classpath / /java
Re: About macrodef in the trenches
All these features sould great. 1) this attribute is good. however, it is only really usefull in combination with the iftrue attribute, or with ant-contrib if task 2) a default value for the element is good. The default value should be in the declaration, but it is ok to have it the body of the macrodef. 3) this sounds good if a little stange initially. 4) this is good as well, if one is useing elements with macrodefs a lot. It may be a bit confusing. I would say go for it! Peter Dominique Devienne wrote: This past two weeks, I've worked on coming up with a generic build file for our multiple projects, which I'd say are 80% to 99% common from one project to the next. Of course, I'm using heavily import, target overriding, and macrodef, but even with these fine features, it's not always easy to accomodate the variations from one build to the next, especially if I want to avoid having to rewrite whole tasks/targets. To achieve this maximum reuse, and minimum overriding, i.e. to avoid being forced to rewrite whole tasks, I've defined complex macros with built-in conditionals, and lots of default attributes. Alas, there's no default 'value' for macro elements, so providing default tags for a macro element is currently not possible. I believe this lack of element default makes macrodef less powerful that it can be. So finally today I had a look at the macrodef code, and tried to understand how things worked under the hood. I was surprised to find out I understood the code ;-) (if I glossed over most of the UE/RC cuisine that is). BTW, I'm amazed this can all be implemented in a couple of tasks with no changes to the framework itself. The new fully dynamic nature of Ant 1.6 (everything's a UE) is powerful indeed! I then proceeded to copy MacroDef/MacroInstance to my own antlib, and amazingly after repackaging and adding a single import, everything worked fine. (I duplicate the code because we only use an official Ant release.) I then tweaked macrodef to add the following features: 1) Everytime a macro attribute or element is explicitly defined in a macro instance (where the macro is used), I define an additional macro attribute (local property in the code) which allows to find out in the macro body whether the attribute or element was explicitly used/specified. When an 'foo' attribute is used, I define '@foo?' with value of true. When an 'bar' element is used, I define 'bar?' with value of true My macro bodies/impls then do things or not (or differently) based on this info. For example: bm:macrodef name=my-copy ... attribute name=tos default=/dev/null / sequential ... bm:sequential ifTrue=@[EMAIL PROTECTED] copy file=@{tos} tofile=... / /bm:sequential /sequential /bm:macrodef bm:macrodef name=my-module-image ... element name=sources optional=true / sequential ... bm:sequential ifTrue=@[EMAIL PROTECTED] zip destfile=@{todir}/sdk/src.zip sources / /zip /bm:sequential /sequential /bm:macrodef 2) Allow defining an macro element 'default value'. Instead of the default being inside the macrodef element, its inside the macro sequential where the element is used. I did it this way because the implementation was easier, and it makes it easy to read the macro impl, although it could be confusing to some I guess?! If a macro element is not explicitly specified in the macro instance, and the element is optional, then the 'default value' from the macro definition is used. If specified, the macro instance value is used as usual otherwise. For example: bm:macrodef name=my-register ... element name=patterns optional=true / sequential ds:register ... ... fileset dir=@{dir} patterns include name=**/*.class / exclude name=**/test/*Test.class / /patterns /fileset /ds:register /sequential /bm:macrodef The macro above defaults the patterns element to 1 include + 1 exclude. 3) When coming up with elements a macro could contain, I often end up wanting to contain a classpath macro element that I want to pass in to java or another task taking a classpath. If I can't use the single implicit element for some reason, I then have to do something ugly: macrodef name=ugly ... element name=my-classpath optional=true / sequential ... java ... my-classpath / /java /sequential /macrodef and I'm forced to use: ugly my-classpath classpath refid=classpath / /my-classpath /ugly If I throw in element defaults from (2), the macro becomes: macrodef name=ugly ... element name=my-classpath optional=true / sequential ... java ... my-classpath classpath refid=classpath / /my-classpath /java /sequential /macrodef To work
cvs commit: ant/src/testcases/org/apache/tools/ant/util ClasspathUtilsTest.java
peterreilly2004/12/10 07:18:57 Modified:.WHATSNEW src/main/org/apache/tools/ant/util ClasspathUtils.java Added: src/testcases/org/apache/tools/ant/util ClasspathUtilsTest.java Log: with the bugzilla change 30161 it is not necessary to place Path.systemClasspath in the antclassloader Doing so causes resources to appear twice Revision ChangesPath 1.693 +4 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.692 retrieving revision 1.693 diff -u -r1.692 -r1.693 --- WHATSNEW 7 Dec 2004 10:29:32 - 1.692 +++ WHATSNEW 10 Dec 2004 15:18:57 - 1.693 @@ -174,6 +174,10 @@ * Incorrect classloader parent in junittask when using with ant-junit.jar and junit.jar not in the project classloader. Bugzilla report 28474. +* getResources() on the classloader returned by ClasspathUtils would see each resource + twice - if the resource is in the project classpath and if the classloader is requested + with a null path. + Changes from Ant 1.6.1 to Ant 1.6.2 === 1.13 +7 -9 ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java Index: ClasspathUtils.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ClasspathUtils.java 14 Apr 2004 15:42:08 - 1.12 +++ ClasspathUtils.java 10 Dec 2004 15:18:57 - 1.13 @@ -156,13 +156,13 @@ * 'ant.reuse.loader' this will try to reuse the perviously * created loader with that id, and of course store it there upon * creation./p - * @param path Path object to be used as classpath for this classloader - * @param loaderId identification for this Loader, + * @param path Path object to be used as classpath for this classloader + * @param loaderId identification for this Loader, * @param reverseLoader if set to true this new loader will take - * precedence over it's parent (which is contra the regular - * @param p Ant Project where the handled components are living in. - * classloader behaviour) - * @return ClassLoader that uses the Path as its classpath. + * precedence over it's parent (which is contra the regular + * classloader behaviour) + * @param p Ant Project where the handled components are living in. + * @return ClassLoader that uses the Path as its classpath. */ public static ClassLoader getClassLoaderForPath( Project p, Path path, String loaderId, boolean reverseLoader, @@ -205,9 +205,7 @@ Project p, Path path, boolean reverseLoader) { - -AntClassLoader acl = p.createClassLoader(path != null - ? path : Path.systemClasspath); +AntClassLoader acl = p.createClassLoader(path); if (reverseLoader) { acl.setParentFirst(false); acl.addJavaLibraries(); 1.1 ant/src/testcases/org/apache/tools/ant/util/ClasspathUtilsTest.java Index: ClasspathUtilsTest.java === /* * Copyright 2000-2002,2004 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. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.tools.ant.util; import java.io.File; import java.io.IOException; import java.util.Enumeration; import junit.framework.TestCase; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Path; /** * Test case for ClasspathUtils * */ public class ClasspathUtilsTest extends TestCase { private Project p; public ClasspathUtilsTest(String name) { super(name); } public void setUp() { p = new Project(); p.init(); } public void testOnlyOneInstance() { Enumeration enumeration; String list
cvs commit: ant/src/testcases/org/apache/tools/ant/util ClasspathUtilsTest.java
peterreilly2004/12/10 07:20:11 Modified:.Tag: ANT_16_BRANCH WHATSNEW src/main/org/apache/tools/ant/util Tag: ANT_16_BRANCH ClasspathUtils.java Added: src/testcases/org/apache/tools/ant/util Tag: ANT_16_BRANCH ClasspathUtilsTest.java Log: sync Revision ChangesPath No revision No revision 1.503.2.147 +4 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.146 retrieving revision 1.503.2.147 diff -u -r1.503.2.146 -r1.503.2.147 --- WHATSNEW 7 Dec 2004 10:30:35 - 1.503.2.146 +++ WHATSNEW 10 Dec 2004 15:20:10 - 1.503.2.147 @@ -75,6 +75,10 @@ * Incorrect classloader parent in junittask when using with ant-junit.jar and junit.jar not in the project classloader. Bugzilla report 28474. +* getResources() on the classloader returned by ClasspathUtils would see each resource + twice - if the resource is in the project classpath and if the classloader is requested + with a null path. + Changes from Ant 1.6.1 to Ant 1.6.2 === No revision No revision 1.8.2.5 +7 -9 ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java Index: ClasspathUtils.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/ClasspathUtils.java,v retrieving revision 1.8.2.4 retrieving revision 1.8.2.5 diff -u -r1.8.2.4 -r1.8.2.5 --- ClasspathUtils.java 14 Apr 2004 15:42:41 - 1.8.2.4 +++ ClasspathUtils.java 10 Dec 2004 15:20:11 - 1.8.2.5 @@ -156,13 +156,13 @@ * 'ant.reuse.loader' this will try to reuse the perviously * created loader with that id, and of course store it there upon * creation./p - * @param path Path object to be used as classpath for this classloader - * @param loaderId identification for this Loader, + * @param path Path object to be used as classpath for this classloader + * @param loaderId identification for this Loader, * @param reverseLoader if set to true this new loader will take - * precedence over it's parent (which is contra the regular - * @param p Ant Project where the handled components are living in. - * classloader behaviour) - * @return ClassLoader that uses the Path as its classpath. + * precedence over it's parent (which is contra the regular + * classloader behaviour) + * @param p Ant Project where the handled components are living in. + * @return ClassLoader that uses the Path as its classpath. */ public static ClassLoader getClassLoaderForPath( Project p, Path path, String loaderId, boolean reverseLoader, @@ -205,9 +205,7 @@ Project p, Path path, boolean reverseLoader) { - -AntClassLoader acl = p.createClassLoader(path != null - ? path : Path.systemClasspath); +AntClassLoader acl = p.createClassLoader(path); if (reverseLoader) { acl.setParentFirst(false); acl.addJavaLibraries(); No revision No revision 1.1.2.1 +0 -0 ant/src/testcases/org/apache/tools/ant/util/ClasspathUtilsTest.java Index: ClasspathUtilsTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/util/ClasspathUtilsTest.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 28782] - Antlib ClassLoading issues in J2EE environment
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=28782. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=28782 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 16:23 --- Hi Claude, the change made by Jesse should do the same as this patch. The modification to Project is not necesary are the parent classloader has already been set correctly. Can you check to see if ant 1.6.2 works correctly for you? -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32488] - Improvement to 'spawn' attribute
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32488. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32488 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 16:36 --- I forgot about apply, I was only thinking about exec, but of cource there are others.. As regards the antlib question, this should be on [EMAIL PROTECTED] This sort of stuff would be possible with the follows small additions to ant ;-) 1) allow any task to be run in the antlib (easy mod - initial implementation of antlib) 2) local properties - one would be set properties in an antlib without affecting the users of the antlib 3) have if and unless attributes for each task antlib local-property name=is.unix/ condition property=is.unix os family=unix/ /condition typedef name=kill classname=..UnixKiller if=is.unix/ typedef name=kill classname=..WindowKiller unless=is.unix/ /antlib -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 29248] - Ant does not automatically parallelize independent targets.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=29248. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=29248 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 16:47 --- Make uses the -j option for parallel tasks. From make --help: -j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg. I strongly agree with the first post that ant should be able to decide when things could be run in parallel. I like the idea of being able to turn parallelization on and off at the command line because sometimes I care about accurate log output more than I care about speed and sometimes I just want to build something ASAP. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: About macrodef in the trenches
Thanks for the feedback Peter. I'll be off line most of Dec, so for now I'll just attach my modified MacroDef/Instance files in bugzilla until I can properly try to integrate it to Ant (it's not very tested yet, and not unit tested at all either). I worked off the 1.6 branch anyway, and this would need to happen in the HEAD I guess, no? About (1), you're right. I used my bm:sequential which is more like xsl:if than ac:if, because it has no then or else block. 90% of the time, I don't need if/then/else, just if. I find having conditions on sequential very natural and the Ant way ;-) (2) I initialy thought about putting it in the declaration, but I didn't think I could pull it off. And after using it, I thought it was easier to read the macro code with the defaults inside the macro impl instead of in the element declaration. (3) I agree it requires to get used to, but for the client code actually looks more 'normal' and task-like. Like (4), one doesn't have to use it. (4) Again, it's a question of reuse. I don't deny using @{attr} in the macro instance looks strange, but I did naturally try to use it with the regular Ant macrodef to learn it didn't work. I wanted to avoid duplicate some info I had already entered in a macro attribute. I'd say it's a nice to have thing, and one doesn't have to use it. BTW, after droping this code in my Antlib, my checkstyle Javadocs error count jumped from 0 to 35 ;-) I'll try to fix this too. (I have a checkstyle config for Javadocs only). --DD From: Peter Reilly [mailto:[EMAIL PROTECTED] Sent: Fri 12/10/2004 9:15 AM To: Ant Developers List Subject: Re: About macrodef in the trenches All these features sould great. 1) this attribute is good. however, it is only really usefull in combination with the iftrue attribute, or with ant-contrib if task 2) a default value for the element is good. The default value should be in the declaration, but it is ok to have it the body of the macrodef. 3) this sounds good if a little stange initially. 4) this is good as well, if one is useing elements with macrodefs a lot. It may be a bit confusing. I would say go for it! Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32638] - Enhancement to macrodef to support new feature.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32638. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32638 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:02 --- Created an attachment (id=13725) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=13725action=view) Modified Ant 1.6 based MacroDef.java Simply add the useContentOnly attribute to a macrodef element. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32638] - Enhancement to macrodef to support new feature.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32638. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32638 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:04 --- Created an attachment (id=13726) -- (http://issues.apache.org/bugzilla/attachment.cgi?id=13726action=view) Modified Ant 1.6 based MacroInstance.java Modifies execute() and copy() to add all the new macrodef features. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32631] - allow includes / excludes for fileset references
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32631. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32631 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:07 --- That's just not what id/refid DO. refid is a link to a previously defined object. A significant amount of code in Ant serves the purpose of enforcing the principle that to define any other attribute in conjunction with refid is an error, not only on filesets but most if not all tasks and types. The normal way to do this is by defining the patternsets and selectors that make your fileset what it is and mix and match these by refid into different filesets. Another possible means of defining a fileset for later refinement might involve the presetdef task. These are the options open to you today. If you have no control over the template filesets the only solution I see is a custom task. In the future it might be possible to provide such a task to obtain a cloned fileset instance (possibly of any Cloneable object). -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32632] - pattern / nested patternset in filterset
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32632. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32632 [EMAIL PROTECTED] changed: What|Removed |Added Severity|normal |enhancement Status|NEW |RESOLVED Resolution||WORKSFORME --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:10 --- You can do this with multiple copy tasks. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: About macrodef in the trenches
I've never used macrodef in Ant, but would say that I'd find a template definition easiest to understand with the following structure: define id=t parameters parameter id=x ... (gives default value) /parameter /parameters body ... /body /define and usage of the form: apply refid=t binding id=x (maps to a parameter) ... (gives actual value) /binding /apply or something like that. You might even want to indicate that a given parameter is mandatory by not specifying a default for the parameter. How does that relate to macrodef? Can this approach be used? Is it worth it? Just my tuppence worth. ;n) Phil On Fri, 2004-12-10 at 15:58, Dominique Devienne wrote: Thanks for the feedback Peter. I'll be off line most of Dec, so for now I'll just attach my modified MacroDef/Instance files in bugzilla until I can properly try to integrate it to Ant (it's not very tested yet, and not unit tested at all either). I worked off the 1.6 branch anyway, and this would need to happen in the HEAD I guess, no? About (1), you're right. I used my bm:sequential which is more like xsl:if than ac:if, because it has no then or else block. 90% of the time, I don't need if/then/else, just if. I find having conditions on sequential very natural and the Ant way ;-) (2) I initialy thought about putting it in the declaration, but I didn't think I could pull it off. And after using it, I thought it was easier to read the macro code with the defaults inside the macro impl instead of in the element declaration. (3) I agree it requires to get used to, but for the client code actually looks more 'normal' and task-like. Like (4), one doesn't have to use it. (4) Again, it's a question of reuse. I don't deny using @{attr} in the macro instance looks strange, but I did naturally try to use it with the regular Ant macrodef to learn it didn't work. I wanted to avoid duplicate some info I had already entered in a macro attribute. I'd say it's a nice to have thing, and one doesn't have to use it. BTW, after droping this code in my Antlib, my checkstyle Javadocs error count jumped from 0 to 35 ;-) I'll try to fix this too. (I have a checkstyle config for Javadocs only). --DD From: Peter Reilly [mailto:[EMAIL PROTECTED] Sent: Fri 12/10/2004 9:15 AM To: Ant Developers List Subject: Re: About macrodef in the trenches All these features sould great. 1) this attribute is good. however, it is only really usefull in combination with the iftrue attribute, or with ant-contrib if task 2) a default value for the element is good. The default value should be in the declaration, but it is ok to have it the body of the macrodef. 3) this sounds good if a little stange initially. 4) this is good as well, if one is useing elements with macrodefs a lot. It may be a bit confusing. I would say go for it! Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Phil Weighill-Smith [EMAIL PROTECTED] Volantis Systems
DO NOT REPLY [Bug 32638] New: - Enhancement to macrodef to support new feature.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32638. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32638 Summary: Enhancement to macrodef to support new feature. Product: Ant Version: 1.6.2 Platform: PC OS/Version: Windows XP Status: NEW Severity: enhancement Priority: P2 Component: Core AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] From the email 'About macrodef in the trenches' I sent out today: This past two weeks, I've worked on coming up with a generic build file for our multiple projects, which I'd say are 80% to 99% common from one project to the next. Of course, I'm using heavily import, target overriding, and macrodef, but even with these fine features, it's not always easy to accomodate the variations from one build to the next, especially if I want to avoid having to rewrite whole tasks/targets. To achieve this maximum reuse, and minimum overriding, i.e. to avoid being forced to rewrite whole tasks, I've defined complex macros with built-in conditionals, and lots of default attributes. Alas, there's no default 'value' for macro elements, so providing default tags for a macro element is currently not possible. I believe this lack of element default makes macrodef less powerful that it can be. So finally today I had a look at the macrodef code, and tried to understand how things worked under the hood. I was surprised to find out I understood the code ;-) (if I glossed over most of the UE/RC cuisine that is). BTW, I'm amazed this can all be implemented in a couple of tasks with no changes to the framework itself. The new fully dynamic nature of Ant 1.6 (everything's a UE) is powerful indeed! I then proceeded to copy MacroDef/MacroInstance to my own antlib, and amazingly after repackaging and adding a single import, everything worked fine. (I duplicate the code because we only use an official Ant release.) I then tweaked macrodef to add the following features: 1) Everytime a macro attribute or element is explicitly defined in a macro instance (where the macro is used), I define an additional macro attribute (local property in the code) which allows to find out in the macro body whether the attribute or element was explicitly used/specified. When an 'foo' attribute is used, I define '@foo?' with value of true. When an 'bar' element is used, I define 'bar?' with value of true My macro bodies/impls then do things or not (or differently) based on this info. For example: bm:macrodef name=my-copy ... attribute name=tos default=/dev/null / sequential ... bm:sequential ifTrue=@[EMAIL PROTECTED] copy file=@{tos} tofile=... / /bm:sequential /sequential /bm:macrodef bm:macrodef name=my-module-image ... element name=sources optional=true / sequential ... bm:sequential ifTrue=@[EMAIL PROTECTED] zip destfile=@{todir}/sdk/src.zip sources / /zip /bm:sequential /sequential /bm:macrodef 2) Allow defining an macro element 'default value'. Instead of the default being inside the macrodef element, its inside the macro sequential where the element is used. I did it this way because the implementation was easier, and it makes it easy to read the macro impl, although it could be confusing to some I guess?! If a macro element is not explicitly specified in the macro instance, and the element is optional, then the 'default value' from the macro definition is used. If specified, the macro instance value is used as usual otherwise. For example: bm:macrodef name=my-register ... element name=patterns optional=true / sequential ds:register ... ... fileset dir=@{dir} patterns include name=**/*.class / exclude name=**/test/*Test.class / /patterns /fileset /ds:register /sequential /bm:macrodef The macro above defaults the patterns element to 1 include + 1 exclude. 3) When coming up with elements a macro could contain, I often end up wanting to contain a classpath macro element that I want to pass in to java or another task taking a classpath. If I can't use the single implicit element for some reason, I then have to do something ugly: macrodef name=ugly ... element name=my-classpath optional=true / sequential ... java ... my-classpath / /java /sequential /macrodef and I'm forced to use: ugly my-classpath classpath refid=classpath / /my-classpath /ugly If I throw in
DO NOT REPLY [Bug 29248] - Ant does not automatically parallelize independent targets.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=29248. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=29248 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:24 --- How to compute the dependencies for this is an interesting problem that has not yet become clear to me. All that has to be written is a single class; if anyone wants to beat me to the punch, feel free. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 21421] - [Patch] to allow to run several targets without rerunning their dependencies
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=21421. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=21421 [EMAIL PROTECTED] changed: What|Removed |Added BugsThisDependsOn|29248 | -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 29248] - Ant does not automatically parallelize independent targets.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=29248. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=29248 [EMAIL PROTECTED] changed: What|Removed |Added OtherBugsDependingO|21421 | nThis|| -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32638] - Enhancement to macrodef to support new feature.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32638. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32638 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:41 --- Would that work? There wouldn't be any textual substitution by macroSubs, and my:sequential would know nothing about contents.element.set since not in the eral Project properties, and if you did put it in the project properties, then we have the usual tmp/immutable property issue. The properly pull it off, you'd need the notion of a proper AntContext, the macro instance one on top of the normal project one, no? That's why the ifTrue condition works will in this case, since it sidesteps the issue by letting macrodef do the macroSubs, and evaluate the result as a boolean. --DD -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32638] - Enhancement to macrodef to support new feature.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32638. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32638 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:46 --- The properly pull it off, you'd need the notion of a proper AntContext, the macro instance one on top of the normal project one, no? Yes, the previous version of the local-property patch does this, it is a local-property scope not the ant project context. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32639] New: - Jar task doesn't report missing file in fixed fileset
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32639. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32639 Summary: Jar task doesn't report missing file in fixed fileset Product: Ant Version: 1.6.1 Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Core tasks AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The Ant jar task does not report a missing file when passed a fixed fileset to add to a jar. When I run the Java jar command from the command line, I get an error message like the following... CleanThread.class : no such file or directory But when I run the Ant jar command, no such error message... [jar] JARs are never empty, they contain at least a manifest file [jar] Building jar: C:\home\LRIT\baseline\Release2\jar\ProductWatch.jar BUILD SUCCESSFUL Total time: 9 seconds Here is the jar command from my build file - !-- * jars one of the LRIT tools as an executable jar file * param1 ... tool directory (not used) * param2 ... manifest file * param3 ... executable jar file * reference: ToolExeSet ... files to go in executable jar file * (excluding the manifest) -- target name=-jarExe if=JAREXE mkdir dir=${JarDirPath}/ jar destfile=${JarDirPath}/${param3} manifest=${param2} update=false whenempty=fail fileset refid=ToolExeSet/ /jar /target The CleanThread.class is definitely in the ToolExeSet reference id, for when the file DOES exist, it gets added to the jar! What is happening? Thanks. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DO NOT REPLY [Bug 32639] - Jar task doesn't report missing file in fixed fileset
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32639. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32639 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:58 --- filesets do not work in a fixed mode, ask this question on the user mailing list -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks uptodate.html
peterreilly2004/12/10 09:10:08 Modified:docs/manual/CoreTasks uptodate.html Log: doc for use of filenamemaper in uptodate Revision ChangesPath 1.15 +4 -0 ant/docs/manual/CoreTasks/uptodate.html Index: uptodate.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/uptodate.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- uptodate.html 19 Nov 2004 09:07:09 - 1.14 +++ uptodate.html 10 Dec 2004 17:10:07 - 1.15 @@ -74,6 +74,10 @@ The mapper to attribute is relative to the target file, or to the dir attribute of the nested srcfiles element. /p + p +emSince Ant 1.6.3/em, +one can use a filenamemapper type in place of the mapper element. + /p h3Examples/h3 pre lt;uptodate property=quot;xmlBuild.notRequiredquot; targetfile=quot;${deploy}\xmlClasses.jarquot; gt; lt;srcfiles dir= quot;${src}/xmlquot; includes=quot;**/*.dtdquot;/gt; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks uptodate.html
peterreilly2004/12/10 09:11:41 Modified:src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH UpToDate.java docs/manual/CoreTasks Tag: ANT_16_BRANCH uptodate.html Log: sync: updatetodate filenamemapper type Revision ChangesPath No revision No revision 1.32.2.5 +9 -0 ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java Index: UpToDate.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v retrieving revision 1.32.2.4 retrieving revision 1.32.2.5 diff -u -r1.32.2.4 -r1.32.2.5 --- UpToDate.java 9 Mar 2004 17:01:34 - 1.32.2.4 +++ UpToDate.java 10 Dec 2004 17:11:41 - 1.32.2.5 @@ -117,6 +117,15 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ +public void add(FileNameMapper fileNameMapper) { +createMapper().add(fileNameMapper); +} + +/** * Evaluate (all) target and source file(s) to * see if the target(s) is/are up-to-date. */ No revision No revision 1.11.2.5 +4 -0 ant/docs/manual/CoreTasks/uptodate.html Index: uptodate.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/uptodate.html,v retrieving revision 1.11.2.4 retrieving revision 1.11.2.5 diff -u -r1.11.2.4 -r1.11.2.5 --- uptodate.html 19 Nov 2004 09:10:00 - 1.11.2.4 +++ uptodate.html 10 Dec 2004 17:11:41 - 1.11.2.5 @@ -75,6 +75,10 @@ The mapper to attribute is relative to the target file, or to the dir attribute of the nested srcfiles element. /p + p +emSince Ant 1.6.3/em, +one can use a filenamemapper type in place of the mapper element. + /p h3Examples/h3 pre lt;uptodate property=quot;xmlBuild.notRequiredquot; targetfile=quot;${deploy}\xmlClasses.jarquot; gt; lt;srcfiles dir= quot;${src}/xmlquot; includes=quot;**/*.dtdquot;/gt; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java
peterreilly2004/12/10 09:13:54 Modified:src/main/org/apache/tools/ant/taskdefs UpToDate.java Log: Checkstyle changes for UptoDate.java Obtained from: Kevin Jackson Revision ChangesPath 1.38 +39 -28ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java Index: UpToDate.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- UpToDate.java 6 Dec 2004 19:27:13 - 1.37 +++ UpToDate.java 10 Dec 2004 17:13:54 - 1.38 @@ -42,10 +42,10 @@ public class UpToDate extends Task implements Condition { -private String _property; -private String _value; -private File _sourceFile; -private File _targetFile; +private String property; +private String value; +private File sourceFile; +private File targetFile; private Vector sourceFileSets = new Vector(); protected Mapper mapperElement = null; @@ -56,8 +56,8 @@ * * @param property the name of the property to set if Target is up-to-date. */ -public void setProperty(String property) { -_property = property; +public void setProperty(final String property) { +this.property = property; } /** @@ -66,15 +66,15 @@ * * @param value the value to set the property to if Target is up-to-date */ -public void setValue(String value) { -_value = value; +public void setValue(final String value) { +this.value = value; } /** * Returns the value, or true if a specific value wasn't provided. */ private String getValue() { -return (_value != null) ? _value : true; +return (value != null) ? value : true; } /** @@ -83,8 +83,8 @@ * * @param file the file we are checking against. */ -public void setTargetFile(File file) { -_targetFile = file; +public void setTargetFile(final File file) { +this.targetFile = file; } /** @@ -93,19 +93,22 @@ * * @param file the file we are checking against the target file. */ -public void setSrcfile(File file) { -_sourceFile = file; +public void setSrcfile(final File file) { +this.sourceFile = file; } /** * Nested lt;srcfilesgt; element. + * @param fs the source files */ -public void addSrcfiles(FileSet fs) { +public void addSrcfiles(final FileSet fs) { sourceFileSets.addElement(fs); } /** * Defines the FileNameMapper to use (nested mapper element). + * @return a mapper to be configured + * @throws BuildException if more than one mapper is defined */ public Mapper createMapper() throws BuildException { if (mapperElement != null) { @@ -128,34 +131,35 @@ /** * Evaluate (all) target and source file(s) to * see if the target(s) is/are up-to-date. + * @return true if the target(s) is/are up-to-date */ public boolean eval() { -if (sourceFileSets.size() == 0 _sourceFile == null) { +if (sourceFileSets.size() == 0 sourceFile == null) { throw new BuildException(At least one srcfile or a nested + srcfiles element must be set.); } -if (sourceFileSets.size() 0 _sourceFile != null) { +if (sourceFileSets.size() 0 sourceFile != null) { throw new BuildException(Cannot specify both the srcfile + attribute and a nested srcfiles + element.); } -if (_targetFile == null mapperElement == null) { +if (targetFile == null mapperElement == null) { throw new BuildException(The targetfile attribute or a nested + mapper element must be set.); } // if the target file is not there, then it can't be up-to-date -if (_targetFile != null !_targetFile.exists()) { -log(The targetfile \ + _targetFile.getAbsolutePath() +if (targetFile != null !targetFile.exists()) { +log(The targetfile \ + targetFile.getAbsolutePath() + \ does not exist., Project.MSG_VERBOSE); return false; } // if the source file isn't there, throw an exception -if (_sourceFile != null !_sourceFile.exists()) { -throw new BuildException(_sourceFile.getAbsolutePath() +if (sourceFile != null !sourceFile.exists()) { +throw
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs UpToDate.java
peterreilly2004/12/10 09:14:09 Modified:src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH UpToDate.java Log: sync Revision ChangesPath No revision No revision 1.32.2.6 +39 -28ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java Index: UpToDate.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v retrieving revision 1.32.2.5 retrieving revision 1.32.2.6 diff -u -r1.32.2.5 -r1.32.2.6 --- UpToDate.java 10 Dec 2004 17:11:41 - 1.32.2.5 +++ UpToDate.java 10 Dec 2004 17:14:09 - 1.32.2.6 @@ -42,10 +42,10 @@ public class UpToDate extends Task implements Condition { -private String _property; -private String _value; -private File _sourceFile; -private File _targetFile; +private String property; +private String value; +private File sourceFile; +private File targetFile; private Vector sourceFileSets = new Vector(); protected Mapper mapperElement = null; @@ -56,8 +56,8 @@ * * @param property the name of the property to set if Target is up-to-date. */ -public void setProperty(String property) { -_property = property; +public void setProperty(final String property) { +this.property = property; } /** @@ -66,15 +66,15 @@ * * @param value the value to set the property to if Target is up-to-date */ -public void setValue(String value) { -_value = value; +public void setValue(final String value) { +this.value = value; } /** * Returns the value, or true if a specific value wasn't provided. */ private String getValue() { -return (_value != null) ? _value : true; +return (value != null) ? value : true; } /** @@ -83,8 +83,8 @@ * * @param file the file we are checking against. */ -public void setTargetFile(File file) { -_targetFile = file; +public void setTargetFile(final File file) { +this.targetFile = file; } /** @@ -93,19 +93,22 @@ * * @param file the file we are checking against the target file. */ -public void setSrcfile(File file) { -_sourceFile = file; +public void setSrcfile(final File file) { +this.sourceFile = file; } /** * Nested lt;srcfilesgt; element. + * @param fs the source files */ -public void addSrcfiles(FileSet fs) { +public void addSrcfiles(final FileSet fs) { sourceFileSets.addElement(fs); } /** * Defines the FileNameMapper to use (nested mapper element). + * @return a mapper to be configured + * @throws BuildException if more than one mapper is defined */ public Mapper createMapper() throws BuildException { if (mapperElement != null) { @@ -128,34 +131,35 @@ /** * Evaluate (all) target and source file(s) to * see if the target(s) is/are up-to-date. + * @return true if the target(s) is/are up-to-date */ public boolean eval() { -if (sourceFileSets.size() == 0 _sourceFile == null) { +if (sourceFileSets.size() == 0 sourceFile == null) { throw new BuildException(At least one srcfile or a nested + srcfiles element must be set.); } -if (sourceFileSets.size() 0 _sourceFile != null) { +if (sourceFileSets.size() 0 sourceFile != null) { throw new BuildException(Cannot specify both the srcfile + attribute and a nested srcfiles + element.); } -if (_targetFile == null mapperElement == null) { +if (targetFile == null mapperElement == null) { throw new BuildException(The targetfile attribute or a nested + mapper element must be set.); } // if the target file is not there, then it can't be up-to-date -if (_targetFile != null !_targetFile.exists()) { -log(The targetfile \ + _targetFile.getAbsolutePath() +if (targetFile != null !targetFile.exists()) { +log(The targetfile \ + targetFile.getAbsolutePath() + \ does not exist., Project.MSG_VERBOSE); return false; } // if the source file isn't there, throw an exception -if (_sourceFile != null !_sourceFile.exists()) { -throw new BuildException(_sourceFile.getAbsolutePath() +
DO NOT REPLY [Bug 32638] - Enhancement to macrodef to support new feature.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=32638. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=32638 --- Additional Comments From [EMAIL PROTECTED] 2004-12-10 17:29 --- Another idea would be to use local properties to say if an attribute/element is set or not, then one could use the usually ant idiom of using the if attribute to test for the presence of an attribute/element. macrodef name=x element name=contents optional=yes/ sequential my:sequential if=contents.element.set copy ../ /my:seqential /sequential /macrodef -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/compilers Jikes.java
bodewig 2004/12/10 09:29:04 Modified:src/main/org/apache/tools/ant/taskdefs/compilers Jikes.java Log: Try to help the Gump/Kaffe/Jikes build Revision ChangesPath 1.29 +9 -0 ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java Index: Jikes.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/Jikes.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- Jikes.java8 Dec 2004 07:57:04 - 1.28 +++ Jikes.java10 Dec 2004 17:29:04 - 1.29 @@ -203,6 +203,15 @@ int firstFileName = cmd.size(); logAndAddFilesToCompile(cmd); +// this is a quick hack to make things work in a +// Gump/Kaffe/Jikes combo. I promise I'll explain it later - +// and add a real solution as well ;-) Stefan +if (true.equals(System.getProperty(build.clonevm)) + Path.systemBootClasspath.size() 0) { +cmd.createArgument().setValue(-bootclasspath); +cmd.createArgument().setPath(Path.systemBootClasspath); +} + return executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java
mbenson 2004/12/10 10:28:45 Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java Log: Javadoc and LOC bumming Revision ChangesPath 1.35 +99 -104 ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java Index: AbstractFileSet.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- AbstractFileSet.java 12 Nov 2004 15:15:22 - 1.34 +++ AbstractFileSet.java 10 Dec 2004 18:28:45 - 1.35 @@ -66,10 +66,18 @@ private boolean isCaseSensitive = true; private boolean followSymlinks = true; +/** + * Construct a new codeAbstractFileSet/code. + */ public AbstractFileSet() { super(); } +/** + * Construct a new codeAbstractFileSet/code, shallowly cloned + * from the specified codeAbstractFileSet/code. + * @param fileset the codeAbstractFileSet/code to use as a template. + */ protected AbstractFileSet(AbstractFileSet fileset) { this.dir = fileset.dir; this.defaultPatterns = fileset.defaultPatterns; @@ -86,6 +94,7 @@ * * pYou must not set another attribute or nest elements inside * this element if you make it a reference./p + * @param r the codeReference/code to use. */ public void setRefid(Reference r) throws BuildException { if (dir != null || defaultPatterns.hasPatterns(getProject())) { @@ -102,17 +111,20 @@ /** * Sets the base-directory for this instance. + * @param dir the directory's codeFile/code instance. */ public void setDir(File dir) throws BuildException { if (isReference()) { throw tooManyAttributes(); } - this.dir = dir; } /** * Retrieves the base-directory for this instance. + * @param p the codeProject/code against which the + * reference is resolved, if set. + * @return codeFile/code. */ public File getDir(Project p) { if (isReference()) { @@ -123,6 +135,7 @@ /** * Creates a nested patternset. + * @return codePatternSet/code. */ public PatternSet createPatternSet() { if (isReference()) { @@ -134,7 +147,8 @@ } /** - * add a name entry on the include list + * Add a name entry to the include list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createInclude() { if (isReference()) { @@ -144,7 +158,8 @@ } /** - * add a name entry on the include files list + * Add a name entry to the include files list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createIncludesFile() { if (isReference()) { @@ -154,7 +169,8 @@ } /** - * add a name entry on the exclude list + * Add a name entry to the exclude list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createExclude() { if (isReference()) { @@ -164,7 +180,8 @@ } /** - * add a name entry on the excludes files list + * Add a name entry to the excludes files list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createExcludesFile() { if (isReference()) { @@ -175,15 +192,15 @@ /** * Creates a single file fileset. + * @param file the single codeFile/code included in this + * codeAbstractFileSet/code. */ public void setFile(File file) { if (isReference()) { throw tooManyAttributes(); } setDir(file.getParentFile()); - -PatternSet.NameEntry include = createInclude(); -include.setName(file.getName()); +createInclude().setName(file.getName()); } /** @@ -192,13 +209,12 @@ * * pPatterns may be separated by a comma or a space./p * - * @param includes the string containing the include patterns + * @param includes the codeString/code containing the include patterns. */ public void setIncludes(String includes) { if (isReference()) { throw tooManyAttributes(); } - defaultPatterns.setIncludes(includes); } @@ -208,62 +224,55 @@ * * pPatterns may be separated by a comma or a space./p * - * @param excludes the string containing the exclude patterns + * @param excludes the codeString/code containing the exclude patterns. */ public void
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Stefan Bodewig wrote: On Wed, 8 Dec 2004, Matt Benson [EMAIL PROTECTED] wrote: Hmm... maybe we should just change the unit test to read the files (using loadfile with a striplinebreaks filter) into properties and compare those rather than using FileUtils.contentEquals(...)? We could also add a FileUtil.contentEquals(...) variant that ignores differences in line endings. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Syncing
Hi, what are the conditions to merge to ANT_16_BRANCH as sync and not only to HEAD? Martijn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: ant/src/etc/testcases/taskdefs checksum.xml
Kev Jackson wrote: If this is related to MD5 checksums, they've recently been proven to not be conclusive proof that the content of the file is the same as the checksum, ie two different files can create the same checksum under certain conditions. Yes it is. Martijn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Syncing
--- Martijn Kruithof [EMAIL PROTECTED] wrote: Hi, what are the conditions to merge to ANT_16_BRANCH as sync and not only to HEAD? Off the top of my head, bugfixes most often go to the branch immediately or nearly so. For new features it probably depends on level of complexity and/or risk of unforeseen side effects including but not limited to breaking of BC. -Matt Martijn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Patch] small changes to CBZip2*
Kev Jackson wrote: question: Do we assume that when arrays are initialised they have an undefined value? Java requires newly created arrays to be filled with null/0/false acc. to type. There is no need to explicitly blank it. http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#23605 http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html#96595 -J. -- Jesse Glick mailto:[EMAIL PROTECTED] x22801 NetBeans, Open APIs http://www.netbeans.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java
mbenson 2004/12/10 13:49:32 Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java Log: More LOC bumming Revision ChangesPath 1.36 +14 -27 ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java Index: AbstractFileSet.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- AbstractFileSet.java 10 Dec 2004 18:28:45 - 1.35 +++ AbstractFileSet.java 10 Dec 2004 21:49:32 - 1.36 @@ -54,8 +54,8 @@ * pCommon base class for DirSet and FileSet./p * */ -public abstract class AbstractFileSet extends DataType implements Cloneable, -SelectorContainer { +public abstract class AbstractFileSet extends DataType +implements Cloneable, SelectorContainer { private PatternSet defaultPatterns = new PatternSet(); private Vector additionalPatterns = new Vector(); @@ -127,10 +127,7 @@ * @return codeFile/code. */ public File getDir(Project p) { -if (isReference()) { -return getRef(p).getDir(p); -} -return dir; +return (isReference()) ? getRef(p).getDir(p) : dir; } /** @@ -400,12 +397,10 @@ } Object o = getRefid().getReferencedObject(p); if (!getClass().isAssignableFrom(o.getClass())) { -String msg = getRefid().getRefId() + doesn\'t denote a -+ getDataTypeName(); -throw new BuildException(msg); -} else { -return (AbstractFileSet) o; +throw new BuildException(getRefid().getRefId() ++ doesn\'t denote a + getDataTypeName()); } +return (AbstractFileSet) o; } // SelectorContainer methods @@ -416,10 +411,8 @@ * @return whether any selectors are in this container. */ public boolean hasSelectors() { -if (isReference() getProject() != null) { -return getRef(getProject()).hasSelectors(); -} -return !(selectors.isEmpty()); +return (isReference() getProject() != null) +? getRef(getProject()).hasSelectors() : !(selectors.isEmpty()); } /** @@ -450,10 +443,8 @@ * @return the number of selectors in this container as an codeint/code. */ public int selectorCount() { -if (isReference() getProject() != null) { -return getRef(getProject()).selectorCount(); -} -return selectors.size(); +return (isReference() getProject() != null) +? getRef(getProject()).selectorCount() : selectors.size(); } /** @@ -462,10 +453,8 @@ * @return a codeFileSelector[]/code of the selectors in this container. */ public FileSelector[] getSelectors(Project p) { -if (isReference()) { -return getRef(p).getSelectors(p); -} -return (FileSelector[])(selectors.toArray( +return (isReference()) +? getRef(p).getSelectors(p) : (FileSelector[])(selectors.toArray( new FileSelector[selectors.size()])); } @@ -475,10 +464,8 @@ * @return an codeEnumeration/code of selectors. */ public Enumeration selectorElements() { -if (isReference() getProject() != null) { -return getRef(getProject()).selectorElements(); -} -return selectors.elements(); +return (isReference() getProject() != null) +? getRef(getProject()).selectorElements() : selectors.elements(); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java
mbenson 2004/12/10 13:52:32 Modified:src/main/org/apache/tools/ant/types Tag: ANT_16_BRANCH AbstractFileSet.java Log: Sync Revision ChangesPath No revision No revision 1.29.2.5 +115 -133 ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java Index: AbstractFileSet.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/AbstractFileSet.java,v retrieving revision 1.29.2.4 retrieving revision 1.29.2.5 diff -u -r1.29.2.4 -r1.29.2.5 --- AbstractFileSet.java 9 Mar 2004 17:01:54 - 1.29.2.4 +++ AbstractFileSet.java 10 Dec 2004 21:52:32 - 1.29.2.5 @@ -54,8 +54,8 @@ * pCommon base class for DirSet and FileSet./p * */ -public abstract class AbstractFileSet extends DataType implements Cloneable, -SelectorContainer { +public abstract class AbstractFileSet extends DataType +implements Cloneable, SelectorContainer { private PatternSet defaultPatterns = new PatternSet(); private Vector additionalPatterns = new Vector(); @@ -66,10 +66,18 @@ private boolean isCaseSensitive = true; private boolean followSymlinks = true; +/** + * Construct a new codeAbstractFileSet/code. + */ public AbstractFileSet() { super(); } +/** + * Construct a new codeAbstractFileSet/code, shallowly cloned + * from the specified codeAbstractFileSet/code. + * @param fileset the codeAbstractFileSet/code to use as a template. + */ protected AbstractFileSet(AbstractFileSet fileset) { this.dir = fileset.dir; this.defaultPatterns = fileset.defaultPatterns; @@ -86,6 +94,7 @@ * * pYou must not set another attribute or nest elements inside * this element if you make it a reference./p + * @param r the codeReference/code to use. */ public void setRefid(Reference r) throws BuildException { if (dir != null || defaultPatterns.hasPatterns(getProject())) { @@ -102,27 +111,28 @@ /** * Sets the base-directory for this instance. + * @param dir the directory's codeFile/code instance. */ public void setDir(File dir) throws BuildException { if (isReference()) { throw tooManyAttributes(); } - this.dir = dir; } /** * Retrieves the base-directory for this instance. + * @param p the codeProject/code against which the + * reference is resolved, if set. + * @return codeFile/code. */ public File getDir(Project p) { -if (isReference()) { -return getRef(p).getDir(p); -} -return dir; +return (isReference()) ? getRef(p).getDir(p) : dir; } /** * Creates a nested patternset. + * @return codePatternSet/code. */ public PatternSet createPatternSet() { if (isReference()) { @@ -134,7 +144,8 @@ } /** - * add a name entry on the include list + * Add a name entry to the include list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createInclude() { if (isReference()) { @@ -144,7 +155,8 @@ } /** - * add a name entry on the include files list + * Add a name entry to the include files list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createIncludesFile() { if (isReference()) { @@ -154,7 +166,8 @@ } /** - * add a name entry on the exclude list + * Add a name entry to the exclude list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createExclude() { if (isReference()) { @@ -164,7 +177,8 @@ } /** - * add a name entry on the excludes files list + * Add a name entry to the excludes files list. + * @return codePatternSet.NameEntry/code. */ public PatternSet.NameEntry createExcludesFile() { if (isReference()) { @@ -175,15 +189,15 @@ /** * Creates a single file fileset. + * @param file the single codeFile/code included in this + * codeAbstractFileSet/code. */ public void setFile(File file) { if (isReference()) { throw tooManyAttributes(); } setDir(file.getParentFile()); - -PatternSet.NameEntry include = createInclude(); -include.setName(file.getName()); +createInclude().setName(file.getName()); } /** @@ -192,13 +206,12 @@ * * pPatterns may be separated by a comma or a space./p
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=quot;${build}quot; classpath=quot;xyz.jarquot; debug=quot;onquot; + source=quot;1.4quot; /gt;/pre pcompiles all code.java/code files under the code${src}/code directory, and stores the code.class/code files in the code${build}/code directory. The classpath used includes codexyz.jar/code, and compiling with -debug information is on./p +debug information is on. The source level is 1.4, +so you can use codeassert/code statements./p pre lt;javac srcdir=quot;${src}quot; destdir=quot;${build}quot; fork=quot;truequot; + source=quot;1.2quot; + target=quot;1.2quot; /gt;/pre pcompiles all code.java/code files under the code${src}/code directory, and stores the code.class/code files in the code${build}/code directory. This will fork off the javac -compiler using the default codejavac/code executable./p +compiler using the default codejavac/code 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./p pre lt;javac srcdir=quot;${src}quot; destdir=quot;${build}quot; fork=quot;java$$javac.exequot; + source=quot;1.5quot; /gt;/pre pcompiles all code.java/code files under the code${src}/code directory, and stores the code.class/code files in the code${build}/code directory. This will fork off the javac compiler, using the executable named codejava$javac.exe/code. Note -that the code$/code sign needs to be escaped by a second one./p +that the code$/code sign needs to be escaped by a second one. +The source level is 1.5, so you can use generics./p pre lt;javac srcdir=quot;${src}quot; destdir=quot;${build}quot; @@ -455,7 +463,9 @@ The classpath used includes codexyz.jar/code, and debug information is on. Only files under codemypackage/p1/code and codemypackage/p2/code are used. All files in and below the codemypackage/p1/testpackage/code -directory are excluded from compilation./p +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./p pre lt;javac srcdir=quot;${src}:${src2}quot; destdir=quot;${build}quot; - 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=quot;${build}quot; classpath=quot;xyz.jarquot; debug=quot;onquot; + source=quot;1.4quot; /gt;/pre pcompiles all code.java/code files under the code${src}/code directory, and stores the code.class/code files in the code${build}/code directory. The classpath used includes codexyz.jar/code, and compiling with -debug information is on./p +debug information is on. The source level is 1.4, +so you can use codeassert/code statements./p pre lt;javac srcdir=quot;${src}quot; destdir=quot;${build}quot; fork=quot;truequot; + source=quot;1.2quot; + target=quot;1.2quot; /gt;/pre pcompiles all code.java/code files under the code${src}/code directory, and stores the code.class/code files in the code${build}/code directory. This will fork off the javac -compiler using the default codejavac/code executable./p +compiler using the default codejavac/code 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./p pre lt;javac srcdir=quot;${src}quot; destdir=quot;${build}quot; fork=quot;java$$javac.exequot; + source=quot;1.5quot; /gt;/pre pcompiles all code.java/code files under the code${src}/code directory, and stores the code.class/code files in the code${build}/code directory. This will fork off the javac compiler, using the executable named codejava$javac.exe/code. Note -that the code$/code sign needs to be escaped by a second one./p +that the code$/code sign needs to be escaped by a second one. +The source level is 1.5, so you can use generics./p pre lt;javac srcdir=quot;${src}quot; destdir=quot;${build}quot; @@ -455,7 +463,9 @@ The classpath used includes codexyz.jar/code, and debug information is on. Only files under codemypackage/p1/code and codemypackage/p2/code are used. All files in and below the codemypackage/p1/testpackage/code -directory are excluded from compilation./p +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./p pre lt;javac srcdir=quot;${src}:${src2}quot; destdir=quot;${build}quot; - 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 @@ /description import file=build.xml/ - property name=config.dir value=${etc.dir}/checkstyle/ + property name=config.dir location=${etc.dir}/checkstyle/ - property name=checkstyle.reportdir value=${build.dir}/reports/checkstyle/ - property name=checkstyle.raw value=${checkstyle.reportdir}/raw.xml/ - property name=stylesheet.html value=${config.dir}/checkstyle-frames.xsl/ - property name=stylesheet.text value=${config.dir}/checkstyle-text.xsl/ - property name=stylesheet.xdoc value=${config.dir}/checkstyle-xdoc.xsl/ + property name=checkstyle.reportdir location=${build.dir}/reports/checkstyle/ + property name=checkstyle.raw location=${checkstyle.reportdir}/raw.xml/ + property name=stylesheet.html location=${config.dir}/checkstyle-frames.xsl/ + property name=stylesheet.text location=${config.dir}/checkstyle-text.xsl/ + property name=stylesheet.xdoc location=${config.dir}/checkstyle-xdoc.xsl/ property name=checkstyle.basedir location=${java.dir}/ @@ -35,7 +35,7 @@ taskdef resource=simiantask.properties/ taskdef resource=checkstyletask.properties/ - target name=checkstyle description=-- checks Ant codebase according to ${config.dir}/chestyle-config + target name=checkstyle description=-- checks Ant codebase according to ${config.dir}/checkstyle-config mkdir dir=${checkstyle.reportdir}/ checkstyle config=${config.dir}/checkstyle-config failOnViolation=false formatter type=xml toFile=${checkstyle.raw}/ @@ -60,6 +60,11 @@ out=${checkstyle.reportdir}/report.txt /style /target + + target name=textreport-display depends=textreport description=-- generates a text checkstyle report and displays it immediately + loadfile property=report srcfile=${checkstyle.reportdir}/report.txt/ + echo${report}/echo + /target target name=xdocreport description=-- generates a xdoc checkstyle report style in=${checkstyle.raw} style=${stylesheet.xdoc} @@ -80,4 +85,4 @@ /simian /target -/project \ No newline at end of file +/project - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]