cvs commit: ant/xdocs contributors.xml
peterreilly2003/05/27 08:52:14 Modified:docs contributors.html xdocscontributors.xml Log: add peter reilly to contributors Revision ChangesPath 1.20 +3 -0 ant/docs/contributors.html Index: contributors.html === RCS file: /home/cvs/ant/docs/contributors.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- contributors.html 11 May 2003 12:00:35 - 1.19 +++ contributors.html 27 May 2003 15:52:14 - 1.20 @@ -376,6 +376,9 @@ compilers, Object Databases (SIGSEV, you da man!) for C++, Java ORB and EJB runtime environments -- in that order. + +Peter Reilly + Emeritus Committers 1.10 +5 -0 ant/xdocs/contributors.xml Index: contributors.xml === RCS file: /home/cvs/ant/xdocs/contributors.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- contributors.xml 16 Apr 2003 08:04:40 - 1.9 +++ contributors.xml 27 May 2003 15:52:14 - 1.10 @@ -245,6 +245,11 @@ and EJB runtime environments -- in that order. + +Peter Reilly + + +
cvs commit: ant/src/etc/testcases/filters tokenfilter.xml
peterreilly2003/05/28 08:31:07 Modified:src/main/org/apache/tools/ant/util/regexp JakartaOroRegexp.java Jdk14RegexpRegexp.java src/testcases/org/apache/tools/ant/filters TokenFilterTest.java src/etc/testcases/filters tokenfilter.xml Log: fix for bug 20306 - regex handling of $ in replace string Revision ChangesPath 1.10 +4 -1 ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java Index: JakartaOroRegexp.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/regexp/JakartaOroRegexp.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- JakartaOroRegexp.java 10 Feb 2003 14:14:41 - 1.9 +++ JakartaOroRegexp.java 28 May 2003 15:31:07 - 1.10 @@ -76,7 +76,10 @@ StringBuffer subst = new StringBuffer(); for (int i = 0; i < argument.length(); i++) { char c = argument.charAt(i); -if (c == '\\') { +if (c == '$') { +subst.append('\\'); +subst.append('$'); +} else if (c == '\\') { if (++i < argument.length()) { c = argument.charAt(i); int value = Character.digit(c, 10); 1.12 +4 -1 ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java Index: Jdk14RegexpRegexp.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/regexp/Jdk14RegexpRegexp.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Jdk14RegexpRegexp.java10 Feb 2003 14:14:41 - 1.11 +++ Jdk14RegexpRegexp.java28 May 2003 15:31:07 - 1.12 @@ -83,7 +83,10 @@ StringBuffer subst = new StringBuffer(); for (int i = 0; i < argument.length(); i++) { char c = argument.charAt(i); -if (c == '\\') { +if (c == '$') { +subst.append('\\'); +subst.append('$'); +} else if (c == '\\') { if (++i < argument.length()) { c = argument.charAt(i); int value = Character.digit(c, 10); 1.3 +7 -1 ant/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java Index: TokenFilterTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TokenFilterTest.java 15 Apr 2003 13:19:41 - 1.2 +++ TokenFilterTest.java 28 May 2003 15:31:07 - 1.3 @@ -77,7 +77,7 @@ } public void tearDown() { -//executeTarget("cleanup"); +executeTarget("cleanup"); } /** make sure tokenfilter exists */ @@ -147,6 +147,12 @@ assertStringContains(contents, "world world world world"); } +public void testHandleDollerMatch() throws IOException { +if (! hasRegex("testFilterReplaceRegex")) +return; +executeTarget("dollermatch"); +} + public void testTrimFile() throws IOException { String contents = getFileString( "trimfile", "result/trimfile"); 1.3 +9 -0 ant/src/etc/testcases/filters/tokenfilter.xml Index: tokenfilter.xml === RCS file: /home/cvs/ant/src/etc/testcases/filters/tokenfilter.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- tokenfilter.xml 15 Apr 2003 13:19:41 - 1.2 +++ tokenfilter.xml 28 May 2003 15:31:07 - 1.3 @@ -181,6 +181,15 @@ + + + @hello@ + + + + + +
cvs commit: ant/src/testcases/org/apache/tools/ant/types AddTypeTest.java
peterreilly2003/05/28 09:27:38 Modified:src/main/org/apache/tools/ant ComponentHelper.java IntrospectionHelper.java src/main/org/apache/tools/ant/filters TokenFilter.java src/main/org/apache/tools/ant/taskdefs Delete.java MatchingTask.java src/main/org/apache/tools/ant/taskdefs/condition ConditionBase.java src/main/org/apache/tools/ant/types AbstractFileSet.java FilterChain.java Path.java src/main/org/apache/tools/ant/types/optional ScriptFilter.java src/main/org/apache/tools/ant/types/selectors BaseSelectorContainer.java SelectorContainer.java Added: src/etc/testcases/types addtype.xml src/testcases/org/apache/tools/ant/types AddTypeTest.java Log: PR: 19897 Submitted by: Peter Reilly This patch adds the add(Type) to the introspection rules and updates ConditionBase, FilterChain, Path, SelectorBase and TokenFilter to use the new introspection rule. = = Changed Files = src/main/org/apache/tools/ant/ProjectHelper.java add two methods used by introspection - getComponentClass and createComponent src/main/org/apache/tools/ant/IntrospectionHelper.java implement addTypeMethods add(Type) src/main/org/apache/tools/ant/filters/TokenFilter.java get TokenFilter to use add(Type) instead of dynamicconfigurator make all nested classes ProjectComponents src/main/org/apache/tools/ant/taskdefs/Delete.java implement an add(FileSelector) method src/main/org/apache/tools/ant/taskdefs/MatchingTask.java implement an add(FileSelector) method src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java add an add(Condition) method to demostrate use of add(Type) method src/main/org/apache/tools/ant/types/AbstractFileSet.java implement add(FileSelector) src/main/org/apache/tools/ant/types/FilterChain.java use add(ChainableReader) instead of DynamicConfigurator src/main/org/apache/tools/ant/types/Path.java add an add(Path) method src/main/org/apache/tools/ant/types/optional/ScriptFilter.java remove set/get project as parent imlements them now src/main/org/apache/tools/ant/types/selectors/BaseSelectorContainer.java implement the add(FileSelector) method src/main/org/apache/tools/ant/types/selectors/SelectorContainer.java add an add(FileSelector) method = = New Files = src/etc/testcases/types/addtype.xml testcases for addtype src/testcases/org/apache/tools/ant/types/AddTypeTest.java test cases for add type Revision ChangesPath 1.1 ant/src/etc/testcases/types/addtype.xml Index: addtype.xml === This is line 1 This is line 2 This is line 3 before after before after > 1.10 +35 -0 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ComponentHelper.java 5 May 2003 13:59:24 - 1.9 +++ ComponentHelper.java 28 May 2003 16:27:32 - 1.10 @@ -161,6 +161,41 @@ return component; } +/** + * get the class of a particular component + */ +public Class getComponentClass(String componentName) { +Class elementClass = +(Class) getTaskDefinitions().get(componentName); +if (elementClass != null) { +if (! (Task.class.isAssignableFrom(elementClass))) { +elementClass = TaskAdapter.class; +} +return elementClass; +} +return (Class) getDataTypeDefinitions().get(componentName); +} + +/** + * create a named component + */ +public Object createComponent(String componentN
cvs commit: ant/src/main/org/apache/tools/ant TaskAdapter.java
peterreilly2003/06/05 02:35:47 Modified:src/main/org/apache/tools/ant TaskAdapter.java Log: Fix for 20499: When a proxied task throws a build exception, or other exception, the taskadapter reports this at error level. This is incorrect as the intent of taskadapter is to transparently adapt a task, the exception should be reported at verbose level. Revision ChangesPath 1.20 +3 -3 ant/src/main/org/apache/tools/ant/TaskAdapter.java Index: TaskAdapter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/TaskAdapter.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- TaskAdapter.java 10 Feb 2003 14:13:30 - 1.19 +++ TaskAdapter.java 5 Jun 2003 09:35:47 - 1.20 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -147,7 +147,7 @@ executeM.invoke(proxy, null); return; } catch (java.lang.reflect.InvocationTargetException ie) { -log("Error in " + proxy.getClass(), Project.MSG_ERR); +log("Error in " + proxy.getClass(), Project.MSG_VERBOSE); Throwable t = ie.getTargetException(); if (t instanceof BuildException) { throw ((BuildException) t); @@ -155,7 +155,7 @@ throw new BuildException(t); } } catch (Exception ex) { -log("Error in " + proxy.getClass(), Project.MSG_ERR); +log("Error in " + proxy.getClass(), Project.MSG_VERBOSE); throw new BuildException(ex); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/util UnPackageNameMapperTest.java
peterreilly2003/06/16 02:28:29 Modified:.WHATSNEW src/main/org/apache/tools/ant/types Mapper.java docs/manual/CoreTypes mapper.html Added: src/main/org/apache/tools/ant/util UnPackageNameMapper.java src/testcases/org/apache/tools/ant/util UnPackageNameMapperTest.java Log: Added the mapper unpackage PR: 18908 Obtained from: Brad Clark Submitted by: Peter Reilly Revision ChangesPath 1.437 +3 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.436 retrieving revision 1.437 diff -u -r1.436 -r1.437 --- WHATSNEW 15 Jun 2003 20:26:57 - 1.436 +++ WHATSNEW 16 Jun 2003 09:28:28 - 1.437 @@ -410,6 +410,9 @@ * config attribute added to set the location of a specific PVCS .cfg file Bugzilla Report 9752 +* has an "unpackage" mapper + Bugzilla Report 18908 + Changes from Ant 1.5.2 to Ant 1.5.3 === 1.19 +3 -1 ant/src/main/org/apache/tools/ant/types/Mapper.java Index: Mapper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Mapper.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Mapper.java 15 Apr 2003 17:23:16 - 1.18 +++ Mapper.java 16 Jun 2003 09:28:28 - 1.19 @@ -262,11 +262,13 @@ "org.apache.tools.ant.util.RegexpPatternMapper"); implementations.put("package", "org.apache.tools.ant.util.PackageNameMapper"); +implementations.put("unpackage", + "org.apache.tools.ant.util.UnPackageNameMapper"); } public String[] getValues() { return new String[] {"identity", "flatten", "glob", - "merge", "regexp", "package"}; + "merge", "regexp", "package", "unpackage"}; } public String getImplementation() { 1.1 ant/src/main/org/apache/tools/ant/util/UnPackageNameMapper.java Index: UnPackageNameMapper.java === /* * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "Ant" and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EV
cvs commit: ant/docs/manual/OptionalTasks script.html
peterreilly2003/06/16 03:09:10 Modified:docs/manual/OptionalTasks script.html Log: Added some more documentation to the script task. PR: 20805 Author: Jan Materne Revision ChangesPath 1.12 +79 -3 ant/docs/manual/OptionalTasks/script.html Index: script.html === RCS file: /home/cvs/ant/docs/manual/OptionalTasks/script.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- script.html 14 Nov 2002 07:48:25 - 1.11 +++ script.html 16 Jun 2003 10:09:09 - 1.12 @@ -18,7 +18,13 @@ id attributes (as long as their names are considered valid Java identifiers, that is). The name "project" is a pre-defined reference to the Project, which can be -used instead of the project name. +used instead of the project name. The name "self" is a pre-defined reference to the actual +<script>-Task instance.From these objects you have access to the Ant Java API, see the +JavaDoc (especially for +Project and +Script) for more information. +If you are using JavaScript a good resource is http://www.mozilla.org/rhino/doc.html";> +http://www.mozilla.org/rhino/doc.html as we are using their JavaScript interpreter. Scripts can do almost anything a task written in Java could do. Parameters @@ -117,10 +123,80 @@ BUILD SUCCESSFUL +Now a more complex example using the Java API and the Ant API. The goal is to list the +filesizes of all files a <fileset/> caught. + + +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="MyProject" basedir="." default="main"> + + <property name="fs.dir" value="src"/> + <property name="fs.includes" value="**/*.txt"/> + <property name="fs.excludes" value="**/*.tmp"/> + + <target name="main"> +<script language="javascript"> <![CDATA[ + + // import statements + // importPackage(java.io); + importClass(java.io.File); + + // Access to Ant-Properties by their names + dir = project.getProperty("fs.dir"); + includes = MyProject.getProperty("fs.includes"); + excludes = self.getProject() .getProperty("fs.excludes"); + + // Create a <fileset dir="" includes="" /> + fs = project.createDataType("fileset"); + fs.setDir( new File(dir) ); + fs.setIncludes(includes); + fs.setExcludes(excludes); + + // Get the files of that fileset + ds = fs.getDirectoryScanner(project); + + // Get the source files (array) + srcFiles = ds.getIncludedFiles(); + + // iterate over that array + for (i=0; i<srcFiles.length; i++) { + +// get the values via Java API +var basedir = fs.getDir(project); +var filename = srcFiles[i]; +var file = new File(basedir, filename); +var size = file.length(); + +// create and use a Task via Ant API +echo = MyProject.createTask("echo"); +echo.setMessage(filename + ": " + size + " byte"); +echo.perform(); + } +]]></script> + </target> +</project> + +We want to use the Java API. Because we don´t want always typing the package signature +we do an import. Rhino knows to different methods for import statements: one for packages +and one for a single class. +The <script> task populates the Project instance under +the name project, so we can use that reference. Another way is to use its given name +or getting its reference from the task itself. +The Project provides methods for accessing and setting properties, creating DataTypes and +Tasks and much more. +After creating a FileSet object we initialize that by calling its set-methods. Then we can +use that object like a normal Ant task (<copy> for example). +For getting the size of a file we instantiate a java.io.File. So we are using +normal Java API here. +Finally we use the <echo> task for producing the output. The task is not executed by +its execute() method, because the perform() method (implemented in Task itself) does the +apropriate logging before and after invoking execute(). + + + -Copyright © 2000-2002 Apache Software Foundation. All rights +Copyright © 2000-2003 Apache Software Foundation. All rights Reserved. - - 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
peterreilly2003/06/18 00:44:55 Modified:src/main/org/apache/tools/ant/taskdefs UpToDate.java Log: get UpToDate task to log at verbose level when the target file does not exist PR: 20848 Obtained from: Eli Tucker Revision ChangesPath 1.29 +3 -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.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- UpToDate.java 7 Mar 2003 11:23:02 - 1.28 +++ UpToDate.java 18 Jun 2003 07:44:55 - 1.29 @@ -77,6 +77,7 @@ * @author Hiroaki Nakamura * mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED] * @author Stefan Bodewig + * @author http://nerdmonkey.com";>Eli Tucker * * @since Ant 1.2 * @@ -182,6 +183,8 @@ // 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() ++ "\" does not exist.", Project.MSG_VERBOSE); return false; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs PropertyTest.java
peterreilly2003/06/18 01:10:21 Modified:docs/manual/CoreTasks property.html src/etc/testcases/taskdefs property.xml src/main/org/apache/tools/ant/taskdefs Property.java src/testcases/org/apache/tools/ant/taskdefs PropertyTest.java Log: Add url attribute to the properties task PR: 20749 Obtained from: Andrew Ferguson Revision ChangesPath 1.15 +24 -15ant/docs/manual/CoreTasks/property.html Index: property.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/property.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- property.html 5 Feb 2003 11:20:17 - 1.14 +++ property.html 18 Jun 2003 08:10:21 - 1.15 @@ -12,14 +12,17 @@ Sets a property (by name and value), or set of properties (from file or resource) in the project. Properties are case sensitive. Properties are immutable: whoever sets a property first freezes it for the - rest of the build; they are most definately not variable. -There are five ways to set properties: + rest of the build; they are most definately not variable. +There are six ways to set properties: By supplying both the name and value attribute. By supplying both the name and refid attribute. By setting the file attribute with the filename of the property file to load. This property file has the format as defined by the file used in the class java.util.Properties. + By setting the url attribute with the url from which to load the +properties. This url must be directed to a file that has the format as defined +by the file used in the class java.util.Properties. By setting the resource attribute with the resource name of the property file to load. This property file has the format as defined by the file used in the class java.util.Properties. @@ -70,7 +73,7 @@ resource the resource name of the property file. -One of these, when +One of these, when not using the name attribute @@ -78,14 +81,18 @@ the filename of the property file . +url +the url from which to read properties. + + environment the prefix to use when retrieving environment variables. Thus -if you specify environment="myenv" you will be able to access OS-specific -environment variables via property names "myenv.PATH" or -"myenv.TERM". Note that if you supply a property name with a final -"." it will not be doubled. ie environment="myenv." will still -allow access of environment variables through "myenv.PATH" and -"myenv.TERM". This functionality is currently only implemented +if you specify environment="myenv" you will be able to access OS-specific +environment variables via property names "myenv.PATH" or +"myenv.TERM". Note that if you supply a property name with a final +"." it will not be doubled. ie environment="myenv." will still +allow access of environment variables through "myenv.PATH" and +"myenv.TERM". This functionality is currently only implemented on select platforms. Feel free to send patches to increase the number of platforms this functionality is supported on ;). Note also that properties are case sensitive, even if the @@ -94,19 +101,19 @@ -classpath +classpath the classpath to use when looking up a resource. No -classpathref +classpathref the classpath to use when looking up a resource, given as reference to a <path> defined elsewhere.. No -prefix +prefix Prefix to apply to properties loaded using file or resource. A "." is appended to the prefix if not specified. No @@ -122,6 +129,8 @@ sets the property foo.dist to the value "dist". <property file="foo.properties"/> reads a set of properties from a file called "foo.properties". + <property url="http://www.mysite.com/bla/props/foo.properties"/>; +reads a set of properties from the address "http://www.mysite.com/bla/props/foo.properties";. <property resource="foo.properties"/> reads a set of properties from a resource called "foo.properties". Note that you can reference a global properties file for all of your Ant @@ -132,7 +141,7 @@ the file system depends on the operating system version and the JVM implementation. On Unix based systems, this will map to the user's home dir
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs TypeAdapterTest.java
peterreilly2003/06/26 01:54:29 Modified:docs/manual/CoreTasks taskdef.html typedef.html src/main/org/apache/tools/ant ComponentHelper.java Project.java ProjectHelper.java RuntimeConfigurable.java TaskAdapter.java UnknownElement.java src/main/org/apache/tools/ant/helper ProjectHelperImpl.java src/main/org/apache/tools/ant/taskdefs Ant.java Definer.java Taskdef.java src/testcases/org/apache/tools/ant ProjectTest.java Added: src/etc/testcases/taskdefs typeadapter.xml src/main/org/apache/tools/ant AntTypeDefinition.java TypeAdapter.java src/testcases/org/apache/tools/ant/taskdefs TypeAdapterTest.java Log: Second patch from antlib update as described in http://issues.apache.org/bugzilla/show_bug.cgi?id=19897 This patch * unifies the type and task definitions into one table * types and tasks are represented by a AntTypeDefinition object * taskadapter has been generalized to a typeadapter * has a number of new attributes: - adapter - adaptto - onerror * html page updated to refer to page PR: 19897 Submitted by: Peter Reilly Revision ChangesPath 1.9 +7 -71 ant/docs/manual/CoreTasks/taskdef.html Index: taskdef.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/taskdef.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- taskdef.html 22 Jun 2002 23:38:27 - 1.8 +++ taskdef.html 26 Jun 2003 08:54:27 - 1.9 @@ -9,82 +9,18 @@ Taskdef Description -Adds a task definition to the current project, such that this new task can be -used in the current project. Two attributes are needed, the name that identifies -this task uniquely, and the full name of the class (including the packages) that -implements this task. -You can also define a group of tasks at once using the file or -resource attributes. These attributes point to files in the format of -Java property files. Each line defines a single task in the -format: - -taskname=fully.qualified.java.classname - -Taskdef should be used to add your own tasks to the system. See also "Writing your own task". -Parameters - - -Attribute -Description -Required - - -name -the name of the task -Yes, unless file or resource have -been specified. - - -classname -the full class name implementing the task -Yes, unless file or resource have -been specified. - - -file -Name of the property file to load - taskname/classname pairs from. -No - - -resource -Name of the property resource to load - taskname/classname pairs from. -No - - -classpath the classpath to -use when looking up classname or -resource. -No - - -classpathref -Reference to a classpath to -use when looking up classname or -resource. -No - - -loaderRef the name of the loader that is -used to load the class, constructed from the specified classpath. Use this to -allow multiple tasks/types to be loaded with the same loader, so they can call -each other. ( introduced in ant1.5 ) -No - - -Parameters specified as nested elements -classpath -Taskdef's classpath attribute is a PATH like structure and can also be set via a nested -classpath element. + Adds a task definition to the current project, such that this new task can be +used in the current project. + This task is a form of Typedef with the +attributes "adapter" and "adaptto" set to the values +"org.apache.tools.ant.TaskAdapter" and "org.apache.tools.ant.Task" +respectively. Examples <taskdef name="myjavadoc" classname="com.mydomain.JavadocTask"/> makes a task called myjavadoc available to Ant. The class com.mydomain.JavadocTask implements the task. -Copyright © 2000-2002 Apache Software Foundation. All rights +Copyright © 2000-2003 Apache Software Foundation. All rights Reserved. 1.7 +43 -10ant/docs/manual/CoreTasks/typedef.html Index: typedef.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/typedef.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- typedef.html 1 Jun 2002 12:26:33 - 1.6 +++ typedef.html 26 Jun 2003 08:54:27 - 1.7 @@ -21,7 +21,7 @@ typename=fully.qu
cvs commit: ant/src/main/org/apache/tools/ant/filters TokenFilter.java
peterreilly2003/06/26 09:34:26 Modified:src/main/org/apache/tools/ant/filters TokenFilter.java Log: opps: set includedelims to the attribute Revision ChangesPath 1.5 +1 -1 ant/src/main/org/apache/tools/ant/filters/TokenFilter.java Index: TokenFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TokenFilter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- TokenFilter.java 28 May 2003 16:27:33 - 1.4 +++ TokenFilter.java 26 Jun 2003 16:34:24 - 1.5 @@ -355,7 +355,7 @@ */ public void setIncludeDelims(boolean includeDelims) { -this.includeDelims = true; +this.includeDelims = includeDelims; } public String getToken(Reader in) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/filters TokenFilter.java
peterreilly2003/06/26 09:45:05 Modified:src/main/org/apache/tools/ant/filters TokenFilter.java Log: opps - 2: set includedelims to the attribute in the C&P method Revision ChangesPath 1.6 +1 -1 ant/src/main/org/apache/tools/ant/filters/TokenFilter.java Index: TokenFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TokenFilter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TokenFilter.java 26 Jun 2003 16:34:24 - 1.5 +++ TokenFilter.java 26 Jun 2003 16:45:05 - 1.6 @@ -469,7 +469,7 @@ * default - false */ public void setIncludeDelims(boolean includeDelims) { -this.includeDelims = true; +this.includeDelims = includeDelims; } public String getToken(Reader in) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant ProjectTest.java
peterreilly2003/06/27 02:24:10 Modified:src/main/org/apache/tools/ant ComponentHelper.java src/main/org/apache/tools/ant/taskdefs Typedef.java src/testcases/org/apache/tools/ant ProjectTest.java Log: Get Project#getTaskDefinitions and Project#getDataTypeDefinitions to emulate old behaviour This fixs the output. Provide ComponentHelper#getAntTypeTable to provide the full table Revert changes to ProjectTest Update Typedef.java (forgot this in previous commit) Revision ChangesPath 1.13 +69 -8 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ComponentHelper.java 26 Jun 2003 08:54:28 - 1.12 +++ ComponentHelper.java 27 Jun 2003 09:24:10 - 1.13 @@ -92,12 +92,19 @@ * @since Ant1.6 */ public class ComponentHelper { -// Map from task names to implementing classes - not used anymore -private Hashtable taskClassDefinitions = new Hashtable(); - /** Map from compoennt name to anttypedefinition */ private AntTypeTable antTypeTable; +/** Map of tasks generated from antTypeTable */ +private Hashtable taskClassDefinitions = new Hashtable(); +/** flag to rebuild taskClassDefinitions */ +private boolean rebuildTaskClassDefinitions = true; + +/** Map of types generated from antTypeTable */ +private Hashtable typeClassDefinitions = new Hashtable(); +/** flag to rebuild typeClassDefinitions */ +private boolean rebuildTypeClassDefinitions = true; + /** * Map from task names to vectors of created tasks * (String to Vector of Task). This is used to invalidate tasks if @@ -105,7 +112,6 @@ */ private Hashtable createdTasks = new Hashtable(); - protected ComponentHelper next; protected Project project; @@ -301,15 +307,70 @@ /** * Returns the current task definition hashtable. The returned hashtable is * "live" and so should not be modified. - * This table does not contain any information * * @return a map of from task name to implementing class * (String to Class). */ public Hashtable getTaskDefinitions() { +synchronized(taskClassDefinitions) { +synchronized (antTypeTable) { +if (rebuildTaskClassDefinitions) { +taskClassDefinitions.clear(); +for (Iterator i = antTypeTable.keySet().iterator(); + i.hasNext();) +{ +String name = (String) i.next(); +Class clazz = +(Class) antTypeTable.getExposedClass(name); +if (clazz == null) { +continue; +} +if (Task.class.isAssignableFrom(clazz)) { +taskClassDefinitions.put( +name, antTypeTable.getTypeClass(name)); +} +} +rebuildTaskClassDefinitions = false; +} +} +} return taskClassDefinitions; } + +/** + * Returns the current type definition hashtable. The returned hashtable is + * "live" and so should not be modified. + * + * @return a map of from type name to implementing class + * (String to Class). + */ +public Hashtable getDataTypeDefinitions() { +synchronized(typeClassDefinitions) { +synchronized (antTypeTable) { +if (rebuildTypeClassDefinitions) { +typeClassDefinitions.clear(); +for (Iterator i = antTypeTable.keySet().iterator(); + i.hasNext();) +{ +String name = (String) i.next(); +Class clazz = +(Class) antTypeTable.getExposedClass(name); +if (clazz == null) { +continue; +} +if (! Task.class.isAssignableFrom(clazz)) { +typeClassDefinitions.put( +name, antTypeTable.getTypeClass(name)); +} +} +rebuildTypeClassDefinitions = false; +} +} +} +return
cvs commit: ant/src/main/org/apache/tools/ant ComponentHelper.java
peterreilly2003/06/27 11:16:59 Modified:src/main/org/apache/tools/ant ComponentHelper.java Log: quick fix for Ant.java use of property in Ant#reinit Revision ChangesPath 1.14 +9 -1 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ComponentHelper.java 27 Jun 2003 09:24:10 - 1.13 +++ ComponentHelper.java 27 Jun 2003 18:16:59 - 1.14 @@ -434,7 +434,15 @@ */ public Task createTask(String taskType) throws BuildException { Task task=createNewTask(taskType); -if(task!=null) { +if (task == null && taskType.equals("property")) { +// quick fix for Ant.java use of property before +// initializeing the project +addTaskDefinition("property", + org.apache.tools.ant.taskdefs.Property.class); +task = createNewTask(taskType); +} + +if (task != null) { addCreatedTask(taskType, task); } return task; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs Taskdef2.java
peterreilly2003/06/27 11:43:13 Modified:proposal/embed/src/java/org/apache/tools/ant/taskdefs Taskdef2.java Log: change access levels of methods to match new access levels in Definer Revision ChangesPath 1.3 +2 -2 ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/Taskdef2.java Index: Taskdef2.java === RCS file: /home/cvs/ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/Taskdef2.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Taskdef2.java 7 Mar 2003 11:22:58 - 1.2 +++ Taskdef2.java 27 Jun 2003 18:43:13 - 1.3 @@ -219,7 +219,7 @@ * create the classloader then hand the definition off to the subclass; * @throws BuildException when the class wont load for any reason */ -private void addDefinition(ClassLoader al, String name, String value) +protected void addDefinition(ClassLoader al, String name, String value) throws BuildException { try { Class c = al.loadClass(value); @@ -239,7 +239,7 @@ /** * create a classloader for this definition */ -private AntClassLoader createLoader() { +protected AntClassLoader createLoader() { // magic property if (getProject().getProperty(REUSE_LOADER_REF) != null) { // Generate the 'reuse' name automatically from the reference. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks loadproperties.html
peterreilly2003/07/02 07:25:59 Modified:docs/manual/CoreTasks loadproperties.html Log: Remove "outside of target" as this restriction is not the case for ant 1.6. Revision ChangesPath 1.6 +1 -2 ant/docs/manual/CoreTasks/loadproperties.html Index: loadproperties.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/loadproperties.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- loadproperties.html 19 Mar 2003 08:54:08 - 1.5 +++ loadproperties.html 2 Jul 2003 14:25:59 - 1.6 @@ -11,8 +11,7 @@ Load a file's contents as Ant properties. This is equivalent to <property file="..."/> except that it -supports nested <filterchain> elements and it cannot be -specified outside a target. +supports nested <filterchain> elements. If you want to simulate property's - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant AntTypeDefinition.java
peterreilly2003/07/04 01:15:43 Modified:src/main/org/apache/tools/ant AntTypeDefinition.java Log: clean up to pass checkstyle Revision ChangesPath 1.2 +45 -26ant/src/main/org/apache/tools/ant/AntTypeDefinition.java Index: AntTypeDefinition.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/AntTypeDefinition.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AntTypeDefinition.java26 Jun 2003 08:54:28 - 1.1 +++ AntTypeDefinition.java4 Jul 2003 08:15:43 - 1.2 @@ -54,10 +54,6 @@ package org.apache.tools.ant; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; - /** * This class contains all the information * on a particular ant type, @@ -94,17 +90,26 @@ return copy; } -/** set the project on the definition */ +/** + * set the project on the definition + * @param project the project this definition belongs in + */ public void setProject(Project project) { this.project = project; } -/** set the definiton's name */ +/** + * set the definition's name + * @param name the name of the definition + */ public void setName(String name) { this.name = name; } -/** return the definition's name */ +/** + * return the definition's name + * @return the name of the defintion + */ public String getName() { return name; } @@ -112,6 +117,7 @@ /** * set the class of the definition. * as a side-effect may set the classloader and classname + * @param clazz the class of this definition */ public void setClass(Class clazz) { this.clazz = clazz; @@ -126,12 +132,18 @@ } } -/** set the classname of the definition */ +/** + * set the classname of the definition + * @param className the classname of this definition + */ public void setClassName(String className) { this.className = className; } -/** get the classname of the definition */ +/** + * get the classname of the definition + * @return the name of the class of this definition + */ public String getClassName() { return className; } @@ -140,6 +152,7 @@ * set the adapter class for this definition. * this class is used to adapt the definitions class if * required. + * @param adapterClass the adapterClass */ public void setAdapterClass(Class adapterClass) { this.adapterClass = adapterClass; @@ -147,8 +160,9 @@ /** * set the assignable class for this definition. + * @param adaptToClass the assignable class */ - + public void setAdaptToClass(Class adaptToClass) { this.adaptToClass = adaptToClass; } @@ -156,12 +170,16 @@ /** * set the classloader to use to create an instance * of the definition + * @param classLoader the classLoader */ public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } -/** get the classloader for this definition */ +/** + * get the classloader for this definition + * @return the classloader for this definition + */ public ClassLoader getClassLoader() { return classLoader; } @@ -172,13 +190,14 @@ * (adapted class) if there is an adpater * class and the definition class is not * assignable from the assignable class. + * @return the exposed class */ - public Class getExposedClass() { if (adaptToClass != null) { Class z = getTypeClass(); -if (z == null) +if (z == null) { return null; +} if (adaptToClass.isAssignableFrom(z)) { return z; } @@ -191,6 +210,7 @@ /** * get the definition class + * @return the type of the definition */ public Class getTypeClass() { if (clazz != null) { @@ -205,7 +225,7 @@ } } catch (NoClassDefFoundError ncdfe) { project.log("Could not load a dependent class (" -+ ncdfe.getMessage() + ") for type " ++ ncdfe.getMessage() + ") for type " + name, Project.MSG_DEBUG); } catch (ClassNotFoundException cnfe) { project.log("Could not load class (" + className @@ -217,10 +237,10 @@ /** * create
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Definer.java
peterreilly2003/07/04 01:48:19 Modified:src/main/org/apache/tools/ant/taskdefs Definer.java Log: clean up to pass checkstyle Revision ChangesPath 1.32 +131 -42 ant/src/main/org/apache/tools/ant/taskdefs/Definer.java Index: Definer.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Definer.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- Definer.java 26 Jun 2003 08:54:29 - 1.31 +++ Definer.java 4 Jul 2003 08:48:19 - 1.32 @@ -55,21 +55,17 @@ package org.apache.tools.ant.taskdefs; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Enumeration; -import java.util.Locale; import java.util.Properties; import org.apache.tools.ant.AntTypeDefinition; import org.apache.tools.ant.AntClassLoader; import org.apache.tools.ant.ComponentHelper; import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.Location; import org.apache.tools.ant.Project; -import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Reference; @@ -91,34 +87,45 @@ private File file; private String resource; private ClasspathUtils.Delegate cpDelegate; - -private intformat = Format.PROPERTIES; + private boolean definerSet = false; private ClassLoader internalClassLoader; private int onError = OnError.FAIL; private String adapter; private String adaptTo; - + private Class adapterClass; private Class adaptToClass; - + +/** + * Enumerated type for onError attribute + * + * @see EnumeratedAttribute + */ public static class OnError extends EnumeratedAttribute { +/** Enumerated values */ public static final int FAIL = 0, REPORT = 1, IGNORE = 2; +/** + * Constructor + */ public OnError() { super(); } + +/** + * Constructor using a string. + * @param value the value of the attribute + */ public OnError(String value) { setValue(value); } -public String[] getValues() { -return new String[] {"fail", "report", "ignore"}; -} -} -public static class Format extends EnumeratedAttribute { -public static final int PROPERTIES=0, XML=1; +/** + * get the values + * @return an array of the allowed values for this attribute. + */ public String[] getValues() { -return new String[] {"properties", "xml"}; +return new String[] {"fail", "report", "ignore"}; } } @@ -137,13 +144,8 @@ } /** - * Sets the format of the file or resource - */ -public void setFormat(Format format) { -this.format = format.getIndex(); -} - -/** + * @param reverseLoader if true a delegated loader will take precedence over + * the parent * @deprecated stop using this attribute * @ant.attribute ignore="true" */ @@ -153,30 +155,53 @@ Project.MSG_WARN); } +/** + * @return the name for this definition + */ public String getName() { return name; } +/** + * @return the class path path for this definition + */ public Path getClasspath() { return cpDelegate.getClasspath(); } +/** + * @return the file containing definitions + */ public File getFile() { return file; } +/** + * @return the resource containing definitions + */ public String getResource() { return resource; } +/** + * @return the reverse loader attribute of the classpath delegate. + */ public boolean isReverseLoader() { return cpDelegate.isReverseLoader(); } +/** + * Returns the loader id of the class path Delegate. + * @return the loader id + */ public String getLoaderId() { return cpDelegate.getClassLoadId(); } +/** + * Returns the class path id of the class path delegate. + * @return the class path id + */ public String getClasspathId() { return cpDelegate.getClassLoadId(); } @@ -191,7 +216,9 @@ }
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Definer.java
peterreilly2003/07/04 02:35:31 Modified:src/main/org/apache/tools/ant AntTypeDefinition.java ComponentHelper.java src/main/org/apache/tools/ant/taskdefs Definer.java Log: Remove cloning of AntTypeDefinition when creating a sub-project PR: 21296 Revision ChangesPath 1.3 +22 -27ant/src/main/org/apache/tools/ant/AntTypeDefinition.java Index: AntTypeDefinition.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/AntTypeDefinition.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AntTypeDefinition.java4 Jul 2003 08:15:43 - 1.2 +++ AntTypeDefinition.java4 Jul 2003 09:35:31 - 1.3 @@ -65,7 +65,6 @@ * @author Peter Reilly */ public class AntTypeDefinition { -private Project project; private String name; private Class clazz; private Class adapterClass; @@ -74,13 +73,11 @@ private ClassLoader classLoader; /** - * Clone this definiton and changed the cloned definitions' project. - * @param p the project the cloned definition lives in + * Clone this definition and changed the cloned definitions' project. * @returnthe cloned definition */ -public AntTypeDefinition copy(Project p) { +public AntTypeDefinition copy() { AntTypeDefinition copy = new AntTypeDefinition(); -copy.project = p; copy.name = name; copy.clazz = clazz; copy.adapterClass = adapterClass; @@ -91,14 +88,6 @@ } /** - * set the project on the definition - * @param project the project this definition belongs in - */ -public void setProject(Project project) { -this.project = project; -} - -/** * set the definition's name * @param name the name of the definition */ @@ -190,11 +179,12 @@ * (adapted class) if there is an adpater * class and the definition class is not * assignable from the assignable class. + * @param project the current project * @return the exposed class */ -public Class getExposedClass() { +public Class getExposedClass(Project project) { if (adaptToClass != null) { -Class z = getTypeClass(); +Class z = getTypeClass(project); if (z == null) { return null; } @@ -205,14 +195,15 @@ if (adapterClass != null) { return adapterClass; } -return getTypeClass(); +return getTypeClass(project); } /** * get the definition class + * @param project the current project * @return the type of the definition */ -public Class getTypeClass() { +public Class getTypeClass(Project project) { if (clazz != null) { return clazz; } @@ -237,23 +228,24 @@ /** * create an instance of the definition. * The instance may be wrapped in a proxy class. + * @param project the current project * @return the created object */ -public Object create() { -return icreate(); +public Object create(Project project) { +return icreate(project); } /** * Create a component object based on * its definition */ -private Object icreate() { -Class c = getTypeClass(); +private Object icreate(Project project) { +Class c = getTypeClass(project); if (c == null) { return null; } -Object o = createAndSet(c); +Object o = createAndSet(project, c); if (o == null || adapterClass == null) { return o; } @@ -264,7 +256,8 @@ } } -TypeAdapter adapterObject = (TypeAdapter) createAndSet(adapterClass); +TypeAdapter adapterObject = (TypeAdapter) createAndSet( +project, adapterClass); if (adapterObject == null) { return null; } @@ -281,10 +274,11 @@ * if the type is assignable from adapto * if the type can be used with the adapter class * + * @param project the current project */ -public void checkClass() { +public void checkClass(Project project) { if (clazz == null) { -clazz = getTypeClass(); +clazz = getTypeClass(project); if (clazz == null) { throw new BuildException( "Unable to create class for " + getName()); @@ -298,7 +292,8 @@ needToCheck = false; }
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Definer.java
peterreilly2003/07/04 02:53:08 Modified:src/main/org/apache/tools/ant/taskdefs Definer.java Log: Use getProject() instead of the project field Revision ChangesPath 1.34 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/Definer.java Index: Definer.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Definer.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- Definer.java 4 Jul 2003 09:35:31 - 1.33 +++ Definer.java 4 Jul 2003 09:53:08 - 1.34 @@ -534,7 +534,7 @@ def.setAdaptToClass(adaptToClass); def.setClassLoader(al); if (cl != null) { -def.checkClass(project); +def.checkClass(getProject()); } ComponentHelper.getComponentHelper(getProject()) .addDataTypeDefinition(def); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/filters TokenFilter.java
peterreilly2003/07/04 09:16:51 Modified:src/main/org/apache/tools/ant/filters TokenFilter.java Log: Fix echeckstyle reported issues Revision ChangesPath 1.8 +281 -154 ant/src/main/org/apache/tools/ant/filters/TokenFilter.java Index: TokenFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TokenFilter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- TokenFilter.java 4 Jul 2003 14:04:53 - 1.7 +++ TokenFilter.java 4 Jul 2003 16:16:50 - 1.8 @@ -75,10 +75,8 @@ * @see ChainableReader * @see DynamicConfigurator */ -public class TokenFilter -extends BaseFilterReader -implements ChainableReader -{ +public class TokenFilter extends BaseFilterReader +implements ChainableReader { /** * input stream tokenizers implement this interface */ @@ -88,15 +86,17 @@ * @param in the input stream * @return the next token, or null for the end * of the stream + * @throws IOException if an error occurs */ -public String getToken(Reader in) +String getToken(Reader in) throws IOException; + /** * return the string between tokens, after the * previous token. * @return the intra-token string */ -public String getPostToken(); +String getPostToken(); } /** @@ -106,11 +106,11 @@ /** * filter and/of modify a string * - * @param filter the string to filter + * @param string the string to filter * @return the modified string or null if the * string did not pass the filter */ -public String filter(String string); +String filter(String string); } @@ -158,34 +158,37 @@ */ public int read() throws IOException { -if (tokenizer == null) +if (tokenizer == null) { tokenizer = new LineTokenizer(); - +} while (line == null || line.length() == 0) { line = tokenizer.getToken(in); -if (line == null) +if (line == null) { return -1; -for (Enumeration e = filters.elements(); e.hasMoreElements();) -{ +} +for (Enumeration e = filters.elements(); e.hasMoreElements();) { Filter filter = (Filter) e.nextElement(); line = filter.filter(line); -if (line == null) +if (line == null) { break; +} } linePos = 0; if (line != null) { if (tokenizer.getPostToken().length() != 0) { -if (delimOutput != null) +if (delimOutput != null) { line = line + delimOutput; -else +} else { line = line + tokenizer.getPostToken(); +} } } } int ch = line.charAt(linePos); -linePos ++; -if (linePos == line.length()) +linePos++; +if (linePos == line.length()) { line = null; +} return ch; } @@ -223,6 +226,7 @@ /** * add a line tokenizer - this is the default. + * @param tokenizer the line tokenizer */ public void addLineTokenizer(LineTokenizer tokenizer) { @@ -231,6 +235,7 @@ /** * add a string tokenizer + * @param tokenizer the string tokenizer */ public void addStringTokenizer(StringTokenizer tokenizer) { @@ -238,19 +243,22 @@ } /** - * add a file tokenizer + * add a file tokenizer + * @param tokenizer the file tokenizer */ public void addFileTokenizer(FileTokenizer tokenizer) { add(tokenizer); } /** - * add a tokenizer + * add an arbirarty tokenizer + * @param tokenizer the tokenizer to all, only one allowed */ public void add(Tokenizer tokenizer) { -if (this.tokenizer != null) +if (this.tokenizer != null) { throw new BuildException("Only one tokenizer allowed"); +} this.tokenizer = tokenizer; } @@ -258,41 +266,66 @@ // Predefined filters // - -/** replace string filter */ +/** + * replace string filter + * @param filter the replace string filter + */ p
cvs commit: ant/src/main/org/apache/tools/ant ComponentHelper.java
peterreilly2003/07/04 10:00:14 Modified:src/main/org/apache/tools/ant ComponentHelper.java Log: changed for checkstyle Revision ChangesPath 1.17 +82 -53ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ComponentHelper.java 4 Jul 2003 14:04:52 - 1.16 +++ ComponentHelper.java 4 Jul 2003 17:00:11 - 1.17 @@ -109,29 +109,54 @@ protected Project project; /** + * find a project component for a specific project, creating + * it if it does not exist + * @param project the project + * @return the project component for a specific project */ public static ComponentHelper getComponentHelper(Project project) { // Singleton for now, it may change ( per/classloader ) -ComponentHelper ph=(ComponentHelper)project.getReference( "ant.ComponentHelper" ); -if( ph!=null ) return ph; -ph=new ComponentHelper(); -ph.setProject( project ); +ComponentHelper ph = (ComponentHelper) project.getReference( +"ant.ComponentHelper"); +if (ph != null) { +return ph; +} +ph = new ComponentHelper(); +ph.setProject(project); -project.addReference( "ant.ComponentHelper",ph ); +project.addReference("ant.ComponentHelper", ph); return ph; } +/** + * Creates a new ComponentHelper instance. + */ protected ComponentHelper() { } -public void setNext( ComponentHelper next ) { -this.next=next; +/** + * Set the next chained component helper + * + * @param next the next chained component helper + */ +public void setNext(ComponentHelper next) { +this.next = next; } +/** + * Get the next chained component helper + * + * @return the next chained component helper + */ public ComponentHelper getNext() { return next; } +/** + * Sets the project for this component helper + * + * @param project the project for this helper + */ public void setProject(Project project) { this.project = project; antTypeTable = new AntTypeTable(project); @@ -141,6 +166,7 @@ * Used with creating child projects. Each child * project inherites the component definitions * from its parent. + * @param helper the component helper of the parent project */ public void initSubProject(ComponentHelper helper) { // add the types of the parent project @@ -158,14 +184,13 @@ * @param ue The component helper has access via ue to the entire XML tree. * @param ns Namespace. Also available as ue.getNamespace() * @param taskName The element name. Also available as ue.getTag() - * @return - * @throws BuildException + * @return the created component + * @throws BuildException if an error occuries */ -public Object createComponent( UnknownElement ue, - String ns, - String taskName ) -throws BuildException -{ +public Object createComponent(UnknownElement ue, + String ns, + String taskName) +throws BuildException { Object component = createComponent(taskName); if (component == null) { return null; @@ -189,9 +214,7 @@ * name is prefixed withe the namespace uri and ":" * @return the class if found or null if not. */ - public Object createComponent(String componentName) -throws BuildException -{ +public Object createComponent(String componentName) { return antTypeTable.create(componentName); } @@ -209,18 +232,19 @@ /** * Return the antTypeDefinition for a componentName + * @param componentName the name of the component + * @return the ant definition or null if not present */ public AntTypeDefinition getDefinition(String componentName) { return antTypeTable.getDefinition(componentName); } -/** Initialization code - implementing the original ant component +/** + * Initialization code - implementing the original ant component * loading from /org/apache/tools/ant/taskdefs/default.properties * and .../types/default.properties - * - * @t
cvs commit: ant/src/etc/testcases/taskdefs/optional script.xml
peterreilly2003/07/04 12:20:53 Modified:src/etc/testcases/taskdefs/optional script.xml Log: fix for concurrent access to list exception for rhino testcase The original script added tasks to the current target. This is not a good idea, as an the task list of the target is being walked. A change made recently uses an iterator instead of an enumerator to walk the list. The iterator picks up the fact that the list has been changed and causes the concurrent access exception. Revision ChangesPath 1.3 +1 -1 ant/src/etc/testcases/taskdefs/optional/script.xml Index: script.xml === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/script.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- script.xml21 Nov 2002 10:06:13 - 1.2 +++ script.xml4 Jul 2003 19:20:53 - 1.3 @@ -10,7 +10,7 @@ for (i=1; i<=10; i++) { echo = testproject.createTask("echo"); -setup1.addTask(echo); +example1.addTask(echo); echo.setMessage(i*i); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Concat.java
peterreilly2003/07/07 07:39:14 Modified:src/main/org/apache/tools/ant/taskdefs Concat.java Log: Checkstyle changes Revision ChangesPath 1.22 +62 -28ant/src/main/org/apache/tools/ant/taskdefs/Concat.java Index: Concat.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Concat.java 6 Jul 2003 09:57:36 - 1.21 +++ Concat.java 7 Jul 2003 14:39:13 - 1.22 @@ -159,17 +159,11 @@ /** 1.1 utilities and copy utilities */ private static FileUtils fileUtils = FileUtils.newFileUtils(); -// Constructors. - -/** - * Public, no-argument constructor. Required by Ant. - */ -public Concat() {} - // Attribute setters. /** * Sets the destination file, or uses the console if not specified. + * @param destinationFile the destination file */ public void setDestfile(File destinationFile) { this.destinationFile = destinationFile; @@ -180,6 +174,7 @@ * true the stream data will be appended to the * existing file, otherwise the existing file will be * overwritten. Defaults to false. + * @param append if true append to the file. */ public void setAppend(boolean append) { this.append = append; @@ -187,6 +182,8 @@ /** * Sets the character encoding + * @param encoding the encoding of the input stream and unless + *outputencoding is set, the outputstream. */ public void setEncoding(String encoding) { this.encoding = encoding; @@ -197,6 +194,7 @@ /** * Sets the character encoding for outputting + * @param outputEncoding the encoding for the output file * @since Ant 1.6 */ public void setOutputEncoding(String outputEncoding) { @@ -205,6 +203,8 @@ /** * Force overwrite existing destination file + * @param force if true always overwrite, otherwise only overwrite + * if the output file is older any of the input files. * @since Ant 1.6 */ public void setForce(boolean force) { @@ -215,6 +215,7 @@ /** * Path of files to concatenate. + * @return the path used for concatenating * @since Ant 1.6 */ public Path createPath() { @@ -225,6 +226,7 @@ /** * Set of files to concatenate. + * @param set the set of files */ public void addFileset(FileSet set) { sources.addElement(set); @@ -232,6 +234,7 @@ /** * List of files to concatenate. + * @param list the list of files */ public void addFilelist(FileList list) { sources.addElement(list); @@ -239,6 +242,7 @@ /** * Adds a FilterChain. + * @param filterChain a filterchain to filter the concatenated input * @since Ant 1.6 */ public void addFilterChain(FilterChain filterChain) { @@ -250,6 +254,7 @@ /** * This method adds text which appears in the 'concat' element. + * @param text the text to be concated. */ public void addText(String text) { if (textBuffer == null) { @@ -265,6 +270,7 @@ /** * Add a header to the concatenated output + * @param header the header * @since Ant 1.6 */ public void addHeader(TextElement header) { @@ -273,6 +279,7 @@ /** * Add a footer to the concatenated output + * @param footer the footer * @since Ant 1.6 */ public void addFooter(TextElement footer) { @@ -282,6 +289,8 @@ /** * Append line.separator to files that do not end * with a line.separator, default false. + * @param fixLastLine if true make sure each input file has + *new line on the concatenated stream * @since Ant 1.6 */ public void setFixLastLine(boolean fixLastLine) { @@ -290,7 +299,11 @@ /** * Specify the end of line to find and to add if - * not present at end of each input file. + * not present at end of each input file. This attribute + * is used in conjuction with fixlastline. + * @param enum the type of new line to add - + * cr, mac, lf, unix, crlf, or dos + * @since Ant 1.6 */ public void setEol(FixCRLF.CrLf enum) { String s = enum.getValue(); @@ -306,6 +319,7 @@ /** * set the output writer, this is to allow * concat to be used as a nested element + * @param outputWriter the output writer * @since Ant 1.6 */ p
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Taskdef.java
peterreilly2003/07/07 07:40:14 Modified:src/main/org/apache/tools/ant/taskdefs Taskdef.java Log: add comment Revision ChangesPath 1.30 +4 -1 ant/src/main/org/apache/tools/ant/taskdefs/Taskdef.java Index: Taskdef.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Taskdef.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- Taskdef.java 6 Jul 2003 09:03:17 - 1.29 +++ Taskdef.java 7 Jul 2003 14:40:14 - 1.30 @@ -77,8 +77,11 @@ /** * Default constuctor. - * + * Creates a new Taskdef instance. + * This sets the adapter and the adaptto classes to + * TaskAdapter and Task. */ + public Taskdef() { setAdapterClass(TaskAdapter.class); setAdaptToClass(Task.class); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant Project.java
peterreilly2003/07/07 07:54:00 Modified:src/main/org/apache/tools/ant Project.java Log: checkstyle changes Revision ChangesPath 1.143 +11 -10ant/src/main/org/apache/tools/ant/Project.java Index: Project.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.142 retrieving revision 1.143 diff -u -r1.142 -r1.143 --- Project.java 4 Jul 2003 14:04:53 - 1.142 +++ Project.java 7 Jul 2003 14:54:00 - 1.143 @@ -267,6 +267,7 @@ /** * inits a sub project - used by taskdefs.Ant + * @param subProject the subproject to initialize */ public void initSubProject(Project subProject) { ComponentHelper.getComponentHelper(subProject) @@ -1479,9 +1480,9 @@ * false otherwise. */ public static boolean toBoolean(String s) { -return (s.equalsIgnoreCase("on") || -s.equalsIgnoreCase("true") || -s.equalsIgnoreCase("yes")); +return (s.equalsIgnoreCase("on") +|| s.equalsIgnoreCase("true") +|| s.equalsIgnoreCase("yes")); } /** @@ -1978,17 +1979,17 @@ * are called * @param obj the object to invoke setProject(this) on */ -public final void setProjectReference( final Object obj ) { -if ( obj instanceof ProjectComponent ) { -( (ProjectComponent) obj ).setProject( this ); +public final void setProjectReference(final Object obj) { +if (obj instanceof ProjectComponent) { +((ProjectComponent) obj).setProject(this); return; } try { Method method = obj.getClass().getMethod( -"setProject", new Class[] {Project.class} ); -if ( method != null ) { -method.invoke( obj, new Object[] { this } ); +"setProject", new Class[] {Project.class}); +if (method != null) { +method.invoke(obj, new Object[] {this}); } } catch (Throwable e) { // ignore this if the object does not have - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Delete.java
peterreilly2003/07/14 10:29:17 Modified:src/main/org/apache/tools/ant/taskdefs Delete.java Log: fix for possible race condition on windows Revision ChangesPath 1.42 +22 -6 ant/src/main/org/apache/tools/ant/taskdefs/Delete.java Index: Delete.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- Delete.java 6 Jul 2003 09:57:36 - 1.41 +++ Delete.java 14 Jul 2003 17:29:17 - 1.42 @@ -459,7 +459,7 @@ } else { log("Deleting: " + file.getAbsolutePath()); -if (!file.delete()) { +if (!delete(file)) { String message = "Unable to delete file " + file.getAbsolutePath(); if (failonerror) { @@ -534,7 +534,23 @@ // // protected and private methods // - +/** + * Attempt to fix possible race condition when deleting + * files on WinXP. If the delete does not work, + * wait a little and try again. + */ +private boolean delete(File f) { +if (! f.delete()) { +try { +Thread.sleep(10); +return f.delete(); +} catch (InterruptedException ex) { +return f.delete(); +} +} +return true; +} + protected void removeDir(File d) { String[] list = d.list(); if (list == null) { @@ -547,7 +563,7 @@ removeDir(f); } else { log("Deleting " + f.getAbsolutePath(), verbosity); -if (!f.delete()) { +if (!delete(f)) { String message = "Unable to delete file " + f.getAbsolutePath(); if (failonerror) { @@ -560,7 +576,7 @@ } } log("Deleting directory " + d.getAbsolutePath(), verbosity); -if (!d.delete()) { +if (!delete(d)) { String message = "Unable to delete directory " + dir.getAbsolutePath(); if (failonerror) { @@ -586,7 +602,7 @@ for (int j = 0; j < files.length; j++) { File f = new File(d, files[j]); log("Deleting " + f.getAbsolutePath(), verbosity); -if (!f.delete()) { +if (!delete(f)) { String message = "Unable to delete file " + f.getAbsolutePath(); if (failonerror) { @@ -606,7 +622,7 @@ String[] dirFiles = dir.list(); if (dirFiles == null || dirFiles.length == 0) { log("Deleting " + dir.getAbsolutePath(), verbosity); -if (!dir.delete()) { +if (!delete(dir)) { String message = "Unable to delete directory " + dir.getAbsolutePath(); if (failonerror) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/etc/testcases/taskdefs/optional script.xml
peterreilly2003/07/15 02:05:53 Modified:src/main/org/apache/tools/ant Target.java src/etc/testcases/taskdefs/optional script.xml Log: use for loop instead of iterator when walking the list of tasks, this allows tasks to be added to the current list while the list is being walked. Revert the script test that failed when it was adding to the current task to test the change Revision ChangesPath 1.40 +2 -3 ant/src/main/org/apache/tools/ant/Target.java Index: Target.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- Target.java 7 Jul 2003 08:20:52 - 1.39 +++ Target.java 15 Jul 2003 09:05:52 - 1.40 @@ -311,9 +311,8 @@ */ public void execute() throws BuildException { if (testIfCondition() && testUnlessCondition()) { -Iterator it = children.iterator(); -while (it.hasNext()) { -Object o = it.next(); +for (int i = 0; i < children.size(); ++i) { +Object o = children.get(i); if (o instanceof Task) { Task task = (Task) o; task.perform(); 1.4 +1 -1 ant/src/etc/testcases/taskdefs/optional/script.xml Index: script.xml === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/script.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- script.xml4 Jul 2003 19:20:53 - 1.3 +++ script.xml15 Jul 2003 09:05:53 - 1.4 @@ -10,7 +10,7 @@ for (i=1; i<=10; i++) { echo = testproject.createTask("echo"); -example1.addTask(echo); +setup1.addTask(echo); echo.setMessage(i*i); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs SubAnt.java
peterreilly2003/07/15 09:44:28 Modified:src/main/org/apache/tools/ant/taskdefs SubAnt.java Log: stylecheck Revision ChangesPath 1.7 +17 -16ant/src/main/org/apache/tools/ant/taskdefs/SubAnt.java Index: SubAnt.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/SubAnt.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- SubAnt.java 5 Jul 2003 14:34:12 - 1.6 +++ SubAnt.java 15 Jul 2003 16:44:27 - 1.7 @@ -117,8 +117,7 @@ /** * Runs the various sub-builds. */ -public void execute() -throws BuildException { +public void execute() { if (buildpath == null) { throw new BuildException("No buildpath specified"); } @@ -135,15 +134,14 @@ target = getOwningTarget().getName(); } */ -for (int i=0; i - * Use genericantfile, in order to run the same build file with different basedirs. + * Use genericantfile, in order to run the same build file + * with different basedirs. * If this attribute is set, antfile is ignored. * - * @param afile (path of the generic ant file, absolute or relative to project base directory) + * @param afile (path of the generic ant file, absolute or relative to + * project base directory) * */ public void setGenericAntfile(File afile) { -this.genericantfile=afile; +this.genericantfile = afile; } /** @@ -227,6 +227,7 @@ /** * The target to call on the different sub-builds. Set to "" to execute * the default target. + * @param target the target * */ // REVISIT: Defaults to the target name that contains this task if not specified. @@ -287,6 +288,7 @@ /** * Corresponds to <ant>'s * nested <propertyset> element. + * @param ps the propertset */ public void addPropertyset(PropertySet ps) { propertySets.addElement(ps); @@ -354,8 +356,7 @@ * * @return the newly created nested build path element. */ -public Path.PathElement createBuildpathElement() -throws BuildException { +public Path.PathElement createBuildpathElement() { return getBuildpath().createPathElement(); } @@ -392,7 +393,7 @@ Ant ant = (Ant) getProject().createTask("ant"); ant.setOwningTarget(getOwningTarget()); ant.init(); -if(target != null && target.length()>0) { +if (target != null && target.length() > 0) { ant.setTarget(target); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual running.html
peterreilly2003/07/16 07:14:48 Modified:src/main/org/apache/tools/ant Project.java Main.java src/main/org/apache/tools/ant/taskdefs SubAnt.java docs/manual running.html Log: Add make's keep-going feature into ANT. PR: 21144 Obtained from: Alexey Solofnenko Revision ChangesPath 1.145 +93 -8 ant/src/main/org/apache/tools/ant/Project.java Index: Project.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.144 retrieving revision 1.145 diff -u -r1.144 -r1.145 --- Project.java 8 Jul 2003 00:26:38 - 1.144 +++ Project.java 16 Jul 2003 14:13:53 - 1.145 @@ -65,6 +65,8 @@ import java.util.Properties; import java.util.Stack; import java.util.Vector; +import java.util.Set; +import java.util.HashSet; import org.apache.tools.ant.input.DefaultInputHandler; import org.apache.tools.ant.input.InputHandler; import org.apache.tools.ant.types.FilterSet; @@ -208,6 +210,11 @@ private InputStream defaultInputStream = null; /** + * Keep going flag + */ +private boolean keepGoingMode = false; + +/** * Sets the input handler * * @param handler the InputHandler instance to use for gathering input. @@ -272,6 +279,7 @@ public void initSubProject(Project subProject) { ComponentHelper.getComponentHelper(subProject) .initSubProject(ComponentHelper.getComponentHelper(this)); +subProject.setKeepGoingMode(this.isKeepGoingMode()); } /** @@ -779,6 +787,26 @@ } /** + * Sets "keep-going" mode. In this mode ANT will try to execute + * as many targets as possible. All targets that do not depend + * on failed target(s) will be executed. + * @param keepGoingMode "keep-going" mode + * @since Ant 1.6 + */ +public void setKeepGoingMode(boolean keepGoingMode) { +this.keepGoingMode = keepGoingMode; +} + +/** + * Returns the keep-going mode. + * @return "keep-going" mode + * @since Ant 1.6 + */ +public boolean isKeepGoingMode() { +return this.keepGoingMode; +} + +/** * Returns the version of Java this class is running under. * @return the version of Java as a String, e.g. "1.1" * @see org.apache.tools.ant.util.JavaEnvUtils#getJavaVersion @@ -1174,13 +1202,70 @@ // graph. Vector sortedTargets = topoSort(targetName, targets); -int curidx = 0; -Target curtarget; - -do { -curtarget = (Target) sortedTargets.elementAt(curidx++); -curtarget.performTasks(); -} while (!curtarget.getName().equals(targetName)); +Set succeededTargets = new HashSet(); +BuildException buildException = null; // first build exception +for (Enumeration iter = sortedTargets.elements(); + iter.hasMoreElements();) { +Target curtarget = (Target) iter.nextElement(); +boolean canExecute = true; +for (Enumeration depIter = curtarget.getDependencies(); + depIter.hasMoreElements();) { +String dependencyName = ((String) depIter.nextElement()); +if (!succeededTargets.contains(dependencyName)) { +canExecute = false; +log(curtarget, +"Cannot execute '" + curtarget.getName() + "' - '" ++ dependencyName + "' failed or was not executed.", +MSG_ERR); +break; +} +} +if (canExecute) { +Throwable thrownException = null; +try { +curtarget.performTasks(); +succeededTargets.add(curtarget.getName()); +} catch (RuntimeException ex) { +if (!(keepGoingMode)) { +throw ex; // throw further +} +thrownException = ex; +} catch (Throwable ex) { +if (!(keepGoingMode)) { +throw new BuildException(ex); +} +thrownException = ex; +} +if (thrownException != null) { +if (thrownException instanceof BuildException) { +log(curtarget, +"Target '" + curtarget.getName() ++ "' failed with message '" +
cvs commit: ant WHATSNEW
peterreilly2003/07/16 07:17:35 Modified:.WHATSNEW Log: add keep-going feature Revision ChangesPath 1.458 +2 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.457 retrieving revision 1.458 diff -u -r1.457 -r1.458 --- WHATSNEW 14 Jul 2003 20:21:06 - 1.457 +++ WHATSNEW 16 Jul 2003 14:17:25 - 1.458 @@ -489,6 +489,8 @@ * DirectoryScanner has been optimized for cases where include patterns do not start with wildcards Bugzilla Report 20103. +* Added keep-going feature. Bugzilla Report 21144 + Changes from Ant 1.5.2 to Ant 1.5.3 === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ImportTask.java
peterreilly2003/07/16 07:39:47 Modified:src/main/org/apache/tools/ant Target.java src/main/org/apache/tools/ant/helper ProjectHelper2.java src/testcases/org/apache/tools/ant/taskdefs ImportTest.java .build.xml docs/manual/CoreTasks import.html src/main/org/apache/tools/ant/taskdefs ImportTask.java Log: get the tasks imported using to be placed in-line and not at the end of the current tasks Revision ChangesPath 1.41 +34 -3 ant/src/main/org/apache/tools/ant/Target.java Index: Target.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Target.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Target.java 15 Jul 2003 09:05:52 - 1.40 +++ Target.java 16 Jul 2003 14:38:54 - 1.41 @@ -80,10 +80,17 @@ private List/**/ dependencies = null; /** Children of this target (tasks and data types). */ private List/**/ children = new ArrayList(5); +/** Position in task list */ +private int taskPosition = 0; + /** Project this target belongs to. */ private Project project; /** Description of this target, if any. */ private String description = null; +/** If adding top-level imported tasks */ +private boolean addingImportedTasks; +/** Imported tasks/types being added */ +private List importedTasks = null; /** Sole constructor. */ public Target() { @@ -166,12 +173,34 @@ } /** + * This method called when an import file is being processed. + * The top-level tasks/types are placed in the importedTasks array. + * + */ +public void startImportedTasks() { +importedTasks = new ArrayList(); +} + +/** * Adds a task to this target. * * @param task The task to be added. Must not be null. */ public void addTask(Task task) { -children.add(task); +if (importedTasks != null) { +importedTasks.add(task); +} else { +children.add(task); +} +} + +/** + * This method called when an import file is being processed. + * The top-level tasks/types are placed in the importedTasks array. + * + */ +public void endImportedTasks() { +children.addAll(taskPosition + 1, importedTasks); } /** @@ -311,8 +340,10 @@ */ public void execute() throws BuildException { if (testIfCondition() && testUnlessCondition()) { -for (int i = 0; i < children.size(); ++i) { -Object o = children.get(i); +for (taskPosition = 0; + taskPosition < children.size(); + ++taskPosition) { +Object o = children.get(taskPosition); if (o instanceof Task) { Task task = (Task) o; task.perform(); 1.21 +5 -2 ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java Index: ProjectHelper2.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- ProjectHelper2.java 4 Jul 2003 14:04:53 - 1.20 +++ ProjectHelper2.java 16 Jul 2003 14:39:07 - 1.21 @@ -119,7 +119,9 @@ if (this.getImportStack().size() > 1) { // we are in an imported file. context.setIgnoreProjectTag(true); +context.getCurrentTarget().startImportedTasks(); parse(project, source, new RootHandler(context)); +context.getCurrentTarget().endImportedTasks(); } else { // top level file parse(project, source, new RootHandler(context)); @@ -468,6 +470,7 @@ throws SAXParseException { String id = null; String baseDir = null; +boolean nameAttributeSet = false; Project project = context.getProject(); @@ -495,7 +498,7 @@ } else if (key.equals("name")) { if (value != null) { context.setCurrentProjectName(value); - +nameAttributeSet = true; if (!context.isIgnoringProjectTag()) { project.setName(value); project.addReference(value, project); @@ -522,7 +525,7 @@ // XXX Move to Project ( so it is shared by all helpers ) Str
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ImportTask.java
peterreilly2003/07/17 02:21:32 Modified:src/main/org/apache/tools/ant/taskdefs ImportTask.java Log: checkstyle Revision ChangesPath 1.14 +29 -26 ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java Index: ImportTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ImportTask.java 16 Jul 2003 14:39:44 - 1.13 +++ ImportTask.java 17 Jul 2003 09:21:32 - 1.14 @@ -54,7 +54,10 @@ package org.apache.tools.ant.taskdefs; -import org.apache.tools.ant.*; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.Task; import java.io.File; import java.io.IOException; @@ -92,67 +95,68 @@ * @ant.task category="control" */ public class ImportTask extends Task { -String file; +private String file; /** * the name of the file to import. How relative paths are resolved is still * in flux: use absolute paths for safety. - * @param file + * @param file the name of the file */ -public void setFile( String file ) { +public void setFile(String file) { // I don't think we can use File - different rules // for relative paths. -this.file=file; +this.file = file; } /** * This relies on the task order model. * */ -public void execute() throws BuildException -{ +public void execute() { if (file == null) { throw new BuildException("import requires file attribute"); } -ProjectHelper helper= - (ProjectHelper)getProject().getReference("ant.projectHelper"); -Vector importStack=helper.getImportStack(); -if( importStack.size() == 0) { +ProjectHelper helper = +(ProjectHelper) getProject().getReference("ant.projectHelper"); +Vector importStack = helper.getImportStack(); +if (importStack.size() == 0) { // this happens if ant is used with a project // helper that doesn't set the import. throw new BuildException("import requires support in ProjectHelper"); } -Object currentSource=importStack.elementAt(importStack.size() - 1); +Object currentSource = importStack.elementAt(importStack.size() - 1); //ProjectHelper2.AntXmlContext context; // context=(ProjectHelper2.AntXmlContext)project.getReference("ant.parsing.context"); //File buildFile=context.buildFile; //File buildFileParent=context.buildFileParent; -File buildFile=(File)currentSource; -buildFile=new File( buildFile.getAbsolutePath()); +File buildFile = (File) currentSource; +buildFile = new File(buildFile.getAbsolutePath()); //System.out.println("Importing from " + currentSource); -File buildFileParent=new File(buildFile.getParent()); +File buildFileParent = new File(buildFile.getParent()); -getProject().log("Importing file "+ file +" from "+ -buildFile.getAbsolutePath(), Project.MSG_VERBOSE); +getProject().log("Importing file " + file + " from " + + buildFile.getAbsolutePath(), Project.MSG_VERBOSE); // Paths are relative to the build file they're imported from, // *not* the current directory (same as entity includes). File importedFile = new File(file); if (!importedFile.isAbsolute()) { -importedFile = new File( buildFileParent, file); +importedFile = new File(buildFileParent, file); } if (!importedFile.exists()) { -throw new BuildException("Cannot find "+file+" imported from "+ - buildFile.getAbsolutePath()); +throw new BuildException( +"Cannot find " + file + " imported from " ++ buildFile.getAbsolutePath()); } -if( importStack.contains(importedFile) ) { -getProject().log("\nSkipped already imported file to avoid loop:\n "+ -importedFile + "\n",Project.MSG_WARN); +if (importStack.contains(importedFile)) { +getProject().log( +"\nSkipped already imported file to avoid loop:\n " +
cvs commit: ant/src/main/org/apache/tools/ant Location.java
peterreilly2003/07/17 02:25:13 Modified:src/main/org/apache/tools/ant Location.java Log: Expose filename and linecount of location Revision ChangesPath 1.15 +17 -0 ant/src/main/org/apache/tools/ant/Location.java Index: Location.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Location.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Location.java 6 Jul 2003 09:57:34 - 1.14 +++ Location.java 17 Jul 2003 09:25:13 - 1.15 @@ -131,6 +131,22 @@ } /** + * @return the filename portion of the location + * @since Ant 1.6 + */ +public String getFileName() { +return fileName; +} + +/** + * @return the line number + * @since Ant 1.6 + */ +public int getLineNumber() { +return lineNumber; +} + +/** * Returns the file name, line number, a colon and a trailing space. * An error message can be appended easily. For unknown locations, an * empty string is returned. @@ -156,4 +172,5 @@ return buf.toString(); } + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/etc/testcases/taskdefs/import/subdir - New directory
peterreilly2003/07/17 02:32:26 ant/src/etc/testcases/taskdefs/import/subdir - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/etc/testcases/taskdefs/import/subdir serial.xml
peterreilly2003/07/17 03:39:07 Modified:src/main/org/apache/tools/ant/taskdefs ImportTask.java src/testcases/org/apache/tools/ant/taskdefs ImportTest.java src/testcases/org/apache/tools/ant BuildFileTest.java Added: src/etc/testcases/taskdefs/import/subdir serial.xml Log: Fix for serial import relative files bug The import task now uses getLocation().getFileName() to get the file that the task is located and not the importstack. Also the canonical form of the imported file is stored in the importstack. Changed message if imported file is imported more than once. Include unit test for above. PR: 21662 Revision ChangesPath 1.15 +9 -4 ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java Index: ImportTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ImportTask.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ImportTask.java 17 Jul 2003 09:21:32 - 1.14 +++ ImportTask.java 17 Jul 2003 10:39:07 - 1.15 @@ -125,14 +125,17 @@ // helper that doesn't set the import. throw new BuildException("import requires support in ProjectHelper"); } -Object currentSource = importStack.elementAt(importStack.size() - 1); - //ProjectHelper2.AntXmlContext context; // context=(ProjectHelper2.AntXmlContext)project.getReference("ant.parsing.context"); //File buildFile=context.buildFile; //File buildFileParent=context.buildFileParent; -File buildFile = (File) currentSource; + +if (getLocation() == null || getLocation().getFileName() == null) { +throw new BuildException("Unable to get location of import task"); +} + +File buildFile = new File(getLocation().getFileName()); buildFile = new File(buildFile.getAbsolutePath()); //System.out.println("Importing from " + currentSource); File buildFileParent = new File(buildFile.getParent()); @@ -153,9 +156,11 @@ + buildFile.getAbsolutePath()); } +importedFile = new File(getPath(importedFile)); + if (importStack.contains(importedFile)) { getProject().log( -"\nSkipped already imported file to avoid loop:\n " +"Skipped already imported file:\n " + importedFile + "\n", Project.MSG_WARN); return; } 1.4 +7 -5 ant/src/testcases/org/apache/tools/ant/taskdefs/ImportTest.java Index: ImportTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ImportTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ImportTest.java 16 Jul 2003 14:39:08 - 1.3 +++ ImportTest.java 17 Jul 2003 10:39:07 - 1.4 @@ -74,11 +74,7 @@ public void testSimpleImport() { configureProject("src/etc/testcases/taskdefs/import/import.xml"); -String logMessage = getLog(); -String expect = "Before importIn imported topAfter import"; -assertTrue("expecting log to contain \"" + expect + "\" log was \"" - + logMessage + "\"", - logMessage.indexOf(expect) >= 0); +assertLogContaining("Before importIn imported topAfter import"); } public void testUnnamedNesting() { @@ -87,6 +83,12 @@ String log = getLog(); assertTrue("Warnings logged when not expected: " + log, log.length() == 0); +} + +public void testSerial() { + configureProject("src/etc/testcases/taskdefs/import/subdir/serial.xml"); +assertLogContaining( +"Unnamed2.xmlUnnamed1.xmlSkipped already imported file"); } } 1.24 +12 -4 ant/src/testcases/org/apache/tools/ant/BuildFileTest.java Index: BuildFileTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/BuildFileTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- BuildFileTest.java9 Jun 2003 13:38:07 - 1.23 +++ BuildFileTest.java17 Jul 2003 10:39:07 - 1.24 @@ -108,17 +108,25 @@ String realLog = getLog(); assertEquals(log, realLog); } + +/** + * Assert that the given substring is in the log
cvs commit: ant/src/main/org/apache/tools/ant TaskAdapter.java
peterreilly2003/07/17 04:04:16 Modified:src/main/org/apache/tools/ant TaskAdapter.java Log: checkstyle Revision ChangesPath 1.23 +3 -1 ant/src/main/org/apache/tools/ant/TaskAdapter.java Index: TaskAdapter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/TaskAdapter.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- TaskAdapter.java 6 Jul 2003 09:57:34 - 1.22 +++ TaskAdapter.java 17 Jul 2003 11:04:16 - 1.23 @@ -112,6 +112,8 @@ /** * check if the proxy class is a valid class to use * with this adapter. + * the class must have a public no-arg "execute()" method. + * @param proxyClass the class to check */ public void checkProxyClass(Class proxyClass) { checkTaskClass(proxyClass, getProject()); @@ -184,7 +186,7 @@ * @return the target proxy object */ public Object getProxy() { -return this.proxy ; +return proxy; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual base_task_classes.html
peterreilly2003/07/21 02:06:45 Modified:docs/manual base_task_classes.html Log: typeo Revision ChangesPath 1.3 +3 -3 ant/docs/manual/base_task_classes.html Index: base_task_classes.html === RCS file: /home/cvs/ant/docs/manual/base_task_classes.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- base_task_classes.html1 Jun 2002 12:26:32 - 1.2 +++ base_task_classes.html21 Jul 2003 09:06:45 - 1.3 @@ -6,8 +6,8 @@ -Tasks Desgined for Extension -These classes are desgined to be extended. Always start here when writting your own task. +Tasks Designed for Extension +These classes are designed to be extended. Always start here when writting your own task. @@ -23,7 +23,7 @@ -Task +Task Base class for all tasks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs TypedefTest.java
peterreilly2003/07/21 03:10:07 Modified:src/main/org/apache/tools/ant ComponentHelper.java src/etc/testcases/taskdefs typedef.xml src/testcases/org/apache/tools/ant/taskdefs TypedefTest.java Log: Fix for NPE reported by Nick Chalko. When overriding a definition the code did not check if the old (or new) definitions classes existed Revision ChangesPath 1.19 +28 -2 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ComponentHelper.java 6 Jul 2003 09:57:34 - 1.18 +++ ComponentHelper.java 21 Jul 2003 10:10:06 - 1.19 @@ -587,9 +587,33 @@ } -/** return true if the two definitions are the same */ +/** + * check if definition is a valid definition - it + * may be a definition of an optional task that + * does not exist + * @param def the definition to test + * @return true if exposed type of definition is present + */ +private boolean validDefinition(AntTypeDefinition def) { +if (def.getTypeClass(project) == null +|| def.getExposedClass(project) == null) { +return false; +} +return true; +} + +/** + * check if two definitions are the same + * @param def the new definition + * @param old the old definition + * @return true if the two definitions are the same + */ private boolean sameDefinition( AntTypeDefinition def, AntTypeDefinition old) { +if (!validDefinition(def) || !validDefinition(old)) { +return validDefinition(def) == validDefinition(old); +} + if (!(old.getTypeClass(project).equals(def.getTypeClass(project { return false; } @@ -600,9 +624,11 @@ return true; } + /** * update the component definition table with a new or * modified definition. + * @param def the definition to update or insert */ private void updateDataTypeDefinition(AntTypeDefinition def) { String name = def.getName(); @@ -615,7 +641,7 @@ return; } Class oldClass = antTypeTable.getExposedClass(name); -if (Task.class.isAssignableFrom(oldClass)) { +if (oldClass != null && Task.class.isAssignableFrom(oldClass)) { int logLevel = Project.MSG_WARN; if (def.getClassName().equals(old.getClassName()) && def.getClassLoader() == old.getClassLoader()) { 1.2 +7 -0 ant/src/etc/testcases/taskdefs/typedef.xml Index: typedef.xml === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/typedef.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- typedef.xml 9 Nov 2001 15:48:11 - 1.1 +++ typedef.xml 21 Jul 2003 10:10:06 - 1.2 @@ -46,4 +46,11 @@ + + + + +hi + 1.6 +8 -1 ant/src/testcases/org/apache/tools/ant/taskdefs/TypedefTest.java Index: TypedefTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/TypedefTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TypedefTest.java 7 Mar 2003 11:23:11 - 1.5 +++ TypedefTest.java 21 Jul 2003 10:10:07 - 1.6 @@ -104,4 +104,11 @@ ref.getClass().getName()); } +/** + * test to make sure that one can define a not present + * optional type twice and then have a valid definition. + */ +public void testDoubleNotPresent() { +expectLogContaining("double-notpresent", "hi"); +} } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Definer.java
peterreilly2003/07/22 09:40:32 Modified:src/main/org/apache/tools/ant/taskdefs Definer.java Log: add space in error message Revision ChangesPath 1.38 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/Definer.java Index: Definer.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Definer.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- Definer.java 17 Jul 2003 10:36:27 - 1.37 +++ Definer.java 22 Jul 2003 16:40:32 - 1.38 @@ -541,7 +541,7 @@ + " cannot be found"; throw new BuildException(msg, cnfe, getLocation()); } catch (NoClassDefFoundError ncdfe) { -String msg = getTaskName() + "A class needed by class " +String msg = getTaskName() + " A class needed by class " + classname + " cannot be found: " + ncdfe.getMessage(); throw new BuildException(msg, ncdfe, location); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/helper ProjectHelper2.java
peterreilly2003/07/23 03:24:40 Modified:src/main/org/apache/tools/ant/helper ProjectHelper2.java Log: stylecheck Revision ChangesPath 1.26 +105 -3 ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java Index: ProjectHelper2.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ProjectHelper2.java 19 Jul 2003 11:20:11 - 1.25 +++ ProjectHelper2.java 23 Jul 2003 10:24:39 - 1.26 @@ -102,6 +102,13 @@ */ private static FileUtils fu = FileUtils.newFileUtils(); +/** + * Parse a source xml input. + * + * @param project the current project + * @param source the xml source + * @exception BuildException if an error occurs + */ public void parse(Project project, Object source) throws BuildException { getImportStack().addElement(source); @@ -133,6 +140,9 @@ /** * Parses the project file, configuring the project as it goes. * + * @param project the current project + * @param source the xml source + * @param handler the root handler to use (contains the current context) * @exception BuildException if the configuration is invalid or cannot * be read */ @@ -232,10 +242,13 @@ * Handles the start of an element. This base implementation does * nothing. * + * @param uri the namespace URI for the tag * @param tag The name of the element being started. *Will not be null. + * @param qname The qualified name of the element. * @param attrs Attributes of the element being started. * Will not be null. + * @param context The context that this element is in. * * @exception SAXParseException if this method is not overridden, or in * case of error in an overridden version @@ -251,10 +264,14 @@ * throws an exception - you must override this method if you expect * child elements. * + * @param uri The namespace uri for this element. * @param tag The name of the element being started. *Will not be null. + * @param qname The qualified name for this element. * @param attrs Attributes of the element being started. * Will not be null. + * @param context The current context. + * @return a handler (in the derived classes) * * @exception SAXParseException if this method is not overridden, or in * case of error in an overridden version @@ -267,6 +284,15 @@ + " \"", context.getLocator()); } +/** + * Handle the end of a element. + * + * @param uri the namespace uri of the element + * @param tag the tag of the element + * @param qname the qualified name of the element + * @param context the current context + * @exception SAXParseException if an error occurs + */ public void onEndChild(String uri, String tag, String qname, AntXMLContext context) throws SAXParseException { @@ -275,6 +301,9 @@ /** * Called when this element and all elements nested into it have been * handled (i.e. at the ). + * @param uri the namespace uri for this element + * @param tag the element name + * @param context the current context */ public void onEndElement(String uri, String tag, AntXMLContext context) { @@ -288,6 +317,7 @@ *Will not be null. * @param start The start element in the array. * @param count The number of characters to read from the array. + * @param context The current context. * * @exception SAXParseException if this method is not overridden, or in * case of error in an overridden version @@ -306,6 +336,7 @@ * Will be called every time a namespace is reached. * It'll verify if the ns was processed, and if not load the task * definitions. + * @param uri The namespace uri. */ protected void checkNamespace(String uri) { @@ -322,6 +353,11 @@ private AntHandler currentHandler = null; private AntXMLContext context; +/** +
cvs commit: ant/src/main/org/apache/tools/ant TypeAdapter.java
peterreilly2003/07/23 03:39:20 Modified:src/main/org/apache/tools/ant TypeAdapter.java Log: typeo Revision ChangesPath 1.4 +1 -1 ant/src/main/org/apache/tools/ant/TypeAdapter.java Index: TypeAdapter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/TypeAdapter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TypeAdapter.java 18 Jul 2003 12:45:55 - 1.3 +++ TypeAdapter.java 23 Jul 2003 10:39:19 - 1.4 @@ -98,7 +98,7 @@ * Check if the proxy class is compatible with this adapter - i.e. * the adapter will be able to adapt instances of the give class. * - * @patam proxyClass the class to be checked. + * @param proxyClass the class to be checked. */ void checkProxyClass(Class proxyClass); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/types Description.java
peterreilly2003/07/23 03:50:32 Modified:src/main/org/apache/tools/ant/types Description.java Log: stylecheck Revision ChangesPath 1.14 +9 -1 ant/src/main/org/apache/tools/ant/types/Description.java Index: Description.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Description.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Description.java 14 Jul 2003 10:28:42 - 1.13 +++ Description.java 23 Jul 2003 10:50:32 - 1.14 @@ -102,6 +102,14 @@ } } +/** + * return the descriptions from all the targets of + * a project. + * + * @param project the project to get the descriptions for. + * @return a string containing the concatenated descriptions of + * the targets. + */ public static String getDescription(Project project) { StringBuffer description = new StringBuffer(); Vector targets = (Vector) project.getReference("ant.targets"); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/util Tokenizer.java LineTokenizer.java FileUtils.java
peterreilly2003/07/23 04:32:13 Modified:docs/manual/CoreTypes filterchain.html src/main/org/apache/tools/ant/filters HeadFilter.java TailFilter.java TokenFilter.java src/main/org/apache/tools/ant/taskdefs/optional/i18n Translate.java src/main/org/apache/tools/ant/util FileUtils.java Added: src/main/org/apache/tools/ant/util Tokenizer.java LineTokenizer.java Log: Refactor: move LineTokenizer out of TokenFilter Revision ChangesPath 1.12 +1 -1 ant/docs/manual/CoreTypes/filterchain.html Index: filterchain.html === RCS file: /home/cvs/ant/docs/manual/CoreTypes/filterchain.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- filterchain.html 5 Jun 2003 18:00:36 - 1.11 +++ filterchain.html 23 Jul 2003 11:32:12 - 1.12 @@ -1256,7 +1256,7 @@ Custom string filters and tokenizers may be plugged in by extending the interfaces org.apache.tools.ant.filters.TokenFilter.Filter -and org.apache.tools.ant.filters.TokenFilter.Tokenizer respectly. +and org.apache.tools.ant.util.Tokenizer respectly. They are defined the build file using <typedef/>. For example a string filter that capitalizes words may be declared as: 1.12 +3 -2 ant/src/main/org/apache/tools/ant/filters/HeadFilter.java Index: HeadFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/HeadFilter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- HeadFilter.java 18 Jul 2003 14:21:21 - 1.11 +++ HeadFilter.java 23 Jul 2003 11:32:12 - 1.12 @@ -55,6 +55,7 @@ import java.io.IOException; import java.io.Reader; +import org.apache.tools.ant.util.LineTokenizer; import org.apache.tools.ant.types.Parameter; /** @@ -91,7 +92,7 @@ private long skip = 0; /** A line tokenizer */ -private TokenFilter.LineTokenizer lineTokenizer = null; +private LineTokenizer lineTokenizer = null; /** the current line from the input stream */ private Stringline = null; @@ -115,7 +116,7 @@ */ public HeadFilter(final Reader in) { super(in); -lineTokenizer = new TokenFilter.LineTokenizer(); +lineTokenizer = new LineTokenizer(); lineTokenizer.setIncludeDelims(true); } 1.13 +3 -2 ant/src/main/org/apache/tools/ant/filters/TailFilter.java Index: TailFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TailFilter.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- TailFilter.java 18 Jul 2003 14:21:21 - 1.12 +++ TailFilter.java 23 Jul 2003 11:32:12 - 1.13 @@ -57,6 +57,7 @@ import java.io.Reader; import java.util.LinkedList; import org.apache.tools.ant.types.Parameter; +import org.apache.tools.ant.util.LineTokenizer; /** * Reads the last n lines of a stream. (Default is last10 lines.) @@ -100,7 +101,7 @@ private int bufferPos = 0; /** A line tokenizer */ -private TokenFilter.LineTokenizer lineTokenizer = null; +private LineTokenizer lineTokenizer = null; /** the current line from the input stream */ private Stringline = null; @@ -126,7 +127,7 @@ */ public TailFilter(final Reader in) { super(in); -lineTokenizer = new TokenFilter.LineTokenizer(); +lineTokenizer = new LineTokenizer(); lineTokenizer.setIncludeDelims(true); } 1.10 +2 -112 ant/src/main/org/apache/tools/ant/filters/TokenFilter.java Index: TokenFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TokenFilter.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- TokenFilter.java 6 Jul 2003 09:03:17 - 1.9 +++ TokenFilter.java 23 Jul 2003 11:32:12 - 1.10 @@ -63,6 +63,8 @@ import org.apache.tools.ant.types.RegularExpression; import org.apache.tools.ant.types.Substitution; import org.apache.tools.ant.util.FileUtils; +import org.apache.tools.ant.util.Tokenizer; +import org.apache.tools.ant.util.LineTokenizer; import org.apache.tools.ant.util.regexp.Regexp; /** @@ -78,28 +80,6 @@ public class TokenFilter extends BaseFilterReader implements ChainableReader { /** - * input stream tokenizers implement this interface - */ -public interface Tok
cvs commit: ant/src/testcases/org/apache/tools/ant/types PolyTest.java
peterreilly2003/07/23 05:06:04 Modified:src/main/org/apache/tools/ant IntrospectionHelper.java RuntimeConfigurable.java UnknownElement.java Added: src/etc/testcases/types poly.xml src/testcases/org/apache/tools/ant/types PolyTest.java Log: This commit implements: - addConfigured(Type) to introspection rules - ant-type magic polymorhic attribute - allow types that have Project as a constructor to be used in addName(Type) and addConfiguredName(Type) methods - allow addName and addConfiguredName methods to have higher presedence that createName() methods. PR: 19897 Revision ChangesPath 1.61 +300 -84 ant/src/main/org/apache/tools/ant/IntrospectionHelper.java Index: IntrospectionHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- IntrospectionHelper.java 18 Jul 2003 12:45:54 - 1.60 +++ IntrospectionHelper.java 23 Jul 2003 12:06:03 - 1.61 @@ -70,10 +70,12 @@ * Helper class that collects the methods a task or nested element * holds to set attributes, create nested elements or hold PCDATA * elements. + * The class is final as it has a private constructor. * * @author Stefan Bodewig + * @author Peter Reilly */ -public class IntrospectionHelper implements BuildListener { +public final class IntrospectionHelper implements BuildListener { /** * Map from attribute names to attribute types @@ -205,7 +207,6 @@ attributeSetters = new Hashtable(); nestedTypes = new Hashtable(); nestedCreators = new Hashtable(); -nestedStorers = new Hashtable(); addTypeMethods = new ArrayList(); this.bean = bean; @@ -220,7 +221,7 @@ // check of add[Configured](Class) pattern if (args.length == 1 && java.lang.Void.TYPE.equals(returnType) -&& (name.equals("add") /*|| name.equals("addConfigured")*/)) { +&& (name.equals("add") || name.equals("addConfigured"))) { insertAddTypeMethod(m); continue; } @@ -286,19 +287,31 @@ && args.length == 0) { String propName = getPropertyName(name, "create"); -nestedTypes.put(propName, returnType); -nestedCreators.put(propName, new NestedCreator() { +// Check if a create of this property is already present +// add takes preference over create for CB purposes +if (nestedCreators.get(propName) == null) { +nestedTypes.put(propName, returnType); +nestedCreators.put(propName, new NestedCreator() { + +public boolean isPolyMorphic() { +return false; +} + +public Class getElementClass() { +return null; +} -public Object create(Object parent) +public Object create( +Project project, Object parent, Object ignore) throws InvocationTargetException, IllegalAccessException { - return m.invoke(parent, new Object[] {}); } +public void store(Object parent, Object child) { +} }); -nestedStorers.remove(propName); - +} } else if (name.startsWith("addConfigured") && java.lang.Void.TYPE.equals(returnType) && args.length == 1 @@ -307,24 +320,45 @@ && !args[0].isPrimitive()) { try { -final Constructor c = -args[0].getConstructor(new Class[] {}); +Constructor constructor = null; +try { +constructor = +args[0].getConstructor(new Class[] {}); +} catch (NoSuchMethodException ex) { +constructor = +args[0].getConstructor(new Class[] { +Project.class}); +} +final Constructor c = constructor;
cvs commit: ant/src/etc/testcases/types addtype.xml
peterreilly2003/07/23 05:13:59 Modified:src/testcases/org/apache/tools/ant/types AddTypeTest.java src/etc/testcases/types addtype.xml Log: add tests for addConfigured() Revision ChangesPath 1.3 +29 -1 ant/src/testcases/org/apache/tools/ant/types/AddTypeTest.java Index: AddTypeTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/types/AddTypeTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AddTypeTest.java 30 May 2003 06:35:41 - 1.2 +++ AddTypeTest.java 23 Jul 2003 12:13:58 - 1.3 @@ -118,7 +118,11 @@ "condition.condition.task", "task masking condition", "doesn't support the nested"); } - + +public void testAddConfigured() { +expectLogContaining( +"myaddconfigured", "value is Value Setexecute: value is Value Set"); +} // The following will be used as types and tasks public static interface A {} @@ -158,6 +162,30 @@ } public void execute() { project.log("My Condition execution"); +} +} + +public static class MyValue +{ +private String text = "NOT SET YET"; +public void addText(String text) { +this.text = text; +} +public String toString() { +return text; +} +} + +public static class MyAddConfigured +extends Task +{ +MyValue value; +public void addConfigured(MyValue value) { +log("value is " + value); +this.value = value; +} +public void execute() { +log("execute: value is " + value); } } 1.2 +12 -0 ant/src/etc/testcases/types/addtype.xml Index: addtype.xml === RCS file: /home/cvs/ant/src/etc/testcases/types/addtype.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- addtype.xml 28 May 2003 16:27:30 - 1.1 +++ addtype.xml 23 Jul 2003 12:13:58 - 1.2 @@ -64,6 +64,12 @@ + + @@ -110,6 +116,12 @@ > + + + + + Value Set + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant IntrospectionHelper.java
peterreilly2003/07/23 05:22:37 Modified:src/main/org/apache/tools/ant IntrospectionHelper.java Log: remove unused field Revision ChangesPath 1.62 +0 -6 ant/src/main/org/apache/tools/ant/IntrospectionHelper.java Index: IntrospectionHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- IntrospectionHelper.java 23 Jul 2003 12:06:03 - 1.61 +++ IntrospectionHelper.java 23 Jul 2003 12:22:36 - 1.62 @@ -107,12 +107,6 @@ private List addTypeMethods; /** - * Map from attribute names to methods to store configured nested types - * (String to NestedStorer). - */ -private Hashtable nestedStorers; - -/** * The method to invoke to add PCDATA. */ private Method addText = null; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs MultiMapTest.java
peterreilly2003/07/24 06:14:21 Modified:docs/manual/CoreTasks copy.html move.html src/main/org/apache/tools/ant/taskdefs Copy.java Move.java Added: src/etc/testcases/taskdefs multimap.xml src/testcases/org/apache/tools/ant/taskdefs MultiMapTest.java Log: Add multimapping to the copy and move task Some slight changes from the orignal patch - rename of ignoremultiplemapping to enablemultiplemapping and some checkstyle changes PR: 21320 Obtained from: Evan Easton Revision ChangesPath 1.19 +17 -0 ant/docs/manual/CoreTasks/copy.html Index: copy.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/copy.html,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- copy.html 19 May 2003 15:37:31 - 1.18 +++ copy.html 24 Jul 2003 13:14:20 - 1.19 @@ -118,6 +118,23 @@ No - defaults to the value of the encoding attribute if given or the default JVM encoding otherwise. + +outputencoding +The encoding to use when writing the files. +since Ant 1.6. +No - defaults to the value of the encoding +attribute if given or the default JVM encoding otherwise. + + +enablemultiplemapping + + If true the task will process to all the mappings for a + given source path. If false the task will only process + the first file or directory. This attribute is only relevant + if there is a mapper subelement. + since Ant 1.6. +No - defaults to false. + Parameters specified as nested elements 1.14 +10 -0 ant/docs/manual/CoreTasks/move.html Index: move.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/move.html,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- move.html 19 May 2003 15:37:31 - 1.13 +++ move.html 24 Jul 2003 13:14:20 - 1.14 @@ -103,6 +103,16 @@ No - defaults to the value of the encoding attribute if given or the default JVM encoding otherwise. + +enablemultiplemapping + + If true the task will process to all the mappings for a + given source path. If false the task will only process + the first file or directory. This attribute is only relevant + if there is a mapper subelement. + since Ant 1.6. +No - defaults to false. + Parameters specified as nested elements mapper 1.1 ant/src/etc/testcases/taskdefs/multimap.xml Index: multimap.xml === multicopy failed mulitmove failed singlecopy failed singlemove failed copywithempty failed movewithempty failed 1.63 +92 -47ant/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.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- Copy.java 19 Jul 2003 11:20:12 - 1.62 +++ Copy.java 24 Jul 2003 13:14:20 - 1.63 @@ -102,6 +102,7 @@ protected File destDir = null; // the destination directory protected Vector filesets = new Vector(); +private boolean enableMultipleMappings = false; protected boolean filtering = false
cvs commit: ant WHATSNEW
peterreilly2003/07/24 06:19:27 Modified:.WHATSNEW Log: multiple mappings for copy and move Revision ChangesPath 1.466 +4 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.465 retrieving revision 1.466 diff -u -r1.465 -r1.466 --- WHATSNEW 22 Jul 2003 11:57:00 - 1.465 +++ WHATSNEW 24 Jul 2003 13:19:26 - 1.466 @@ -509,6 +509,10 @@ information to applications that read the archives using java.util.ZipInputStream. Bugzilla Report 19195. +* and can now handle mappers that return multiple + mappings per source path. This behaviour is enabled by using + an enablemultiplemapping attribute. Bugzilla Report 21320. + Changes from Ant 1.5.2 to Ant 1.5.3 === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs AntlibTest.java
peterreilly2003/07/24 06:48:46 Modified:docs/manual/CoreTasks typedef.html src/main/org/apache/tools/ant/helper ProjectHelper2.java src/main/org/apache/tools/ant/taskdefs Definer.java Added: src/etc/testcases/taskdefs antlib.xml test.antlib.xml src/main/org/apache/tools/ant/taskdefs Antlib.java src/testcases/org/apache/tools/ant/taskdefs AntlibTest.java Log: Add antlib xml functionality This is patch 7204 the fourth patch of the antlib + ns enhancement. The issues reported by Stephan will need be addressed, so the implementation may change before ant 1.6 is released. PR: 19897 Revision ChangesPath 1.8 +94 -25ant/docs/manual/CoreTasks/typedef.html Index: typedef.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/typedef.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- typedef.html 26 Jun 2003 08:54:27 - 1.7 +++ typedef.html 24 Jul 2003 13:48:45 - 1.8 @@ -9,23 +9,43 @@ Typedef Description -Adds a data type definition to the current project, such that this -new type can be used in the current project. Two attributes are -needed, the name that identifies this data type uniquely, and the full -name of the class (including the packages) that implements this -type. -You can also define a group of data types at once using the file or -resource attributes. These attributes point to files in the format of -Java property files. Each line defines a single data type in the -format: - -typename=fully.qualified.java.classname - -Typedef should be used to add your own tasks and types to the system. Data -types are things like paths or filesets that can be defined at -the project level and referenced via their ID attribute. -Custom data types usually need custom tasks to put them to good use. + +Adds a task or a data type definition to the current project +such that this new type or task can be used in the current project. + + +Tasks are any class that extend org.apache.tools.ant.Task or +a class that is adapted to a Task using an adapter class. + + +Data types are things like paths or +filesets that can be defined at +the project level and referenced via their ID attribute. +Custom data types usually need custom tasks to put them to good use. + + +Two attributes are needed to make a definition, +the name that identifies this data type uniquely, and the full +name of the class (including the packages) that implements this +type. + + +You can also define a group of definitions at once using the file or +resource attributes. These attributes point to files in the format of +Java property files or an xml format. + + +For property files each line defines a single data type in the +format: + +typename=fully.qualified.java.classname + + + +The xml format is described below in the Antlib +section. + + Parameters @@ -56,6 +76,19 @@ No +format +The format of the file or resource. The values + are "properties" or "xml". If the value is "properties" the file/resource + is a property file contains name to classname pairs. If the value + is "xml", the file/resource is an xml file/resource structured according + to Antlib. + The default is "properties" unless the file/resorce name ends with + ".xml", in which case the format attribute will have the value "xml". + (introduced in ant1.6) + +No + + classpath the classpath to use when looking up classname. No @@ -102,15 +135,51 @@ No -Parameters specified as nested elements -classpath -Typedef's classpath attribute is a -PATH like structure and can also be set -via a nested classpath element. + Parameters specified as nested elements + classpath + Typedef's classpath attribute is a +PATH like structure and can also be set +via a nested classpath element. + Examples - <typedef name="urlset" classname="com.mydomain.URLSet"/> -makes a data type called urlset available to Ant. The -class com.mydomain.URLSet implements this type. + The following fragment defines define a type called urlset. + +<typedef name="urlset" classname="com.mydomain.URLSet"/> + The data type is now availabe to Ant. The + class com.mydomain.URLSet implements this type. + +Assuming a class org.acme.ant.RunnableAdapter that +extends Task and implements org.apache.tools.ant.Type
cvs commit: ant/src/main/org/apache/tools/ant IntrospectionHelper.java
peterreilly2003/07/24 06:54:05 Modified:src/main/org/apache/tools/ant IntrospectionHelper.java Log: use valueof instead of new Boolean Revision ChangesPath 1.63 +2 -1 ant/src/main/org/apache/tools/ant/IntrospectionHelper.java Index: IntrospectionHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- IntrospectionHelper.java 23 Jul 2003 12:22:36 - 1.62 +++ IntrospectionHelper.java 24 Jul 2003 13:54:04 - 1.63 @@ -894,7 +894,8 @@ public void set(Project p, Object parent, String value) throws InvocationTargetException, IllegalAccessException { m.invoke(parent, - new Boolean[] {new Boolean(Project.toBoolean(value))}); + new Boolean[] { + Boolean.valueOf(Project.toBoolean(value))}); } }; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/condition And.java Condition.java ConditionBase.java Contains.java Equals.java Http.java IsFalse.java IsReference.java IsSet.java IsTrue.java Or.java Os.java Socket.java
peterreilly2003/07/25 01:28:22 Modified:src/main/org/apache/tools/ant/taskdefs/condition And.java Condition.java ConditionBase.java Contains.java Equals.java Http.java IsFalse.java IsReference.java IsSet.java IsTrue.java Or.java Os.java Socket.java Log: checkstyle Revision ChangesPath 1.8 +6 -2 ant/src/main/org/apache/tools/ant/taskdefs/condition/And.java Index: And.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/And.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- And.java 19 Jul 2003 08:11:02 - 1.7 +++ And.java 25 Jul 2003 08:28:21 - 1.8 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -69,6 +69,10 @@ */ public class And extends ConditionBase implements Condition { +/** + * @return true if all the contained conditions evaluates to true + * @exception BuildException if an error occurs + */ public boolean eval() throws BuildException { Enumeration enum = getConditions(); while (enum.hasMoreElements()) { 1.6 +4 -2 ant/src/main/org/apache/tools/ant/taskdefs/condition/Condition.java Index: Condition.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/Condition.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Condition.java7 Mar 2003 11:23:05 - 1.5 +++ Condition.java25 Jul 2003 08:28:21 - 1.6 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001 The Apache Software Foundation. All rights + * Copyright (c) 2001,2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,8 @@ public interface Condition { /** * Is this condition true? + * @return true if the condition is true + * @exception BuildException if an error occurs */ boolean eval() throws BuildException; } 1.21 +20 -2 ant/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java Index: ConditionBase.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/ConditionBase.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- ConditionBase.java17 Jul 2003 14:17:00 - 1.20 +++ ConditionBase.java25 Jul 2003 08:28:21 - 1.21 @@ -76,6 +76,7 @@ /** * Count the conditions. * + * @return the number of conditions in the container * @since 1.1 */ protected int countConditions() { @@ -85,6 +86,7 @@ /** * Iterate through all conditions. * + * @return an enumeration to use for iteration * @since 1.1 */ protected final Enumeration getConditions() { @@ -93,7 +95,7 @@ /** * Add an <available> condition. - * + * @param a an available condition * @since 1.1 */ public void addAvailable(Available a) { @@ -103,6 +105,7 @@ /** * Add an <checksum> condition. * + * @param c a Checksum condition * @since 1.4, Ant 1.5 */ public void addChecksum(Checksum c) { @@ -112,6 +115,7 @@ /** * Add an <uptodate> condition. * + * @param u an UpToDate condition * @since 1.1 */ public void addUptodate(UpToDate u) { @@ -121,6 +125,7 @@ /** * Add an <not> condition "container". * + * @param n a Not condition * @since 1.1 */ public void addNot(Not n) { @@ -130,6 +135,7 @@ /** * Add an <and> condition "container". * + * @param a an And condition * @since 1.1 */ public void addAnd(And a) { @@ -139,6 +145,7 @@ /** * Add an <or> condition "container". * + * @param o an Or condition * @since 1.1 */ public void addOr(Or o) { @@ -148,6 +155,7 @@ /** * Add an <equals> condition. * + * @param e an Equals condition * @since 1.1 */ public void addEquals(Equa
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Move.java Copy.java
peterreilly2003/07/25 01:31:45 Modified:src/main/org/apache/tools/ant/taskdefs Move.java Copy.java Log: checkstyle Revision ChangesPath 1.40 +24 -4 ant/src/main/org/apache/tools/ant/taskdefs/Move.java Index: Move.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Move.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- Move.java 24 Jul 2003 13:14:20 - 1.39 +++ Move.java 25 Jul 2003 08:31:45 - 1.40 @@ -90,15 +90,25 @@ */ public class Move extends Copy { +/** + * Constructor of object. + * This sets the forceOverwrite attribute of the Copy parent class + * to true. + * + */ public Move() { super(); -forceOverwrite = true; +setOverwrite(true); } // // protected and private methods // +/** + * Override copy's doFileOperations to move the + * files instead of copying them. + */ protected void doFileOperations() { //Attempt complete directory renames, if any, first. if (completeDirMap.size() > 0) { @@ -190,7 +200,7 @@ if (createCount > 0) { log("Moved " + dirCopyMap.size() + " empty director" -+ (dirCopyMap.size()== 1 ? "y" : "ies") ++ (dirCopyMap.size() == 1 ? "y" : "ies") + " to " + createCount + " empty director" + (createCount == 1 ? "y" : "ies") + " under " @@ -274,6 +284,7 @@ /** * Its only ok to delete a directory tree if there are * no files in it. + * @param d the directory to check * @return true if a deletion can go ahead */ protected boolean okToDelete(File d) { @@ -299,6 +310,7 @@ /** * Go and delete the directory tree. + * @param d the directory to delete */ protected void deleteDir(File d) { String[] list = d.list(); @@ -332,7 +344,15 @@ * Method then checks if token filtering is used. If it is, this method * returns false assuming it is the responsibility to the copyFile method. * - * @throws IOException + * @param sourceFile the file to rename + * @param destFile the destination file + * @param filtering if true, filtering is in operation, file will + * be copied/deleted instead of renamed + * @param overwrite if true force overwrite even if destination file + * is newer than source file + * @return true if the file was renamed + * @exception IOException if an error occurs + * @exception BuildException if an error occurs */ protected boolean renameFile(File sourceFile, File destFile, boolean filtering, boolean overwrite) 1.64 +43 -6 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.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- Copy.java 24 Jul 2003 13:14:20 - 1.63 +++ Copy.java 25 Jul 2003 08:31:45 - 1.64 @@ -129,12 +129,16 @@ fileUtils = FileUtils.newFileUtils(); } +/** + * @return the fileutils object + */ protected FileUtils getFileUtils() { return fileUtils; } /** * Sets a single source file to copy. + * @param file the file to copy */ public void setFile(File file) { this.file = file; @@ -142,6 +146,7 @@ /** * Sets the destination file. + * @param destFile the file to copy to */ public void setTofile(File destFile) { this.destFile = destFile; @@ -149,6 +154,7 @@ /** * Sets the destination directory. + * @param destDir the destination directory */ public void setTodir(File destDir) { this.destDir = destDir; @@ -156,6 +162,7 @@ /** * Adds a FilterChain. + * @return a filter chain object */ public FilterChain createFilterChain() { FilterChain filterChain = new FilterChain(); @@ -165,6 +172,7 @@ /** * Adds a filterset. + * @return a filter set object */ public FilterSet crea
cvs commit: ant/src/main/org/apache/tools/ant RuntimeConfigurable.java UnknownElement.java
peterreilly2003/07/25 01:37:50 Modified:src/main/org/apache/tools/ant RuntimeConfigurable.java UnknownElement.java Log: checkstyle Revision ChangesPath 1.42 +5 -5 ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java Index: RuntimeConfigurable.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- RuntimeConfigurable.java 23 Jul 2003 12:06:03 - 1.41 +++ RuntimeConfigurable.java 25 Jul 2003 08:37:50 - 1.42 @@ -79,7 +79,7 @@ /** Polymorphic attribute (May be XML NS attribute later) */ private static final String ANT_TYPE = "ant-type"; - + /** Name of the element to configure. */ private String elementTag = null; @@ -94,7 +94,7 @@ /** the creator used to make the wrapped object */ private transient IntrospectionHelper.Creator creator; -/** +/** * @deprecated * XML attributes for the element. */ @@ -120,7 +120,7 @@ /** the polymorphic type */ private String polyType = null; - + /** * Sole constructor creating a wrapper for the specified object. * @@ -157,7 +157,7 @@ void setCreator(IntrospectionHelper.Creator creator) { this.creator = creator; } - + /** * Get the object for which this RuntimeConfigurable holds the configuration * information @@ -170,6 +170,7 @@ /** * get the polymorphic type for this element + * @return the ant component type name, null if not set */ public String getPolyType() { return polyType; @@ -419,7 +420,6 @@ childTask.setRuntimeConfigurableWrapper(child); } - if ((child.creator != null) && configureChildren) { child.maybeConfigure(p); child.creator.store(); 1.59 +2 -2 ant/src/main/org/apache/tools/ant/UnknownElement.java Index: UnknownElement.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- UnknownElement.java 23 Jul 2003 12:06:03 - 1.58 +++ UnknownElement.java 25 Jul 2003 08:37:50 - 1.59 @@ -318,7 +318,7 @@ for (int i = 0; it.hasNext(); i++) { RuntimeConfigurable childWrapper = parentWrapper.getChild(i); UnknownElement child = (UnknownElement) it.next(); -if (!handleChild(ih, parent, child, +if (!handleChild(ih, parent, child, childWrapper)) { if (!(parent instanceof TaskContainer)) { ih.throwNotSupported(getProject(), parent, @@ -480,7 +480,7 @@ IntrospectionHelper.Creator creator = ih.getElementCreator(getProject(), parent, childName); creator.setPolyType(childWrapper.getPolyType()); -Object realChild=creator.create(); +Object realChild = creator.create(); childWrapper.setCreator(creator); childWrapper.setProxy(realChild); if (realChild instanceof Task) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/filters/util ChainReaderHelper.java JavaClassHelper.java
peterreilly2003/07/25 01:45:27 Modified:src/main/org/apache/tools/ant/filters StringInputStream.java src/main/org/apache/tools/ant/filters/util ChainReaderHelper.java JavaClassHelper.java Log: checkstyle Revision ChangesPath 1.11 +18 -1 ant/src/main/org/apache/tools/ant/filters/StringInputStream.java Index: StringInputStream.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/StringInputStream.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- StringInputStream.java10 Feb 2003 14:13:32 - 1.10 +++ StringInputStream.java25 Jul 2003 08:45:26 - 1.11 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -125,6 +125,16 @@ } } +/** + * Reads from the Stringreader into a byte array + * + * @param b the byte array to read into + * @param off the offset in the byte array + * @param len the length in the byte array to fill + * @return the actual number read into the byte array, -1 at + * the end of the stream + * @exception IOException if an error occurs + */ public synchronized int read(byte[] b, int off, int len) throws IOException { @@ -176,6 +186,10 @@ } +/** + * @return the current number of bytes ready for reading + * @exception IOException if an error occurs + */ public synchronized int available() throws IOException { if (in == null) { throw new IOException("Stream Closed"); @@ -190,6 +204,9 @@ } } +/** + * @return false - mark is not supported + */ public boolean markSupported () { return false; // would be imprecise } 1.18 +12 -0 ant/src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java Index: ChainReaderHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- ChainReaderHelper.java18 Jul 2003 14:21:21 - 1.17 +++ ChainReaderHelper.java25 Jul 2003 08:45:26 - 1.18 @@ -98,6 +98,7 @@ /** * Sets the primary reader + * @param rdr the reader object */ public final void setPrimaryReader(Reader rdr) { primaryReader = rdr; @@ -105,6 +106,7 @@ /** * Set the project to work with + * @param project the current project */ public final void setProject(final Project project) { this.project = project; @@ -112,6 +114,8 @@ /** * Get the project + * + * @return the current project */ public final Project getProject() { return project; @@ -120,6 +124,7 @@ /** * Sets the buffer size to be used. Defaults to 4096, * if this method is not invoked. + * @param size the buffer size to use */ public final void setBufferSize(int size) { bufferSize = size; @@ -127,6 +132,8 @@ /** * Sets the collection of filter reader sets + * + * @param fchain the filter chains collection */ public final void setFilterChains(Vector fchain) { filterChains = fchain; @@ -134,6 +141,8 @@ /** * Assemble the reader + * @return the assembled reader + * @exception BuildException if an error occurs */ public final Reader getAssembledReader() throws BuildException { if (primaryReader == null) { @@ -249,6 +258,9 @@ /** * Read data from the reader and return the * contents as a string. + * @param rdr the reader object + * @return the contents of the file as a string + * @exception IOException if an error occurs */ public final String readFully(Reader rdr) throws IOException { 1.6 +5 -1 ant/src/main/org/apache/tools/ant/filters/util/JavaClassHelper.java Index: JavaClassHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/util/JavaClassHelper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JavaClassHelper.java 10 Feb 2003 14:13:33 - 1.5 +++ JavaClassHelper.java 2
cvs commit: ant/src/main/org/apache/tools/ant/types/selectors BaseExtendSelector.java
peterreilly2003/07/25 01:51:39 Modified:src/main/org/apache/tools/ant/types Environment.java src/main/org/apache/tools/ant/types/selectors BaseExtendSelector.java Log: checkstyle Revision ChangesPath 1.13 +4 -0 ant/src/main/org/apache/tools/ant/types/Environment.java Index: Environment.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Environment.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Environment.java 19 Jul 2003 11:20:22 - 1.12 +++ Environment.java 25 Jul 2003 08:51:38 - 1.13 @@ -81,6 +81,10 @@ */ private String key, value; +/** + * Constructor for variable + * + */ public Variable() { super(); } 1.6 +2 -1 ant/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java Index: BaseExtendSelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BaseExtendSelector.java 4 Jul 2003 23:18:49 - 1.5 +++ BaseExtendSelector.java 25 Jul 2003 08:51:39 - 1.6 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -110,6 +110,7 @@ * @param filename The name of the file to check * @param file A File object for this filename * @return whether the file should be selected or not + * @exception BuildException if an error occurs */ public abstract boolean isSelected(File basedir, String filename, File file) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Antlib.java Concat.java Delete.java MatchingTask.java Parallel.java Patch.java Replace.java
peterreilly2003/07/25 01:59:40 Modified:src/main/org/apache/tools/ant/taskdefs Antlib.java Concat.java Delete.java MatchingTask.java Parallel.java Patch.java Replace.java Log: checkstyle Revision ChangesPath 1.4 +3 -4 ant/src/main/org/apache/tools/ant/taskdefs/Antlib.java Index: Antlib.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Antlib.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Antlib.java 24 Jul 2003 13:48:45 - 1.3 +++ Antlib.java 25 Jul 2003 08:59:39 - 1.4 @@ -65,7 +65,6 @@ import org.apache.tools.ant.Location; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; -import org.apache.tools.ant.Target; import org.apache.tools.ant.helper.ProjectHelper2; import org.apache.tools.ant.UnknownElement; @@ -104,13 +103,13 @@ // Should be safe to parse try { ProjectHelper2 parser = new ProjectHelper2(); -UnknownElement ue = +UnknownElement ue = parser.parseUnknownElement(project, antlibUrl); // Check name is "antlib" if (!(ue.getTag().equals(TAG))) { throw new BuildException( -"Unexpected tag " + ue.getTag() + " expecting " + -TAG, ue.getLocation()); +"Unexpected tag " + ue.getTag() + " expecting " ++ TAG, ue.getLocation()); } Antlib antlib = new Antlib(); antlib.setProject(project); 1.24 +5 -2 ant/src/main/org/apache/tools/ant/taskdefs/Concat.java Index: Concat.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- Concat.java 20 Jul 2003 09:42:21 - 1.23 +++ Concat.java 25 Jul 2003 08:59:39 - 1.24 @@ -101,6 +101,9 @@ * @author Peter Reilly */ public class Concat extends Task { + +// The size of buffers to be used +private static final int BUFFER_SIZE = 8192; // Attributes. @@ -442,7 +445,7 @@ private void cat() { OutputStream os = null; Reader reader = null; -char[] buffer = new char[8192]; +char[] buffer = new char[BUFFER_SIZE]; try { @@ -535,7 +538,7 @@ throws IOException { if (filterChains != null) { ChainReaderHelper helper = new ChainReaderHelper(); -helper.setBufferSize(8192); +helper.setBufferSize(BUFFER_SIZE); helper.setPrimaryReader(in); helper.setFilterChains(filterChains); helper.setProject(getProject()); 1.45 +34 -3 ant/src/main/org/apache/tools/ant/taskdefs/Delete.java Index: Delete.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- Delete.java 19 Jul 2003 11:20:12 - 1.44 +++ Delete.java 25 Jul 2003 08:59:39 - 1.45 @@ -100,6 +100,7 @@ * @ant.task category="filesystem" */ public class Delete extends MatchingTask { +private static final int DELETE_RETRY_SLEEP_MILLIS = 10; protected File file = null; protected File dir = null; protected Vector filesets = new Vector(); @@ -170,20 +171,24 @@ /** * If true, delete empty directories. + * @param includeEmpty if true delete empty directories (only + * for filesets). Default is false. */ public void setIncludeEmptyDirs(boolean includeEmpty) { this.includeEmpty = includeEmpty; } /** - * Adds a set of files to be deleted. - */ +* Adds a set of files to be deleted. +* @param set the set of files to be deleted +*/ public void addFileset(FileSet set) { filesets.addElement(set); } /** * add a name entry on the include list + * @return a NameEntry object to be configured */ public PatternSet.NameEntry createInclude() { usedMatchingTask = true; @@ -192,6 +197,7 @@ /** * add a name entry on the include files list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createIncludesFile() { usedMatchingTask = true; @
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet DotnetDefine.java
peterreilly2003/07/25 02:01:39 Modified:src/main/org/apache/tools/ant/taskdefs/optional/dotnet DotnetDefine.java Log: checkstyle Revision ChangesPath 1.5 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java Index: DotnetDefine.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/DotnetDefine.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DotnetDefine.java 18 Jul 2003 14:21:22 - 1.4 +++ DotnetDefine.java 25 Jul 2003 09:01:39 - 1.5 @@ -71,7 +71,7 @@ /** * the name of a property which must be defined for * the definition to be set. Optional. - * @param condition + * @param condition the name of the property */ public void setIf(String condition) { this.ifCond = condition; @@ -80,7 +80,7 @@ /** * the name of a property which must be undefined for * the definition to be set. Optional. - * @param condition + * @param condition the name of the property */ public void setUnless(String condition) { this.unlessCond = condition; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ConditionTask.java Concat.java
peterreilly2003/07/25 09:23:15 Modified:src/main/org/apache/tools/ant/taskdefs ConditionTask.java Concat.java Log: checkstyle Revision ChangesPath 1.16 +5 -4 ant/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java Index: ConditionTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ConditionTask.java19 Jul 2003 08:10:59 - 1.15 +++ ConditionTask.java25 Jul 2003 16:23:15 - 1.16 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2002 The Apache Software Foundation. All rights + * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ /** * The name of the property to set. Required. - * + * @param p the name of the property * @since Ant 1.4 */ public void setProperty(String p) { @@ -93,7 +93,7 @@ /** * The value for the property to set, if condition evaluates to true. * Defaults to "true". - * + * @param v the value of the property * @since Ant 1.4 */ public void setValue(String v) { @@ -104,6 +104,7 @@ * See whether our nested condition holds and set the property. * * @since Ant 1.4 + * @exception BuildException if an error occurs */ public void execute() throws BuildException { if (countConditions() > 1) { 1.25 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/Concat.java Index: Concat.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- Concat.java 25 Jul 2003 08:59:39 - 1.24 +++ Concat.java 25 Jul 2003 16:23:15 - 1.25 @@ -101,7 +101,7 @@ * @author Peter Reilly */ public class Concat extends Task { - + // The size of buffers to be used private static final int BUFFER_SIZE = 8192; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs DefaultExcludes.java Copydir.java
peterreilly2003/07/25 09:26:52 Modified:src/main/org/apache/tools/ant/taskdefs DefaultExcludes.java Copydir.java Log: checkstyle Revision ChangesPath 1.6 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java Index: DefaultExcludes.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DefaultExcludes.java 21 Jul 2003 10:52:19 - 1.5 +++ DefaultExcludes.java 25 Jul 2003 16:26:49 - 1.6 @@ -83,12 +83,12 @@ * @exception BuildException if someting goes wrong with the build */ public void execute() throws BuildException { -if (defaultrequested == false && add.equals("") && remove.equals("") && (echo == false)) { +if (!defaultrequested && add.equals("") && remove.equals("") && !echo) { throw new BuildException(" task must set " + "at least one attribute (echo=\"false\"" + " doesn't count since that is the default"); } -if (defaultrequested == true) { +if (defaultrequested) { DirectoryScanner.resetDefaultExcludes(); } if (!add.equals("")) { @@ -97,7 +97,7 @@ if (!remove.equals("")) { DirectoryScanner.removeDefaultExclude(remove); } -if (echo == true) { +if (echo) { StringBuffer message = new StringBuffer("Current Default Excludes:\n"); String[] excludes = DirectoryScanner.getDefaultExcludes(); 1.29 +11 -1 ant/src/main/org/apache/tools/ant/taskdefs/Copydir.java Index: Copydir.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Copydir.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- Copydir.java 19 Jul 2003 11:20:12 - 1.28 +++ Copydir.java 25 Jul 2003 16:26:51 - 1.29 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000,2002 The Apache Software Foundation. All rights + * Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,10 +81,20 @@ private boolean forceOverwrite = false; private Hashtable filecopyList = new Hashtable(); +/** + * The src attribute + * + * @param src the source file + */ public void setSrc(File src) { srcDir = src; } +/** + * The dest attribute + * + * @param dest the destination file + */ public void setDest(File dest) { destDir = dest; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs XmlProperty.java
peterreilly2003/07/25 09:28:24 Modified:src/main/org/apache/tools/ant/taskdefs XmlProperty.java Log: checkstyle Revision ChangesPath 1.18 +7 -3 ant/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java Index: XmlProperty.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/XmlProperty.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- XmlProperty.java 23 Jul 2003 12:11:08 - 1.17 +++ XmlProperty.java 25 Jul 2003 16:28:24 - 1.18 @@ -54,9 +54,7 @@ package org.apache.tools.ant.taskdefs; -import java.io.BufferedInputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.util.Hashtable; import javax.xml.parsers.DocumentBuilderFactory; @@ -296,8 +294,9 @@ } catch (SAXException sxe) { // Error generated during parsing Exception x = sxe; -if (sxe.getException() != null) +if (sxe.getException() != null) { x = sxe.getException(); +} throw new BuildException(x); } catch (ParserConfigurationException pce) { @@ -572,6 +571,7 @@ /** * The XML file to parse; required. + * @param src the file to parse */ public void setFile(File src) { this.src = src; @@ -579,6 +579,7 @@ /** * the prefix to prepend to each property + * @param prefix the prefix to prepend to each property */ public void setPrefix(String prefix) { this.prefix = prefix.trim(); @@ -588,6 +589,7 @@ * flag to include the xml root tag as a * first value in the property name; optional, * default is true + * @param keepRoot if true (default), include the xml root tag */ public void setKeeproot(boolean keepRoot) { this.keepRoot = keepRoot; @@ -595,6 +597,7 @@ /** * flag to validate the XML file; optional, default false + * @param validate if true validate the XML file, default false */ public void setValidate(boolean validate) { this.validate = validate; @@ -603,6 +606,7 @@ /** * flag to treat attributes as nested elements; * optional, default false + * @param collapseAttributes if true treat attributes as nested elements */ public void setCollapseAttributes(boolean collapseAttributes) { this.collapseAttributes = collapseAttributes; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/types/selectors BaseSelectorContainer.java ContainsRegexpSelector.java ContainsSelector.java DateSelector.java DependSelector.java DepthSelector.java DifferentSelector.java ExtendSelector.java FilenameSelector.java MajoritySelector.java MappingSelector.java PresentSelector.java SelectSelector.java SelectorContainer.java SelectorScanner.java SelectorUtils.java SizeSelector.java TypeSelector.java
peterreilly2003/07/29 01:37:19 Modified:src/main/org/apache/tools/ant/types/selectors BaseSelectorContainer.java ContainsRegexpSelector.java ContainsSelector.java DateSelector.java DependSelector.java DepthSelector.java DifferentSelector.java ExtendSelector.java FilenameSelector.java MajoritySelector.java MappingSelector.java PresentSelector.java SelectSelector.java SelectorContainer.java SelectorScanner.java SelectorUtils.java SizeSelector.java TypeSelector.java Log: style Revision ChangesPath 1.11 +23 -0 ant/src/main/org/apache/tools/ant/types/selectors/BaseSelectorContainer.java Index: BaseSelectorContainer.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/BaseSelectorContainer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- BaseSelectorContainer.java4 Jul 2003 23:18:49 - 1.10 +++ BaseSelectorContainer.java29 Jul 2003 08:37:17 - 1.11 @@ -80,6 +80,7 @@ /** * Indicates whether there are any selectors here. + * @return true if there are selectors */ public boolean hasSelectors() { return !(selectorsList.isEmpty()); @@ -87,6 +88,7 @@ /** * Gives the count of the number of selectors in this container + * @return the number of selectors */ public int selectorCount() { return selectorsList.size(); @@ -94,6 +96,8 @@ /** * Returns the set of selectors as an array. + * @param p the current project + * @return an array of selectors */ public FileSelector[] getSelectors(Project p) { FileSelector[] result = new FileSelector[selectorsList.size()]; @@ -103,6 +107,7 @@ /** * Returns an enumerator for accessing the set of selectors. + * @return an enumerator for the selectors */ public Enumeration selectorElements() { return selectorsList.elements(); @@ -189,6 +194,7 @@ /** * add a "Select" selector entry on the selector list + * @param selector the selector to add */ public void addSelector(SelectSelector selector) { appendSelector(selector); @@ -196,6 +202,7 @@ /** * add an "And" selector entry on the selector list + * @param selector the selector to add */ public void addAnd(AndSelector selector) { appendSelector(selector); @@ -203,6 +210,7 @@ /** * add an "Or" selector entry on the selector list + * @param selector the selector to add */ public void addOr(OrSelector selector) { appendSelector(selector); @@ -210,6 +218,7 @@ /** * add a "Not" selector entry on the selector list + * @param selector the selector to add */ public void addNot(NotSelector selector) { appendSelector(selector); @@ -217,6 +226,7 @@ /** * add a "None" selector entry on the selector list + * @param selector the selector to add */ public void addNone(NoneSelector selector) { appendSelector(selector); @@ -224,6 +234,7 @@ /** * add a majority selector entry on the selector list + * @param selector the selector to add */ public void addMajority(MajoritySelector selector) { appendSelector(selector); @@ -231,6 +242,7 @@ /** * add a selector date entry on the selector list + * @param selector the selector to add */ public void addDate(DateSelector selector) { appendSelector(selector); @@ -238,6 +250,7 @@ /** * add a selector size entry on the selector list + * @param selector the selector to add */ public void addSize(SizeSelector selector) { appendSelector(selector); @@ -245,6 +258,7 @@ /** * add a selector filename entry on the selector list + * @param selector the selector to add */ public void addFilename(FilenameSelector selector) { appendSelector(selector); @@ -252,6 +266,7 @@ /** * add an extended selector entry on the selector list + * @param selector the selector to add */ public void addCustom(ExtendSelector selector) { appendSelector(selector); @@ -259,6 +274,7 @@ /** * add a contains selector entry on the selector list + * @param selector the selector to add */
cvs commit: ant/src/main/org/apache/tools/ant/types AbstractFileSet.java
peterreilly2003/07/29 01:43:49 Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java Log: style Revision ChangesPath 1.23 +18 -0 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.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- AbstractFileSet.java 19 Jul 2003 08:11:07 - 1.22 +++ AbstractFileSet.java 29 Jul 2003 08:43:49 - 1.23 @@ -532,6 +532,7 @@ /** * add a "Select" selector entry on the selector list + * @param selector the selector to add */ public void addSelector(SelectSelector selector) { appendSelector(selector); @@ -539,6 +540,7 @@ /** * add an "And" selector entry on the selector list + * @param selector the selector to add */ public void addAnd(AndSelector selector) { appendSelector(selector); @@ -546,6 +548,7 @@ /** * add an "Or" selector entry on the selector list + * @param selector the selector to add */ public void addOr(OrSelector selector) { appendSelector(selector); @@ -553,6 +556,7 @@ /** * add a "Not" selector entry on the selector list + * @param selector the selector to add */ public void addNot(NotSelector selector) { appendSelector(selector); @@ -560,6 +564,7 @@ /** * add a "None" selector entry on the selector list + * @param selector the selector to add */ public void addNone(NoneSelector selector) { appendSelector(selector); @@ -567,6 +572,7 @@ /** * add a majority selector entry on the selector list + * @param selector the selector to add */ public void addMajority(MajoritySelector selector) { appendSelector(selector); @@ -574,6 +580,7 @@ /** * add a selector date entry on the selector list + * @param selector the selector to add */ public void addDate(DateSelector selector) { appendSelector(selector); @@ -581,6 +588,7 @@ /** * add a selector size entry on the selector list + * @param selector the selector to add */ public void addSize(SizeSelector selector) { appendSelector(selector); @@ -588,6 +596,7 @@ /** * add a DifferentSelector entry on the selector list + * @param selector the selector to add */ public void addDifferent(DifferentSelector selector) { appendSelector(selector); @@ -595,6 +604,7 @@ /** * add a selector filename entry on the selector list + * @param selector the selector to add */ public void addFilename(FilenameSelector selector) { appendSelector(selector); @@ -602,6 +612,7 @@ /** * add a selector type entry on the selector list + * @param selector the selector to add */ public void addType(TypeSelector selector) { appendSelector(selector); @@ -609,6 +620,7 @@ /** * add an extended selector entry on the selector list + * @param selector the selector to add */ public void addCustom(ExtendSelector selector) { appendSelector(selector); @@ -616,6 +628,7 @@ /** * add a contains selector entry on the selector list + * @param selector the selector to add */ public void addContains(ContainsSelector selector) { appendSelector(selector); @@ -623,6 +636,7 @@ /** * add a present selector entry on the selector list + * @param selector the selector to add */ public void addPresent(PresentSelector selector) { appendSelector(selector); @@ -630,6 +644,7 @@ /** * add a depth selector entry on the selector list + * @param selector the selector to add */ public void addDepth(DepthSelector selector) { appendSelector(selector); @@ -637,6 +652,7 @@ /** * add a depends selector entry on the selector list + * @param selector the selector to add */ public void addDepend(DependSelector selector) { appendSelector(selector); @@ -644,6 +660,7 @@ /** * add a regular expression selector entry on the selector list + * @param selector the selector to add */ public void addContainsRegexp(ContainsRegexpSelector selector) { appendSelector(selector); @@ -651,6 +668,7 @@ /** * add an arbitary selector + * @param sel
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs MatchingTask.java
peterreilly2003/07/29 01:47:12 Modified:src/main/org/apache/tools/ant/taskdefs MatchingTask.java Log: style Revision ChangesPath 1.40 +19 -3 ant/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java Index: MatchingTask.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- MatchingTask.java 25 Jul 2003 08:59:39 - 1.39 +++ MatchingTask.java 29 Jul 2003 08:47:12 - 1.40 @@ -289,7 +289,7 @@ /** * Returns the set of selectors as an array. - * + * @param p the current project * @return an array of selectors in this container */ public FileSelector[] getSelectors(Project p) { @@ -318,6 +318,7 @@ /** * add a "Select" selector entry on the selector list + * @param selector the selector to add */ public void addSelector(SelectSelector selector) { fileset.addSelector(selector); @@ -325,6 +326,7 @@ /** * add an "And" selector entry on the selector list + * @param selector the selector to add */ public void addAnd(AndSelector selector) { fileset.addAnd(selector); @@ -332,6 +334,7 @@ /** * add an "Or" selector entry on the selector list + * @param selector the selector to add */ public void addOr(OrSelector selector) { fileset.addOr(selector); @@ -339,6 +342,7 @@ /** * add a "Not" selector entry on the selector list + * @param selector the selector to add */ public void addNot(NotSelector selector) { fileset.addNot(selector); @@ -346,6 +350,7 @@ /** * add a "None" selector entry on the selector list + * @param selector the selector to add */ public void addNone(NoneSelector selector) { fileset.addNone(selector); @@ -353,6 +358,7 @@ /** * add a majority selector entry on the selector list + * @param selector the selector to add */ public void addMajority(MajoritySelector selector) { fileset.addMajority(selector); @@ -360,6 +366,7 @@ /** * add a selector date entry on the selector list + * @param selector the selector to add */ public void addDate(DateSelector selector) { fileset.addDate(selector); @@ -367,6 +374,7 @@ /** * add a selector size entry on the selector list + * @param selector the selector to add */ public void addSize(SizeSelector selector) { fileset.addSize(selector); @@ -374,6 +382,7 @@ /** * add a selector filename entry on the selector list + * @param selector the selector to add */ public void addFilename(FilenameSelector selector) { fileset.addFilename(selector); @@ -381,6 +390,7 @@ /** * add an extended selector entry on the selector list + * @param selector the selector to add */ public void addCustom(ExtendSelector selector) { fileset.addCustom(selector); @@ -388,6 +398,7 @@ /** * add a contains selector entry on the selector list + * @param selector the selector to add */ public void addContains(ContainsSelector selector) { fileset.addContains(selector); @@ -395,6 +406,7 @@ /** * add a present selector entry on the selector list + * @param selector the selector to add */ public void addPresent(PresentSelector selector) { fileset.addPresent(selector); @@ -402,6 +414,7 @@ /** * add a depth selector entry on the selector list + * @param selector the selector to add */ public void addDepth(DepthSelector selector) { fileset.addDepth(selector); @@ -409,6 +422,7 @@ /** * add a depends selector entry on the selector list + * @param selector the selector to add */ public void addDepend(DependSelector selector) { fileset.addDepend(selector); @@ -416,6 +430,7 @@ /** * add a regular expression selector entry on the selector list + * @param selector the selector to add */ public void addContainsRegexp(ContainsRegexpSelector selector) { fileset.addContainsRegexp(selector); @@ -423,7 +438,7 @@ /** * add a type selector entry on the type list - * @param selector + * @param selector the selector to add * @since ant 1.6 */ public void addDifferent(DifferentSelector selector) { @@ -432,7 +447,7 @@ /**
cvs commit: ant/src/main/org/apache/tools/ant/filters/util ChainReaderHelper.java
peterreilly2003/07/29 01:57:32 Modified:src/main/org/apache/tools/ant/filters StringInputStream.java src/main/org/apache/tools/ant/filters/util ChainReaderHelper.java Log: style Revision ChangesPath 1.12 +1 -0 ant/src/main/org/apache/tools/ant/filters/StringInputStream.java Index: StringInputStream.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/StringInputStream.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- StringInputStream.java25 Jul 2003 08:45:26 - 1.11 +++ StringInputStream.java29 Jul 2003 08:57:32 - 1.12 @@ -64,6 +64,7 @@ */ public class StringInputStream extends InputStream { + /** Source string, stored as a StringReader */ private StringReader in; 1.19 +3 -1 ant/src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java Index: ChainReaderHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/util/ChainReaderHelper.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ChainReaderHelper.java25 Jul 2003 08:45:26 - 1.18 +++ ChainReaderHelper.java29 Jul 2003 08:57:32 - 1.19 @@ -78,6 +78,8 @@ */ public final class ChainReaderHelper { +// default buffer size +private static final int DEFAULT_BUFFER_SIZE = 8192; /** * The primary reader to which the reader chain is to be attached. */ @@ -86,7 +88,7 @@ /** * The size of the buffer to be used. */ -public int bufferSize = 8192; +public int bufferSize = DEFAULT_BUFFER_SIZE; /** * Chain of filters - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/types/selectors BaseSelector.java DateSelector.java DepthSelector.java ExtendFileSelector.java FilenameSelector.java MajoritySelector.java PresentSelector.java SelectSelector.java SelectorScanner.java SizeSelector.java
peterreilly2003/07/29 02:07:30 Modified:src/main/org/apache/tools/ant/types/selectors BaseSelector.java DateSelector.java DepthSelector.java ExtendFileSelector.java FilenameSelector.java MajoritySelector.java PresentSelector.java SelectSelector.java SelectorScanner.java SizeSelector.java Log: copyright-date Revision ChangesPath 1.6 +1 -1 ant/src/main/org/apache/tools/ant/types/selectors/BaseSelector.java Index: BaseSelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/BaseSelector.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BaseSelector.java 4 Jul 2003 23:18:49 - 1.5 +++ BaseSelector.java 29 Jul 2003 09:07:29 - 1.6 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without 1.8 +1 -1 ant/src/main/org/apache/tools/ant/types/selectors/DateSelector.java Index: DateSelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DateSelector.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DateSelector.java 29 Jul 2003 08:37:18 - 1.7 +++ DateSelector.java 29 Jul 2003 09:07:29 - 1.8 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without 1.8 +1 -1 ant/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java Index: DepthSelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DepthSelector.java29 Jul 2003 08:37:18 - 1.7 +++ DepthSelector.java29 Jul 2003 09:07:29 - 1.8 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without 1.6 +1 -1 ant/src/main/org/apache/tools/ant/types/selectors/ExtendFileSelector.java Index: ExtendFileSelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/ExtendFileSelector.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ExtendFileSelector.java 4 Jul 2003 23:18:49 - 1.5 +++ ExtendFileSelector.java 29 Jul 2003 09:07:29 - 1.6 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without 1.7 +1 -1 ant/src/main/org/apache/tools/ant/types/selectors/FilenameSelector.java Index: FilenameSelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/FilenameSelector.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- FilenameSelector.java 29 Jul 2003 08:37:18 - 1.6 +++ FilenameSelector.java 29 Jul 2003 09:07:29 - 1.7 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2002 The Apache Software Foundation. All rights + * Copyright (c) 2002-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without 1.5 +1 -1 ant/src/main/org/apache/tools/ant/types/selectors/MajoritySelector.java Index: MajoritySelector.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/selectors/MajoritySelector.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MajoritySelector.java 29 Jul 2003 08:37:18
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs PropertyTest.java
peterreilly2003/07/31 02:03:46 Modified:src/etc/testcases/taskdefs property.xml src/testcases/org/apache/tools/ant/taskdefs PropertyTest.java Log: Fix invalid URL for property test with url. PR: 21948 Revision ChangesPath 1.10 +1 -1 ant/src/etc/testcases/taskdefs/property.xml Index: property.xml === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/property.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- property.xml 24 Jul 2003 07:13:28 - 1.9 +++ property.xml 31 Jul 2003 09:03:46 - 1.10 @@ -24,7 +24,7 @@ - + 1.14 +14 -1 ant/src/testcases/org/apache/tools/ant/taskdefs/PropertyTest.java Index: PropertyTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/PropertyTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- PropertyTest.java 24 Jul 2003 07:16:34 - 1.13 +++ PropertyTest.java 31 Jul 2003 09:03:46 - 1.14 @@ -54,8 +54,12 @@ package org.apache.tools.ant.taskdefs; -import org.apache.tools.ant.*; +import java.net.URL; +import java.io.File; + import org.apache.tools.ant.BuildFileTest; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.FileUtils; /** * @author Conor MacNeill @@ -96,6 +100,15 @@ } public void test5() { +String baseDir = getProject().getProperty("basedir"); +try { +String uri = FileUtils.newFileUtils().toURI( +baseDir + "/property3.properties"); +getProject().setNewProperty( +"test5.url", uri); +} catch (Exception ex) { +throw new BuildException(ex); +} expectLog("test5", "http.url is http://localhost:999";); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Antlib.java Definer.java
peterreilly2003/08/01 01:34:00 Modified:src/main/org/apache/tools/ant/taskdefs Antlib.java Definer.java Log: Fix location when error occurs in running antlib Revision ChangesPath 1.5 +14 -25ant/src/main/org/apache/tools/ant/taskdefs/Antlib.java Index: Antlib.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Antlib.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Antlib.java 25 Jul 2003 08:59:39 - 1.4 +++ Antlib.java 1 Aug 2003 08:34:00 - 1.5 @@ -101,33 +101,21 @@ "Unable to find " + antlibUrl, ex); } // Should be safe to parse -try { -ProjectHelper2 parser = new ProjectHelper2(); -UnknownElement ue = -parser.parseUnknownElement(project, antlibUrl); -// Check name is "antlib" -if (!(ue.getTag().equals(TAG))) { -throw new BuildException( -"Unexpected tag " + ue.getTag() + " expecting " -+ TAG, ue.getLocation()); -} -Antlib antlib = new Antlib(); -antlib.setProject(project); -antlib.setLocation(ue.getLocation()); -antlib.init(); -ue.configure(antlib); -return antlib; -} catch (BuildException ex) { -Location location = ex.getLocation(); -if (location == null) { -throw ex; -} +ProjectHelper2 parser = new ProjectHelper2(); +UnknownElement ue = +parser.parseUnknownElement(project, antlibUrl); +// Check name is "antlib" +if (!(ue.getTag().equals(TAG))) { throw new BuildException( -"Error in " -+ System.getProperty("line.separator") -+ location.toString() -+ " " + ex.getMessage()); +"Unexpected tag " + ue.getTag() + " expecting " ++ TAG, ue.getLocation()); } +Antlib antlib = new Antlib(); +antlib.setProject(project); +antlib.setLocation(ue.getLocation()); +antlib.init(); +ue.configure(antlib); +return antlib; } @@ -173,6 +161,7 @@ for (Iterator i = tasks.iterator(); i.hasNext();) { UnknownElement ue = (UnknownElement) i.next(); ue.maybeConfigure(); +setLocation(ue.getLocation()); Task t = ue.getTask(); if (t == null) { continue; 1.40 +5 -5 ant/src/main/org/apache/tools/ant/taskdefs/Definer.java Index: Definer.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Definer.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- Definer.java 24 Jul 2003 13:48:45 - 1.39 +++ Definer.java 1 Aug 2003 08:34:00 - 1.40 @@ -408,14 +408,14 @@ antlib.setClassLoader(classLoader); antlib.perform(); } catch (BuildException ex) { -Location location = ex.getLocation(); -if (location == null) { +Location exLocation = ex.getLocation(); +if (exLocation == null) { throw ex; } throw new BuildException( -"Error in " +"Error executing antlib" + System.getProperty("line.separator") -+ getLocation().toString() ++ exLocation.toString() + " " + ex.getMessage()); } } @@ -474,7 +474,7 @@ definerSet = true; this.name = name; } - + /** * Returns the classname of the object we are defining. * May be null. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant Task.java
peterreilly2003/08/01 03:22:30 Modified:src/main/org/apache/tools/ant Task.java Log: style Revision ChangesPath 1.47 +10 -0 ant/src/main/org/apache/tools/ant/Task.java Index: Task.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Task.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- Task.java 18 Jul 2003 12:45:55 - 1.46 +++ Task.java 1 Aug 2003 10:22:30 - 1.47 @@ -488,10 +488,20 @@ } } +/** + * Return the type of task + * + * @return the type of task + */ protected String getTaskType() { return taskType; } +/** + * Return the runtime configurable structure for this task + * + * @return the runtime structure for this task + */ protected RuntimeConfigurable getWrapper() { return wrapper; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Ant.java
peterreilly2003/08/05 04:47:33 Modified:src/main/org/apache/tools/ant/taskdefs Ant.java Log: Remove unneeded setting of properties in reinit() Revision ChangesPath 1.84 +1 -30 ant/src/main/org/apache/tools/ant/taskdefs/Ant.java Index: Ant.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- Ant.java 24 Jul 2003 14:07:51 - 1.83 +++ Ant.java 5 Aug 2003 11:47:33 - 1.84 @@ -166,40 +166,11 @@ * This can happen if the same instance of this task is run * twice as newProject is set to null at the end of execute (to * save memory and help the GC). + * calls init() again * - * Sets all properties that have been defined as nested - * property elements. */ private void reinit() { init(); -final int count = properties.size(); -for (int i = 0; i < count; i++) { -Property p = (Property) properties.elementAt(i); -Property newP = (Property) newProject.createTask("property"); -newP.setName(p.getName()); -if (p.getValue() != null) { -newP.setValue(p.getValue()); -} -if (p.getFile() != null) { -newP.setFile(p.getFile()); -} -if (p.getResource() != null) { -newP.setResource(p.getResource()); -} -if (p.getPrefix() != null) { -newP.setPrefix(p.getPrefix()); -} -if (p.getRefid() != null) { -newP.setRefid(p.getRefid()); -} -if (p.getEnvironment() != null) { -newP.setEnvironment(p.getEnvironment()); -} -if (p.getClasspath() != null) { -newP.setClasspath(p.getClasspath()); -} -properties.setElementAt(newP, i); -} } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/etc/testcases/taskdefs calltarget.xml
peterreilly2003/08/05 06:56:27 Modified:src/testcases/org/apache/tools/ant/taskdefs CallTargetTest.java src/etc/testcases/taskdefs calltarget.xml Log: test case to show bug report 11418 PR: 11418 Obtained from: John-Mason P. Shackelford Revision ChangesPath 1.3 +12 -0 ant/src/testcases/org/apache/tools/ant/taskdefs/CallTargetTest.java Index: CallTargetTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/CallTargetTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CallTargetTest.java 22 Jul 2003 16:09:05 - 1.2 +++ CallTargetTest.java 5 Aug 2003 13:56:26 - 1.3 @@ -54,6 +54,8 @@ package org.apache.tools.ant.taskdefs; +import java.util.Vector; + import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.Project; import org.apache.tools.ant.util.JavaEnvUtils; @@ -81,6 +83,16 @@ project.executeTarget("testinheritreffilterset"); } +// see bugrep 11418 (In repeated calls to the same target, +// params will not be passed in) +public void testMultiCall() { +Vector v = new Vector(); +v.add("call-multi"); +v.add("call-multi"); +project.executeTargets(v); +assertLogContaining("multi is SETmulti is SET"); +} + public void tearDown() { project.executeTarget("cleanup"); } 1.3 +9 -1 ant/src/etc/testcases/taskdefs/calltarget.xml Index: calltarget.xml === RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/calltarget.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- calltarget.xml28 Jul 2003 00:16:06 - 1.2 +++ calltarget.xml5 Aug 2003 13:56:26 - 1.3 @@ -41,5 +41,13 @@ - + + +multi is ${multi} + + + + + + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/etc/testcases/taskdefs/style - New directory
peterreilly2003/08/05 08:50:06 ant/src/etc/testcases/taskdefs/style - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs StyleTest.java
peterreilly2003/08/05 09:01:10 Modified:docs/manual/CoreTasks style.html src/main/org/apache/tools/ant/taskdefs XSLTProcess.java Added: src/etc/testcases/taskdefs/style build.xml data.xml printParams.xsl src/testcases/org/apache/tools/ant/taskdefs StyleTest.java Log: Add if/unless attributes to element of task PR: 22044 Obtained from: Jens Submitted by: Peter Reilly & Jan Matèrne Revision ChangesPath 1.29 +14 -4 ant/docs/manual/CoreTasks/style.html Index: style.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/style.html,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- style.html26 Jul 2003 16:40:07 - 1.28 +++ style.html5 Aug 2003 16:01:10 - 1.29 @@ -187,9 +187,20 @@ expression Text value to be placed into the param. -Was originally intended to be an XSL expression. +Was originally intended to be an XSL expression. Yes + +if +The param will only passed if this property is set. +No + + +unless +The param will only passed unless this property is set. +No + + outputproperty ('trax' processors only) @@ -230,7 +241,7 @@ transformer factory to use. For example org.apache.xalan.processor.TransformerFactoryImpl or org.apache.xalan.xsltc.trax.TransformerFactoryImpl - or net.sf.saxon.TransformerFactoryImpl... + or net.sf.saxon.TransformerFactoryImpl... No. Defaults to the JAXP lookup mechanism. @@ -318,7 +329,7 @@ Using factory settings <xslt in="doc.xml" out="build/doc/output.xml" style="style/apache.xsl"> - <factory name="org.apache.xalan.processor.TransformerFactoryImpl"> + <factory name="org.apache.xalan.processor.TransformerFactoryImpl"> <attribute name="http://xml.apache.org/xalan/features/optimize"; value="true"/> </factory> </xslt> @@ -329,4 +340,3 @@ - 1.1 ant/src/etc/testcases/taskdefs/style/build.xml Index: build.xml === <param name="set" expression="${value}"/> <param name="empty" expression="${value}"/> <param name="undefined" expression="${value}"/> <param name="undefined" expression="${value}" if="value" /> 1.1 ant/src/etc/testcases/taskdefs/style/data.xml Index: data.xml === 1.1 ant/src/etc/testcases/taskdefs/style/printParams.xsl Index: printParams.xsl === http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";> set default value empty default value undefined default value set='' empty='' undefined='' 1.72 +50 -2 ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Index: XSLTProcess.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- XSLTProcess.java 26 Jul 2003 16:58:14 - 1.71 +++ XSLTProcess.java 5 Aug 2003 16:01:10 - 1.72 @@ -615,6 +615,19 @@ /** The parameter's value */ private String expression = null; +private String ifProperty; +private String unlessProperty; +private Project project; + +/** + * Set the current project + * + * @param project the current project + */ +public void setProject(Project project) { +this.project = project; +} + /** * Set the parameter name. * @@ -658,6 +671,39 @@ } return expression; } + +/** + * Set whether this param should be used. It will be + * used if the property has been set, otherwise it won't. + * @param ifProperty name of property +
cvs commit: ant WHATSNEW
peterreilly2003/08/05 09:05:38 Modified:.WHATSNEW Log: add change to WHATSNEW Revision ChangesPath 1.479 +3 -0 ant/WHATSNEW Index: WHATSNEW === RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.478 retrieving revision 1.479 diff -u -r1.478 -r1.479 --- WHATSNEW 4 Aug 2003 16:37:08 - 1.478 +++ WHATSNEW 5 Aug 2003 16:05:37 - 1.479 @@ -554,6 +554,9 @@ * and friends will consume far less memory than they used to when run with compress="false". Bugzilla Report 21899. +* and attributes added to element of
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Javac.java
peterreilly2003/08/11 06:43:10 Modified:src/main/org/apache/tools/ant/taskdefs Javac.java Log: checkstyle Revision ChangesPath 1.114 +121 -17 ant/src/main/org/apache/tools/ant/taskdefs/Javac.java Index: Javac.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- Javac.java19 Jul 2003 08:10:59 - 1.113 +++ Javac.java11 Aug 2003 13:43:10 - 1.114 @@ -231,6 +231,7 @@ /** * Set the source directories to find the source Java files. + * @param srcDir the source directories as a path */ public void setSrcdir(Path srcDir) { if (src == null) { @@ -240,7 +241,10 @@ } } -/** Gets the source dirs to find the source java files. */ +/** + * Gets the source dirs to find the source java files. + * @return the source directorys as a path + */ public Path getSrcdir() { return src; } @@ -248,6 +252,7 @@ /** * Set the destination directory into which the Java source * files should be compiled. + * @param destDir the destination director */ public void setDestdir(File destDir) { this.destDir = destDir; @@ -256,6 +261,7 @@ /** * Gets the destination directory into which the java source files * should be compiled. + * @return the destination directory */ public File getDestdir() { return destDir; @@ -263,6 +269,7 @@ /** * Set the sourcepath to be used for this compilation. + * @param sourcepath the source path */ public void setSourcepath(Path sourcepath) { if (compileSourcepath == null) { @@ -272,13 +279,17 @@ } } -/** Gets the sourcepath to be used for this compilation. */ +/** + * Gets the sourcepath to be used for this compilation. + * @return the source path + */ public Path getSourcepath() { return compileSourcepath; } /** * Adds a path to sourcepath. + * @return a sourcepath to be configured */ public Path createSourcepath() { if (compileSourcepath == null) { @@ -289,6 +300,7 @@ /** * Adds a reference to a source path defined elsewhere. + * @param r a reference to a source path */ public void setSourcepathRef(Reference r) { createSourcepath().setRefid(r); @@ -307,13 +319,17 @@ } } -/** Gets the classpath to be used for this compilation. */ +/** + * Gets the classpath to be used for this compilation. + * @return the class path + */ public Path getClasspath() { return compileClasspath; } /** * Adds a path to the classpath. + * @return a class path to be configured */ public Path createClasspath() { if (compileClasspath == null) { @@ -324,6 +340,7 @@ /** * Adds a reference to a classpath defined elsewhere. + * @param r a reference to a classpath */ public void setClasspathRef(Reference r) { createClasspath().setRefid(r); @@ -332,6 +349,8 @@ /** * Sets the bootclasspath that will be used to compile the classes * against. + * @param bootclasspath a path to use as a boot class path (may be more + * than one) */ public void setBootclasspath(Path bootclasspath) { if (this.bootclasspath == null) { @@ -344,6 +363,7 @@ /** * Gets the bootclasspath that will be used to compile the classes * against. + * @return the boot path */ public Path getBootclasspath() { return bootclasspath; @@ -351,6 +371,7 @@ /** * Adds a path to the bootclasspath. + * @return a path to be configured */ public Path createBootclasspath() { if (bootclasspath == null) { @@ -361,6 +382,7 @@ /** * Adds a reference to a classpath defined elsewhere. + * @param r a reference to a classpath */ public void setBootClasspathRef(Reference r) { createBootclasspath().setRefid(r); @@ -369,6 +391,7 @@ /** * Sets the extension directories that will be used during the * compilation. + * @param extdirs a path */ public void setExtdirs(Path extdirs) { if (this.extdirs == null) { @@ -381,6 +404,7 @@ /** * Gets the extension directories that will be used during the * compilation. + * @return the extension directories as a path
cvs commit: ant/docs/manual/CoreTypes custom-programming.html
peterreilly2003/08/13 01:35:01 Added: docs/manual/CoreTypes custom-programming.html Log: initial attempt to describe introspection based components Revision ChangesPath 1.1 ant/docs/manual/CoreTypes/custom-programming.html Index: custom-programming.html === Custom Components Custom Components Overview Custom components are conditions, selectors, filters and other objects that are defined outside ant core. In Ant 1.6 custom conditions, selectors and filters has been overhauled. It is now possible to define custom conditions, selectors and filters that behave like Ant Core components. This is achieved by allowing datatypes defined in build scripts to be used as custom components if the class of the datatype is compatible, or has been adapted by an adapter class. The old methods of defining custom components are still supported. Definition and use A custom component is a normal Java class that implements a particular interface or extends a particular class, or has been adapted to the interface or class. It is exactly like writing a custom task. One defines attributes and nested elements by writing setter methods and add methods. After the class has been written, it is added to the ant system by using <typedef>. Custom Conditions Custom conditions are datatypes that implement org.apache.tools.ant.taskdefs.condition.Condition. For example a custom condition that returns true if a string is all upper case could be written as: package com.mydomain; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.condition.Condition; public class AllUpperCaseCondition extends Condition { private String value; // The setter for the "value" attribute public void setValue(String value) { this.value = value; } // This method evaluates the condition public boolean eval() { if (value == null) { throw new BuildException("value attribute is not set"); } return value.toUpperCase().equals(value); } } Adding the condition to the system is achieved as follows: <typedef name="alluppercase" classname="com.mydomain.AllUpperCaseCondition" classpath="${mydomain.classes"/> This condition can now be used wherever a Core Ant condition is used. <condition property="allupper"> <alluppercase value="THIS IS ALL UPPER CASE"/> </condition> Custom Selectors Custom selectors are datatypes that implement org.apache.tools.ant.types.selectors.FileSelector. There is only one method required. public boolean isSelected(File basedir, String filename, File file). It returns true or false depending on whether the given file should be selected or not. An example of a custom selection that selects filenames ending in ".java" would be: package com.mydomain; import org.apache.tools.ant.types.selectors.FileSelector; public class JavaSelector { public boolean isSelected(File b, String filename, File f) { return filename.toLowerCase().endsWith(".java"); } } Adding the selector to the system is achieved as follows: <typedef name="javaselector" classname="com.mydomain.JavaSelector" classpath="${mydomain.classes"/> This selector can now be used wherever a Core Ant selector is used. One may use org.apache.tools.ant.types.selectors.BaseSelector, a convenience class that provides reasonable default behaviour. It has some predefined behaviours you can take advantage of. Any time you encounter a problem when setting attributes or adding tags, you can call setError(String errmsg) and the class will know that there is a problem. Then, at the top of your isSelected() method call validate() and a BuildException will be thrown with the contents of your error message. The validate() method also gives you a las
cvs commit: ant/docs/manual conceptstypeslist.html
peterreilly2003/08/13 01:35:51 Modified:docs/manual conceptstypeslist.html Log: initial attempt to describe introspection based components Revision ChangesPath 1.11 +6 -0 ant/docs/manual/conceptstypeslist.html Index: conceptstypeslist.html === RCS file: /home/cvs/ant/docs/manual/conceptstypeslist.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- conceptstypeslist.html12 May 2003 15:19:18 - 1.10 +++ conceptstypeslist.html13 Aug 2003 08:35:50 - 1.11 @@ -34,5 +34,11 @@ Class Fileset Extension Package Set of Extension Packages + +Custom Components +Custom Components +Conditions +Selectors +FilterReaders - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTypes custom-programming.html
peterreilly2003/08/13 02:05:22 Modified:docs/manual/CoreTypes custom-programming.html Log: fix selector example Revision ChangesPath 1.2 +23 -13ant/docs/manual/CoreTypes/custom-programming.html Index: custom-programming.html === RCS file: /home/cvs/ant/docs/manual/CoreTypes/custom-programming.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- custom-programming.html 13 Aug 2003 08:35:01 - 1.1 +++ custom-programming.html 13 Aug 2003 09:05:22 - 1.2 @@ -75,7 +75,7 @@ - Adding the condition to the system is achieved as follows: +Adding the condition to the system is achieved as follows: @@ -100,13 +100,14 @@ Custom selectors are datatypes that implement org.apache.tools.ant.types.selectors.FileSelector. - There is only one method required. -public boolean isSelected(File basedir, String filename, - File file). -It returns true -or false depending on whether the given file should be -selected or not. - + +There is only one method required. + public boolean isSelected(File basedir, String filename, +File file). + It returns true + or false depending on whether the given file should be + selected or not. + An example of a custom selection that selects filenames ending in ".java" would be: @@ -114,8 +115,9 @@ package com.mydomain; +import java.io.File; import org.apache.tools.ant.types.selectors.FileSelector; -public class JavaSelector { +public class JavaSelector implements FileSelector { public boolean isSelected(File b, String filename, File f) { return filename.toLowerCase().endsWith(".java"); } @@ -123,8 +125,6 @@ - - Adding the selector to the system is achieved as follows: @@ -135,10 +135,20 @@ classpath="${mydomain.classes"/> - + This selector can now be used wherever a Core Ant selector - is used. + is used, for example: + + +<copy todir="to"> + <fileset dir="src"> + <javaselector/> + </fileset> +</copy> + + + One may use org.apache.tools.ant.types.selectors.BaseSelector, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant AntTypeDefinition.java
peterreilly2003/08/13 05:45:41 Modified:src/main/org/apache/tools/ant AntTypeDefinition.java Log: remove unused copy method Revision ChangesPath 1.4 +0 -15 ant/src/main/org/apache/tools/ant/AntTypeDefinition.java Index: AntTypeDefinition.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/AntTypeDefinition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AntTypeDefinition.java4 Jul 2003 09:35:31 - 1.3 +++ AntTypeDefinition.java13 Aug 2003 12:45:41 - 1.4 @@ -73,21 +73,6 @@ private ClassLoader classLoader; /** - * Clone this definition and changed the cloned definitions' project. - * @returnthe cloned definition - */ -public AntTypeDefinition copy() { -AntTypeDefinition copy = new AntTypeDefinition(); -copy.name = name; -copy.clazz = clazz; -copy.adapterClass = adapterClass; -copy.className = className; -copy.classLoader = classLoader; -copy.adaptToClass = adaptToClass; -return copy; -} - -/** * set the definition's name * @param name the name of the definition */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs AntlibInterface.java DefBase.java Antlib.java Definer.java
peterreilly2003/08/13 06:18:54 Modified:src/main/org/apache/tools/ant ComponentHelper.java ProjectHelper.java RuntimeConfigurable.java UnknownElement.java src/main/org/apache/tools/ant/helper AntXMLContext.java ProjectHelper2.java src/main/org/apache/tools/ant/taskdefs Antlib.java Definer.java Added: src/main/org/apache/tools/ant/taskdefs AntlibInterface.java DefBase.java Log: Add ns support Also split Definer.java in a base class (DefBase) to allow it to be used for other defining tasks Also add AntlibInterface to allow antlib to set uri and classloader for other tasks/types that Definer. Bugzilla: 19897 Revision ChangesPath 1.21 +106 -14 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- ComponentHelper.java 12 Aug 2003 15:15:06 - 1.20 +++ ComponentHelper.java 13 Aug 2003 13:18:54 - 1.21 @@ -58,14 +58,19 @@ import java.util.Enumeration; import java.util.Hashtable; +import java.util.HashSet; import java.util.Iterator; import java.util.Properties; +import java.util.Set; +import java.util.Stack; import java.util.Vector; import java.io.InputStream; import java.io.IOException; import java.lang.reflect.Modifier; +import org.apache.tools.ant.taskdefs.Typedef; + /** * Component creation and configuration. * @@ -98,6 +103,17 @@ /** flag to rebuild typeClassDefinitions */ private boolean rebuildTypeClassDefinitions = true; +/** Set of namespaces that have been checked for antlibs */ +private Set checkedNamespaces = new HashSet(); + +/** + * Stack of antlib contexts used to resolve definitions while + * processing antlib + */ +private Stack antLibStack = new Stack(); +/** current antlib context */ +private AntTypeTable antLibTypeTable = null; + /** * Map from task names to vectors of created tasks * (String to Vector of Task). This is used to invalidate tasks if @@ -175,32 +191,38 @@ AntTypeDefinition def = (AntTypeDefinition) i.next(); antTypeTable.put(def.getName(), def); } +// add the parsed namespaces of the parent project +checkedNamespaces.add(helper.checkedNamespaces); } /** Factory method to create the components. * * This should be called by UnknownElement. * - * @param ue The component helper has access via ue to the entire XML tree. - * @param ns Namespace. Also available as ue.getNamespace() - * @param taskName The element name. Also available as ue.getTag() + * @param ue The Unknown Element creating this component + * @param ns Namespace URI. Also available as ue.getNamespace() + * @param componentType The component type, + * Also available as ue.getComponentName() * @return the created component * @throws BuildException if an error occuries */ public Object createComponent(UnknownElement ue, String ns, - String taskName) + String componentType) throws BuildException { -Object component = createComponent(taskName); +Object component = createComponent(componentType); if (component == null) { return null; } if (component instanceof Task) { Task task = (Task) component; -task.setTaskType(taskName); -task.setTaskName(taskName); -addCreatedTask(taskName, task); +task.setLocation(ue.getLocation()); +task.setTaskType(componentType); +task.setTaskName(ue.getTaskName()); +task.setOwningTarget(ue.getOwningTarget()); +task.init(); +addCreatedTask(componentType, task); } return component; @@ -215,7 +237,11 @@ * @return the class if found or null if not. */ public Object createComponent(String componentName) { -return antTypeTable.create(componentName); +AntTypeDefinition def = getDefinition(componentName); +if (def == null) { +return null; +} +return def.create(project); } /** @@ -227,7 +253,11 @@ * @return the class if found or null if not. */ public Class getComponentClass(String
cvs commit: ant/docs/manual/CoreTasks typedef.html
peterreilly2003/08/13 06:22:58 Modified:docs/manual/CoreTasks typedef.html Log: add in attribute uri for typedef Revision ChangesPath 1.9 +9 -0 ant/docs/manual/CoreTasks/typedef.html Index: typedef.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/typedef.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- typedef.html 24 Jul 2003 13:48:45 - 1.8 +++ typedef.html 13 Aug 2003 13:22:58 - 1.9 @@ -134,6 +134,15 @@ No + +uri + + Experimental + The uri that this definition should live in. + (introduced in ant1.6 Experimental) + +No + Parameters specified as nested elements classpath - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs XmlnsTest.java
peterreilly2003/08/13 06:26:31 Added: src/etc/testcases/taskdefs xmlns.xml src/testcases/org/apache/tools/ant/taskdefs XmlnsTest.java Log: unit tests for namespace support PR: 19897 Submitted by: Peter Reilly Revision ChangesPath 1.1 ant/src/etc/testcases/taskdefs/xmlns.xml Index: xmlns.xml === 1.1 ant/src/testcases/org/apache/tools/ant/taskdefs/XmlnsTest.java Index: XmlnsTest.java === /* * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "Ant" and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; /** * @author Peter Reilly */ public class XmlnsTest extends BuildFileTest { public XmlnsTest(String name) { super(name); } public void setUp() { configureProject("src/etc/testcases/taskdefs/xmlns.xml"); } public void testXmlns() { expectLog("xmlns", "MyTask called"); } public void testXmlnsFile() { expectLog("xmlns.file", "MyTask called"); } public void testCore() { expectLog("core", "MyTask called"); } public void testExcluded() { expectBuildExceptionContaining( "excluded", "excluded uri", "Attempt to use use a reserved URI ant:notallowed"); } public static class MyTask extends Task { public void execute() { log("MyTask called"); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs XmlnsTest.java
peterreilly2003/08/13 06:36:36 Modified:src/main/org/apache/tools/ant/taskdefs DefBase.java src/testcases/org/apache/tools/ant/taskdefs XmlnsTest.java Log: typeo use use -> use Revision ChangesPath 1.2 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/DefBase.java Index: DefBase.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/DefBase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DefBase.java 13 Aug 2003 13:18:54 - 1.1 +++ DefBase.java 13 Aug 2003 13:36:36 - 1.2 @@ -94,7 +94,7 @@ uri = ""; } if (uri.startsWith("ant:") && !uri.startsWith("antlib:")) { -throw new BuildException("Attempt to use use a reserved URI " + uri); +throw new BuildException("Attempt to use a reserved URI " + uri); } this.uri = uri; } 1.2 +1 -1 ant/src/testcases/org/apache/tools/ant/taskdefs/XmlnsTest.java Index: XmlnsTest.java === RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/XmlnsTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XmlnsTest.java13 Aug 2003 13:26:31 - 1.1 +++ XmlnsTest.java13 Aug 2003 13:36:36 - 1.2 @@ -85,7 +85,7 @@ public void testExcluded() { expectBuildExceptionContaining( "excluded", "excluded uri", -"Attempt to use use a reserved URI ant:notallowed"); +"Attempt to use a reserved URI ant:notallowed"); } public static class MyTask extends Task { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/filters TokenFilter.java
peterreilly2003/08/13 06:44:26 Modified:src/main/org/apache/tools/ant UnknownElement.java src/main/org/apache/tools/ant/filters TokenFilter.java Log: Two of the files in 22326 PR: 22326 Obtained from: Martijn Kruithof Revision ChangesPath 1.61 +1 -1 ant/src/main/org/apache/tools/ant/UnknownElement.java Index: UnknownElement.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- UnknownElement.java 13 Aug 2003 13:18:54 - 1.60 +++ UnknownElement.java 13 Aug 2003 13:44:26 - 1.61 @@ -159,7 +159,7 @@ * @return the configuration info. */ public RuntimeConfigurable getWrapper() { -return wrapper; +return super.getWrapper(); } /** 1.11 +1 -1 ant/src/main/org/apache/tools/ant/filters/TokenFilter.java Index: TokenFilter.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/filters/TokenFilter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- TokenFilter.java 23 Jul 2003 11:32:12 - 1.10 +++ TokenFilter.java 13 Aug 2003 13:44:26 - 1.11 @@ -654,7 +654,7 @@ } regularExpression = new RegularExpression(); regularExpression.setPattern(from); -regexp = regularExpression.getRegexp(project); +regexp = regularExpression.getRegexp(getProject()); if (to == null) { to = ""; } - 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 CommandlineJava.java
peterreilly2003/08/13 07:06:20 Modified:src/main/org/apache/tools/ant ComponentHelper.java src/main/org/apache/tools/ant/helper ProjectHelper2.java src/main/org/apache/tools/ant/types AbstractFileSet.java CommandlineJava.java Log: remove some deprecated methods and 1.1 holdovers Bugzilla: 22326 Revision ChangesPath 1.22 +5 -5 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ComponentHelper.java 13 Aug 2003 13:18:54 - 1.21 +++ ComponentHelper.java 13 Aug 2003 14:06:19 - 1.22 @@ -54,8 +54,6 @@ package org.apache.tools.ant; -import org.apache.tools.ant.util.WeakishReference; - import java.util.Enumeration; import java.util.Hashtable; import java.util.HashSet; @@ -67,6 +65,7 @@ import java.util.Vector; import java.io.InputStream; import java.io.IOException; +import java.lang.ref.WeakReference; import java.lang.reflect.Modifier; import org.apache.tools.ant.taskdefs.Typedef; @@ -87,6 +86,7 @@ * * @author Costin Manolache * @author Peter Reilly + * @author mailto:[EMAIL PROTECTED]">Martijn Kruithof * @since Ant1.6 */ public class ComponentHelper { @@ -551,7 +551,7 @@ v = new Vector(); createdTasks.put(type, v); } -v.addElement(WeakishReference.createReference(task)); +v.addElement(new WeakReference(task)); } } @@ -568,8 +568,8 @@ if (v != null) { Enumeration taskEnum = v.elements(); while (taskEnum.hasMoreElements()) { -WeakishReference ref = -(WeakishReference) taskEnum.nextElement(); +WeakReference ref = +(WeakReference) taskEnum.nextElement(); Task t = (Task) ref.get(); //being a weak ref, it may be null by this point if (t != null) { 1.30 +3 -3 ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java Index: ProjectHelper2.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- ProjectHelper2.java 13 Aug 2003 13:18:54 - 1.29 +++ ProjectHelper2.java 13 Aug 2003 14:06:19 - 1.30 @@ -641,7 +641,7 @@ if (key.equals("default")) { if (value != null && !value.equals("")) { if (!context.isIgnoringProjectTag()) { -project.setDefaultTarget(value); +project.setDefault(value); } } } else if (key.equals("name")) { @@ -707,8 +707,8 @@ if ((new File(baseDir)).isAbsolute()) { project.setBasedir(baseDir); } else { -project.setBaseDir(project.resolveFile(baseDir, - context.getBuildFileParent())); +project.setBaseDir(fu.resolveFile( + context.getBuildFileParent(), baseDir)); } } } 1.24 +4 -4 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.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- AbstractFileSet.java 29 Jul 2003 08:43:49 - 1.23 +++ AbstractFileSet.java 13 Aug 2003 14:06:19 - 1.24 @@ -97,6 +97,7 @@ * @author Stefan Bodewig * @author Magesh Umasankar * @author mailto:[EMAIL PROTECTED]">Bruce Atherton + * @author mailto:[EMAIL PROTECTED]">Martijn Kruithof */ public abstract class AbstractFileSet extends DataType implements Cloneable, SelectorContainer { @@ -208,7 +209,7 @@ } /** - * add a name entry on the include files list + * add a name entry on the excludes files list */ public PatternSet.NameEntry createExcludesFile() { if (isReference()) { @@ -224,8
cvs commit: ant/src/main/org/apache/tools/ant/util CollectionUtils.java
peterreilly2003/08/13 07:22:29 Modified:src/main/org/apache/tools/ant/types XMLCatalog.java src/main/org/apache/tools/ant/util CollectionUtils.java Log: some 1.1 isms PR: 22326 Obtained from: Martijn Kruithof Revision ChangesPath 1.31 +1 -4 ant/src/main/org/apache/tools/ant/types/XMLCatalog.java Index: XMLCatalog.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/XMLCatalog.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- XMLCatalog.java 6 Aug 2003 14:35:03 - 1.30 +++ XMLCatalog.java 13 Aug 2003 14:22:29 - 1.31 @@ -58,7 +58,6 @@ import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -711,8 +710,6 @@ source.setSystemId(sysid); log("catalog entry matched a readable file: '" + sysid + "'", Project.MSG_DEBUG); -} catch (FileNotFoundException ex) { -// ignore } catch (IOException ex) { // ignore } 1.10 +9 -19 ant/src/main/org/apache/tools/ant/util/CollectionUtils.java Index: CollectionUtils.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/CollectionUtils.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- CollectionUtils.java 19 Jul 2003 08:11:08 - 1.9 +++ CollectionUtils.java 13 Aug 2003 14:22:29 - 1.10 @@ -63,15 +63,17 @@ * * @author Stefan Bodewig * @author mailto:[EMAIL PROTECTED]">Ingmar Stein + * @author mailto:[EMAIL PROTECTED]">Martijn Kruithof * * @since Ant 1.5 */ public class CollectionUtils { /** - * Vector.equals() doesn't do any good in 1.1 + * Please use Vector.equals() or List.equals() * * @since Ant 1.5 + * @deprecated */ public static boolean equals(Vector v1, Vector v2) { if (v1 == v2) { @@ -82,30 +84,17 @@ return false; } -if (v1.size() != v2.size()) { -return false; -} - -Enumeration e1 = v1.elements(); -Enumeration e2 = v2.elements(); -while (e1.hasMoreElements()) { -if (!e1.nextElement().equals(e2.nextElement())) { -return false; -} -} - -// don't need to check e2.hasMoreElements as the Vectors have -// same size. - -return true; +return v1.equals(v2); } /** - * Hashtable.equals() doesn't do any good in 1.1. + * Dictionary does not have an equals. + * Please use Map.equals() * * Follows the equals contract of Java 2's Map. * * @since Ant 1.5 + * @deprecated */ public static boolean equals(Dictionary d1, Dictionary d2) { if (d1 == d2) { @@ -137,9 +126,10 @@ } /** - * JDK 1.1 does not know the putAll method for hash tables. + * Dictionary does not know the putAll method. Please use Map.putAll(). * * @since Ant 1.6 + * @deprecated */ public static void putAll(Dictionary m1, Dictionary m2) { for (Enumeration it = m2.keys(); it.hasMoreElements();) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Ant.java AntStructure.java Concat.java Copydir.java Expand.java Jar.java Javadoc.java Replace.java UpToDate.java Zip.java
peterreilly2003/08/13 07:46:15 Modified:src/main/org/apache/tools/ant ComponentHelper.java RuntimeConfigurable.java Task.java src/main/org/apache/tools/ant/input DefaultInputHandler.java src/main/org/apache/tools/ant/taskdefs Ant.java AntStructure.java Concat.java Copydir.java Expand.java Jar.java Javadoc.java Replace.java UpToDate.java Zip.java Log: removing enum variable PR: 22345 Revision ChangesPath 1.23 +6 -6 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- ComponentHelper.java 13 Aug 2003 14:06:19 - 1.22 +++ ComponentHelper.java 13 Aug 2003 14:46:15 - 1.23 @@ -746,9 +746,9 @@ } props.load(in); -Enumeration enum = props.propertyNames(); -while (enum.hasMoreElements()) { -String name = (String) enum.nextElement(); +Enumeration e = props.propertyNames(); +while (e.hasMoreElements()) { +String name = (String) e.nextElement(); String className = props.getProperty(name); AntTypeDefinition def = new AntTypeDefinition(); def.setName(name); @@ -791,9 +791,9 @@ } props.load(in); -Enumeration enum = props.propertyNames(); -while (enum.hasMoreElements()) { -String name = (String) enum.nextElement(); +Enumeration e = props.propertyNames(); +while (e.hasMoreElements()) { +String name = (String) e.nextElement(); String className = props.getProperty(name); AntTypeDefinition def = new AntTypeDefinition(); def.setName(name); 1.44 +3 -3 ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java Index: RuntimeConfigurable.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/RuntimeConfigurable.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- RuntimeConfigurable.java 13 Aug 2003 13:18:54 - 1.43 +++ RuntimeConfigurable.java 13 Aug 2003 14:46:15 - 1.44 @@ -419,10 +419,10 @@ ProjectHelper.addText(p, wrappedObject, characters.substring(0)); } -Enumeration enum = getChildren(); -while (enum.hasMoreElements()) { +Enumeration e = getChildren(); +while (e.hasMoreElements()) { RuntimeConfigurable child -= (RuntimeConfigurable) enum.nextElement(); += (RuntimeConfigurable) e.nextElement(); if (child.wrappedObject instanceof Task) { Task childTask = (Task) child.wrappedObject; childTask.setRuntimeConfigurableWrapper(child); 1.48 +3 -3 ant/src/main/org/apache/tools/ant/Task.java Index: Task.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Task.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- Task.java 1 Aug 2003 10:22:30 - 1.47 +++ Task.java 13 Aug 2003 14:46:15 - 1.48 @@ -474,10 +474,10 @@ */ private void replaceChildren(RuntimeConfigurable wrapper, UnknownElement parentElement) { -Enumeration enum = wrapper.getChildren(); -while (enum.hasMoreElements()) { +Enumeration e = wrapper.getChildren(); +while (e.hasMoreElements()) { RuntimeConfigurable childWrapper = -(RuntimeConfigurable) enum.nextElement(); +(RuntimeConfigurable) e.nextElement(); UnknownElement childElement = new UnknownElement(childWrapper.getElementTag()); parentElement.addChild(childElement); 1.12 +4 -4 ant/src/main/org/apache/tools/ant/input/DefaultInputHandler.java Index: DefaultInputHandler.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/input/DefaultInputHandler.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- DefaultInputHandler.java 25 Jul 2003 18:44:39 - 1.11 +++ DefaultInputHandler.java 13 Aug 2003 14:46:15 - 1.12 @@ -124,14 +124,14 @@ if (request
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode ClassPathLoader.java
peterreilly2003/08/13 08:02:29 Modified:src/main/org/apache/tools/ant/taskdefs/condition And.java Or.java src/main/org/apache/tools/ant/taskdefs/cvslib ChangeLogParser.java src/main/org/apache/tools/ant/taskdefs/optional EchoProperties.java Javah.java NetRexxC.java Rpm.java src/main/org/apache/tools/ant/taskdefs/optional/j2ee ServerDeploy.java src/main/org/apache/tools/ant/taskdefs/optional/jsp JspC.java src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers DefaultJspCompilerAdapter.java src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java JUnitTestRunner.java XMLResultAggregator.java src/main/org/apache/tools/ant/taskdefs/optional/sitraka XMLReport.java src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode ClassPathLoader.java Log: removing enum variabe PR: 22345 Revision ChangesPath 1.9 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/condition/And.java Index: And.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/And.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- And.java 25 Jul 2003 08:28:21 - 1.8 +++ And.java 13 Aug 2003 15:02:28 - 1.9 @@ -74,9 +74,9 @@ * @exception BuildException if an error occurs */ public boolean eval() throws BuildException { -Enumeration enum = getConditions(); -while (enum.hasMoreElements()) { -Condition c = (Condition) enum.nextElement(); +Enumeration e = getConditions(); +while (e.hasMoreElements()) { +Condition c = (Condition) e.nextElement(); if (!c.eval()) { return false; } 1.9 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/condition/Or.java Index: Or.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/Or.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Or.java 25 Jul 2003 08:28:21 - 1.8 +++ Or.java 13 Aug 2003 15:02:28 - 1.9 @@ -74,9 +74,9 @@ * @exception BuildException if an error occurs */ public boolean eval() throws BuildException { -Enumeration enum = getConditions(); -while (enum.hasMoreElements()) { -Condition c = (Condition) enum.nextElement(); +Enumeration e = getConditions(); +while (e.hasMoreElements()) { +Condition c = (Condition) e.nextElement(); if (c.eval()) { return true; } 1.20 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java Index: ChangeLogParser.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ChangeLogParser.java 17 Jul 2003 15:44:39 - 1.19 +++ ChangeLogParser.java 13 Aug 2003 15:02:28 - 1.20 @@ -103,10 +103,10 @@ */ CVSEntry[] getEntrySetAsArray() { final CVSEntry[] array = new CVSEntry[ m_entries.size() ]; -Enumeration enum = m_entries.elements(); +Enumeration e = m_entries.elements(); int i = 0; -while (enum.hasMoreElements()) { -array[i++] = (CVSEntry) enum.nextElement(); +while (e.hasMoreElements()) { +array[i++] = (CVSEntry) e.nextElement(); } return array; } 1.21 +7 -7 ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java Index: EchoProperties.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- EchoProperties.java 18 Jul 2003 12:45:57 - 1.20 +++ EchoProperties.java 13 Aug 2003 15:02:28 - 1.21 @@ -302,9 +302,9 @@ } } -Enumeration enum = propertySets.elements(); -while (enum.hasMoreElements()) { -PropertySet ps = (PropertySet) enum.nextElement(); +Enumeration e = propertySets.elements
cvs commit: ant/src/main/org/apache/tools/zip ZipFile.java
peterreilly2003/08/13 08:14:31 Modified:src/main/org/apache/tools/ant/types AbstractFileSet.java CommandlineJava.java FilterSet.java Path.java PropertySet.java XMLCatalog.java ZipScanner.java src/main/org/apache/tools/ant/util Watchdog.java src/main/org/apache/tools/ant/util/facade FacadeTaskHelper.java src/main/org/apache/tools/zip ZipFile.java Log: remove enum variable PR: 22336 Obtained from: Robert Stupp, using Jan Matèrne's checkstyle check Revision ChangesPath 1.25 +3 -3 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.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- AbstractFileSet.java 13 Aug 2003 14:06:19 - 1.24 +++ AbstractFileSet.java 13 Aug 2003 15:14:31 - 1.25 @@ -466,9 +466,9 @@ return true; } -Enumeration enum = additionalPatterns.elements(); -while (enum.hasMoreElements()) { -PatternSet ps = (PatternSet) enum.nextElement(); +Enumeration e = additionalPatterns.elements(); +while (e.hasMoreElements()) { +PatternSet ps = (PatternSet) e.nextElement(); if (ps.hasPatterns(getProject())) { return true; } 1.46 +2 -2 ant/src/main/org/apache/tools/ant/types/CommandlineJava.java Index: CommandlineJava.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/CommandlineJava.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- CommandlineJava.java 13 Aug 2003 14:06:20 - 1.45 +++ CommandlineJava.java 13 Aug 2003 15:14:31 - 1.46 @@ -141,8 +141,8 @@ } } Properties propertySets = mergePropertySets(); -for (Enumeration enum = propertySets.keys(); enum.hasMoreElements();) { -String key = (String) enum.nextElement(); +for (Enumeration e = propertySets.keys(); e.hasMoreElements();) { +String key = (String) e.nextElement(); String value = propertySets.getProperty(key); listIt.add("-D" + key + "=" + value); } 1.23 +4 -4 ant/src/main/org/apache/tools/ant/types/FilterSet.java Index: FilterSet.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/FilterSet.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- FilterSet.java17 Jul 2003 14:17:01 - 1.22 +++ FilterSet.java13 Aug 2003 15:14:31 - 1.23 @@ -324,14 +324,14 @@ in = new FileInputStream(filtersFile); props.load(in); - Enumeration enum = props.propertyNames(); + Enumeration e = props.propertyNames(); Vector filters = getFilters(); - while (enum.hasMoreElements()) { - String strPropName = (String) enum.nextElement(); + while (e.hasMoreElements()) { + String strPropName = (String) e.nextElement(); String strValue = props.getProperty(strPropName); filters.addElement(new Filter(strPropName, strValue)); } - } catch (Exception e) { + } catch (Exception ex) { throw new BuildException("Could not read filters from file: " + filtersFile); } finally { 1.56 +3 -3 ant/src/main/org/apache/tools/ant/types/Path.java Index: Path.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Path.java,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- Path.java 3 Aug 2003 11:27:27 - 1.55 +++ Path.java 13 Aug 2003 15:14:31 - 1.56 @@ -490,9 +490,9 @@ return; } -Enumeration enum = elements.elements(); -while (enum.hasMoreElements()) { -Object o = enum.nextElement(); +Enumeration e = elements.elements(); +while (e.hasMoreElements()) { +Object o = e.nextElement(); if (o instanceof Reference) { o = ((Reference) o).getReferencedObject(p); } 1.8 +6 -6 ant/src/main/org/apac
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTest.java
peterreilly2003/08/13 08:19:34 Modified:src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTest.java Log: enum change Revision ChangesPath 1.18 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java Index: JUnitTest.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JUnitTest.java19 Jul 2003 11:20:19 - 1.17 +++ JUnitTest.java13 Aug 2003 15:19:34 - 1.18 @@ -169,8 +169,8 @@ public void setProperties(Hashtable p) { props = new Properties(); -for (Enumeration enum = p.keys(); enum.hasMoreElements();) { -Object key = enum.nextElement(); +for (Enumeration e = p.keys(); e.hasMoreElements();) { +Object key = e.nextElement(); props.put(key, p.get(key)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs DefBase.java
peterreilly2003/08/14 02:45:39 Modified:src/main/org/apache/tools/ant/taskdefs DefBase.java Log: fix head as DefBase.java is a new file Revision ChangesPath 1.3 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/DefBase.java Index: DefBase.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/DefBase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefBase.java 13 Aug 2003 13:36:36 - 1.2 +++ DefBase.java 14 Aug 2003 09:45:39 - 1.3 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2003 The Apache Software Foundation. All rights + * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs MacroDef.java MacroInstance.java PreSetDef.java defaults.properties
peterreilly2003/08/14 05:46:02 Modified:src/main/org/apache/tools/ant/taskdefs defaults.properties Added: src/main/org/apache/tools/ant/taskdefs MacroDef.java MacroInstance.java PreSetDef.java Log: Adding tasks presetdef and macrodef Revision ChangesPath 1.152 +2 -0 ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties Index: defaults.properties === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties,v retrieving revision 1.151 retrieving revision 1.152 diff -u -r1.151 -r1.152 --- defaults.properties 23 Jul 2003 14:12:12 - 1.151 +++ defaults.properties 14 Aug 2003 12:46:01 - 1.152 @@ -76,6 +76,8 @@ subant=org.apache.tools.ant.taskdefs.SubAnt sync=org.apache.tools.ant.taskdefs.Sync defaultexcludes=org.apache.tools.ant.taskdefs.DefaultExcludes +presetdef=org.apache.tools.ant.taskdefs.PreSetDef +macrodef=org.apache.tools.ant.taskdefs.MacroDef # optional tasks image=org.apache.tools.ant.taskdefs.optional.image.Image 1.1 ant/src/main/org/apache/tools/ant/taskdefs/MacroDef.java Index: MacroDef.java === /* * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "Ant" and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package org.apache.tools.ant.taskdefs; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.HashMap; import org.apache.tools.ant.AntTypeDefinition; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.ComponentHelper; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.Task; import org.apache.tools.ant.TaskContainer; import org.apache.tools.ant.UnknownElement; /** * Describe class MacroDef here. * * @author Peter Reilly */ public class MacroDef extends Task implements AntlibInterface, TaskContainer { private UnknownElement nestedTask; private String name; private String componentName; private List params = new ArrayList(); private Mapelements = new HashMap(); private String uri;
cvs commit: ant/docs/manual/CoreTasks presetdef.html macrodef.html
peterreilly2003/08/14 05:48:10 Modified:docs/manual coretasklist.html Added: docs/manual/CoreTasks presetdef.html macrodef.html Log: adding doc for presetdef and macrodef Revision ChangesPath 1.50 +2 -0 ant/docs/manual/coretasklist.html Index: coretasklist.html === RCS file: /home/cvs/ant/docs/manual/coretasklist.html,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- coretasklist.html 9 Jul 2003 16:24:35 - 1.49 +++ coretasklist.html 14 Aug 2003 12:48:10 - 1.50 @@ -60,12 +60,14 @@ LoadFile LoadProperties Mail +MacroDef Manifest Mkdir Move Parallel Patch PathConvert +PreSetDef Property Record Rename 1.1 ant/docs/manual/CoreTasks/presetdef.html Index: presetdef.html === PreSetDef Task PreSetDef Description The preset definition generates a new definition based on a current definition with some attributes or elements preset. Introduced in ant1.6 Experimental. Parameters Attribute Description Required name the name of the new definition Yes uri The uri that this definition should live in. No Parameters specified as nested elements another type with attributes or elements set The <presetdef> task takes one nested element as a parameter. This nested element can be any other type or task. The attributes and elements that need to be preset are placed here. Examples The following fragment defines a javac task with the debug and deprecation attributes set. It also has a src element to source files from a generated directory. <presetdef name="my.javac"> <javac debug="${debug}" deprecation="${deprecation}"> <src path="${gen.dir}"/> </javac> </presetdef> This can be used as a normal javac task - example: <my.javac src="${src.dir}" destdir="${classes.dir}"/> Copyright © 2003 Apache Software Foundation. All rights Reserved. 1.1 ant/docs/manual/CoreTasks/macrodef.html Index: macrodef.html === MacroDef Task MacroDef Description This defines a new task using a <sequential> or <parallel> nested task as a template. Nested elements <param> and <element> are used to specify attributes and elements of the new task. These get substituted into the <sequential> or <parallel> task when the new task is run. Introduced in ant1.6 Experimental. Parameters Attribute Description Required name the name of the new definition Yes uri The uri that this definition should live in. No Parameters specified as nested elements param This is used to specify attributes of the new task. The values of the attributes get substituted into the templated task. The attributes will be required attributes unless a default value has been set. This attribute is placed in the body of the templated task using the ant property notation - ${attribute name}. Note that is not an actual ant property. Parameters Attribute Description Required name the name of the new attribute Yes default the default value of the attribute. No element This is used to specify nested elements of the new task. The contents of the nested elements of the task instance are placed in the templated task at the tag name. Parameters Attribute Description Required name the name of the new attribute Yes optional if true this nested e
cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs PreSetDefTest.java MacroDefTest.java
peterreilly2003/08/14 06:17:26 Added: src/etc/testcases/taskdefs presetdef.xml macrodef.xml src/testcases/org/apache/tools/ant/taskdefs PreSetDefTest.java MacroDefTest.java Log: some unittests for presetdef and macrodef Revision ChangesPath 1.1 ant/src/etc/testcases/taskdefs/presetdef.xml Index: presetdef.xml === Inner Text 1.1 ant/src/etc/testcases/taskdefs/macrodef.xml Index: macrodef.xml === ${text} A nested element 1.1 ant/src/testcases/org/apache/tools/ant/taskdefs/PreSetDefTest.java Index: PreSetDefTest.java === /* * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "Ant" and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; /** * @author Peter Reilly */ public class PreSetDefTest extends BuildFileTest { public PreSetDefTest(String name) { super(name); } public void setUp() { configureProject("src/etc/testcases/taskdefs/presetdef.xml"); } public void testSimple() { expectLog("simple", "Hello world"); } public void testText() { expectLog("text", "Inner Text"); } public void testUri() { expectLog("uri", "Hello world"); } } 1.1 ant/src/testcases/org/apache/tools/ant/taskdefs/MacroDefTest.java Index: MacroDefTest.java ===
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs PreSetDef.java MacroDef.java MacroInstance.java
peterreilly2003/08/14 06:22:25 Modified:src/main/org/apache/tools/ant/taskdefs PreSetDef.java MacroDef.java MacroInstance.java Log: Add in Ant 1.6 javadocs for presetdef and macrodef Revision ChangesPath 1.2 +1 -0 ant/src/main/org/apache/tools/ant/taskdefs/PreSetDef.java Index: PreSetDef.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PreSetDef.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PreSetDef.java14 Aug 2003 12:46:01 - 1.1 +++ PreSetDef.java14 Aug 2003 13:22:24 - 1.2 @@ -75,6 +75,7 @@ * * * @author Peter Reilly + * @since Ant 1.6 */ public class PreSetDef extends Task implements AntlibInterface, TaskContainer { private UnknownElement nestedTask; 1.2 +1 -0 ant/src/main/org/apache/tools/ant/taskdefs/MacroDef.java Index: MacroDef.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroDef.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MacroDef.java 14 Aug 2003 12:46:01 - 1.1 +++ MacroDef.java 14 Aug 2003 13:22:24 - 1.2 @@ -72,6 +72,7 @@ * Describe class MacroDef here. * * @author Peter Reilly + * @since Ant 1.6 */ public class MacroDef extends Task implements AntlibInterface, TaskContainer { private UnknownElement nestedTask; 1.2 +1 -0 ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java Index: MacroInstance.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MacroInstance.java14 Aug 2003 12:46:01 - 1.1 +++ MacroInstance.java14 Aug 2003 13:22:24 - 1.2 @@ -77,6 +77,7 @@ * and makes a copy of the unknown element, substituting * the the parameter values in attributes and text. * @author Peter Reilly + * @since Ant 1.6 */ public class MacroInstance extends Task implements DynamicConfigurator { private MacroDef template; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks conditions.html
peterreilly2003/08/14 07:06:54 Modified:docs/manual/CoreTasks conditions.html Log: add link to custom condition Revision ChangesPath 1.20 +10 -0 ant/docs/manual/CoreTasks/conditions.html Index: conditions.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/conditions.html,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- conditions.html 10 Jul 2003 11:52:50 - 1.19 +++ conditions.html 14 Aug 2003 14:06:54 - 1.20 @@ -8,6 +8,16 @@ Conditions + Conditions are nested elements of the +<condition> and +<waitfor> tasks. +There are core conditions and custom conditions. Custom +conditions are described in + + Custom Conditions. +Core Conditions are described below. + + Core Conditions These are the nested elements that can be used as conditions in the <condition> and - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant ComponentHelper.java AntTypeDefinition.java
peterreilly2003/08/15 01:40:37 Modified:src/main/org/apache/tools/ant ComponentHelper.java AntTypeDefinition.java Log: move same definition to AntTypeDefinition Revision ChangesPath 1.24 +1 -9 ant/src/main/org/apache/tools/ant/ComponentHelper.java Index: ComponentHelper.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- ComponentHelper.java 13 Aug 2003 14:46:15 - 1.23 +++ ComponentHelper.java 15 Aug 2003 08:40:37 - 1.24 @@ -651,15 +651,7 @@ if (!validDefinition(def) || !validDefinition(old)) { return validDefinition(def) == validDefinition(old); } - -if (!(old.getTypeClass(project).equals(def.getTypeClass(project { -return false; -} -if (!(old.getExposedClass(project).equals( - def.getExposedClass(project { -return false; -} -return true; +return def.sameDefinition(old, project); } 1.5 +22 -2 ant/src/main/org/apache/tools/ant/AntTypeDefinition.java Index: AntTypeDefinition.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/AntTypeDefinition.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AntTypeDefinition.java13 Aug 2003 12:45:41 - 1.4 +++ AntTypeDefinition.java15 Aug 2003 08:40:37 - 1.5 @@ -54,6 +54,7 @@ package org.apache.tools.ant; + /** * This class contains all the information * on a particular ant type, @@ -217,7 +218,7 @@ * @return the created object */ public Object create(Project project) { -return icreate(project); +return icreate(project); } /** @@ -326,5 +327,24 @@ "Could not create type " + name + " due to " + t, t); } } -} +/** + * Equality method for this definition + * + * @param other another definition + * @param project the project the definition + * @return true if the definitions are the same + */ +public boolean sameDefinition(AntTypeDefinition other, Project project) { +if (other == null) { +return false; +} +if (other.getClass() != this.getClass()) { +return false; +} +if (!(other.getTypeClass(project).equals(getTypeClass(project { +return false; +} +return other.getExposedClass(project).equals(getExposedClass(project)); +} +} - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs PreSetDef.java
peterreilly2003/08/15 01:42:52 Modified:src/main/org/apache/tools/ant/taskdefs PreSetDef.java Log: implement sameDefinition for preset definition Revision ChangesPath 1.3 +12 -1 ant/src/main/org/apache/tools/ant/taskdefs/PreSetDef.java Index: PreSetDef.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PreSetDef.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PreSetDef.java14 Aug 2003 13:22:24 - 1.2 +++ PreSetDef.java15 Aug 2003 08:42:52 - 1.3 @@ -150,7 +150,6 @@ nestedTask.getNamespace(), nestedTask.getTag()); AntTypeDefinition def = helper.getDefinition(componentName); - if (def == null) { throw new BuildException( "Unable to find typedef " + componentName); @@ -263,6 +262,18 @@ } element.configure(o); return o; +} + +/** + * Equality method for this definition + * This only checks for pointer equality. + * + * @param other another definition + * @param project the current project + * @return true if the definitions are the same + */ +public boolean sameDefinition(AntTypeDefinition other, Project project) { +return this == other; } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/script ScriptDef.java
peterreilly2003/08/15 01:51:10 Modified:src/main/org/apache/tools/ant/taskdefs/optional/script ScriptDef.java Log: make scriptdef an antlibbable definition derive from DefBase and use the uri for the name this change also provides the classloader attributes and elements from DefBase to ScriptDef use the DefBase classloader Revision ChangesPath 1.6 +14 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java Index: ScriptDef.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ScriptDef.java20 Jul 2003 09:34:21 - 1.5 +++ ScriptDef.java15 Aug 2003 08:51:10 - 1.6 @@ -53,10 +53,13 @@ */ package org.apache.tools.ant.taskdefs.optional.script; +import org.apache.tools.ant.AntTypeDefinition; +import org.apache.tools.ant.ComponentHelper; import org.apache.tools.ant.Project; import org.apache.tools.ant.MagicNames; -import org.apache.tools.ant.Task; import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.taskdefs.DefBase; import java.util.Map; import java.util.HashMap; @@ -75,7 +78,7 @@ * @author Conor MacNeill * @since Ant 1.6 */ -public class ScriptDef extends Task { +public class ScriptDef extends DefBase { /** Used to run the script */ private ScriptRunner runner = new ScriptRunner(); @@ -268,8 +271,13 @@ } } +name = ProjectHelper.genComponentName(getUri(), name); scriptRepository.put(name, this); -project.addTaskDefinition(name, ScriptDefBase.class); +AntTypeDefinition def = new AntTypeDefinition(); +def.setName(name); +def.setClass(ScriptDefBase.class); +ComponentHelper.getComponentHelper( +getProject()).addDataTypeDefinition(def); } /** @@ -294,9 +302,12 @@ instance = getProject().createDataType(definition.type); } } else { +/* // try the context classloader ClassLoader loader = Thread.currentThread().getContextClassLoader(); +*/ +ClassLoader loader = createLoader(); Class instanceClass = null; try { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/script ScriptDefBase.java
peterreilly2003/08/15 01:52:55 Modified:src/main/org/apache/tools/ant/taskdefs/optional/script ScriptDefBase.java Log: stylecheck Revision ChangesPath 1.5 +1 -0 ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDefBase.java Index: ScriptDefBase.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDefBase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ScriptDefBase.java20 Jul 2003 10:01:27 - 1.4 +++ ScriptDefBase.java15 Aug 2003 08:52:55 - 1.5 @@ -106,6 +106,7 @@ * Create a nested element * * @param name the nested element name + * @return the element to be configured */ public Object createDynamicElement(String name) { List nestedElementList = (List) nestedElementMap.get(name); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs PreSetDef.java
peterreilly2003/08/15 02:09:29 Modified:src/main/org/apache/tools/ant/taskdefs PreSetDef.java Log: make the fields private Revision ChangesPath 1.4 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/PreSetDef.java Index: PreSetDef.java === RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PreSetDef.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PreSetDef.java15 Aug 2003 08:42:52 - 1.3 +++ PreSetDef.java15 Aug 2003 09:09:29 - 1.4 @@ -163,8 +163,8 @@ } private static class MyAntTypeDefinition extends AntTypeDefinition { -AntTypeDefinition parent; -UnknownElementelement; +private AntTypeDefinition parent; +private UnknownElementelement; public MyAntTypeDefinition(AntTypeDefinition parent, UnknownElement el) { this.parent = parent; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]