git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273081 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -0,0 +1,71 @@ | |||
| This license came from: | |||
| http://www.w3.org/Consortium/Legal/copyright-software-19980720 | |||
| W3C® SOFTWARE NOTICE AND LICENSE | |||
| Copyright © 1994-2001 World | |||
| Wide Web Consortium, <a href="http://www.w3.org/">World | |||
| Wide Web Consortium</a>, (<a href= | |||
| "http://www.lcs.mit.edu/">Massachusetts Institute of | |||
| Technology</a>, <a href="http://www.inria.fr/">Institut National de | |||
| Recherche en Informatique et en Automatique</a>, <a href= | |||
| "http://www.keio.ac.jp/">Keio University</a>). All Rights Reserved. | |||
| http://www.w3.org/Consortium/Legal/ | |||
| This W3C work (including software, documents, or other related | |||
| items) is being provided by the copyright holders under the | |||
| following license. By obtaining, using and/or copying this work, | |||
| you (the licensee) agree that you have read, understood, and will | |||
| comply with the following terms and conditions: | |||
| Permission to use, copy, modify, and distribute this software | |||
| and its documentation, with or without modification, for any | |||
| purpose and without fee or royalty is hereby granted, provided that | |||
| you include the following on ALL copies of the software and | |||
| documentation or portions thereof, including modifications, that | |||
| you make: | |||
| The full text of this NOTICE in a location viewable to users of | |||
| the redistributed or derivative work. | |||
| Any pre-existing intellectual property disclaimers, notices, or | |||
| terms and conditions. If none exist, a short notice of the | |||
| following form (hypertext is preferred, text is permitted) should | |||
| be used within the body of any redistributed or derivative code: | |||
| "Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of | |||
| Technology, Institut National de | |||
| Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. | |||
| http://www.w3.org/Consortium/Legal/" | |||
| Notice of any changes or modifications to the W3C files, | |||
| including the date changes were made. (We recommend you provide | |||
| URIs to the location from which the code is derived.) | |||
| THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND | |||
| COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF | |||
| MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE | |||
| USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD | |||
| PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. | |||
| COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, | |||
| SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE | |||
| SOFTWARE OR DOCUMENTATION. | |||
| The name and trademarks of copyright holders may NOT be used in | |||
| advertising or publicity pertaining to the software without | |||
| specific, written prior permission. Title to copyright in this | |||
| software and any associated documentation will at all times remain | |||
| with copyright holders. | |||
| ____________________________________ | |||
| This formulation of W3C's notice and license became active on | |||
| August 14 1998 so as to improve compatibility with GPL. This | |||
| version ensures that W3C software licensing terms are no more | |||
| restrictive than GPL and consequently W3C software may be | |||
| distributed in GPL packages. See the older formulation for the | |||
| policy prior to this date. Please see our Copyright FAQ for common | |||
| questions about using materials from | |||
| our site, including specific terms and conditions for packages like | |||
| libwww, Amaya, and Jigsaw. | |||
| Other questions about this notice can be | |||
| directed to site-policy@w3.org. | |||
| webmaster | |||
| @@ -0,0 +1,20 @@ | |||
| This license came from: http://www.megginson.com/SAX/copying.html | |||
| However please note future versions of SAX may be covered | |||
| under http://saxproject.org/?selected=pd | |||
| This page is now out of date -- see the new SAX site at | |||
| http://www.saxproject.org/ for more up-to-date | |||
| releases and other information. Please change your bookmarks. | |||
| SAX2 is Free! | |||
| I hereby abandon any property rights to SAX 2.0 (the Simple API for | |||
| XML), and release all of the SAX 2.0 source code, compiled code, and | |||
| documentation contained in this distribution into the Public Domain. | |||
| SAX comes with NO WARRANTY or guarantee of fitness for any | |||
| purpose. | |||
| David Megginson, david@megginson.com | |||
| 2000-05-05 | |||
| @@ -54,7 +54,7 @@ | |||
| Documentation is available in HTML format, in the docs/ directory. | |||
| For information about building and installing Ant, see | |||
| docs/manual/index.html | |||
| docs/manual/index.html | |||
| Licensing | |||
| @@ -13,8 +13,297 @@ properties files and output them instead of Ant's properties. | |||
| * <input> has a new attribute that allows you to specify a default value. | |||
| Changes from Ant 1.4.1 to Ant 1.5 | |||
| ================================= | |||
| Changes from Ant 1.5beta3 to Ant 1.5 | |||
| ==================================== | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| * The filesetmanifest attribute added to <jar> after the 1.4.1 | |||
| release has been removed for now. This change may affect only | |||
| the 1.5Beta/1.6Alpha users. An attempt will be made to add this | |||
| feature back into Ant 1.6. | |||
| Fixed bugs: | |||
| ----------- | |||
| * <zip> and friends would always update existing archive if you set | |||
| the update attribute to true. | |||
| * To support backward compatibility with older versions, <pathconvert> | |||
| will once again set the property, even if the result is the empty | |||
| string, unless the new 'setonempty' attribute is set to false|no|off | |||
| (default is "true"). | |||
| * The manifest task would crash XmlLogger | |||
| Other changes: | |||
| -------------- | |||
| * added **/.svn and **/.svn/** to the default excludes | |||
| Changes from Ant 1.5beta2 to Ant 1.5beta3 | |||
| ========================================= | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| * Project.getBuildListeners now returns a clone of the listener | |||
| list. Changes to the returned list will not affect the listeners | |||
| currently attached to the Project. It also means that it is safe to | |||
| iterate over the returned list if listeners are added or removed | |||
| during the traversal. | |||
| * <pvcs> default filenameformat has been different from Ant 1.4.1. | |||
| Now it is different from 1.5beta1 and 1.5beta2. | |||
| * Some messages that are printed during startup will not be | |||
| written to the logfile specified via -logfile as they might destroy | |||
| the format of the file for special BuildLoggers (like XmlLogger). | |||
| * <pathconvert> won't set the property if the result is the empty string. | |||
| Fixed bugs: | |||
| ----------- | |||
| * <available> could fail to find files or directories that happen to | |||
| start with the name of the project's basedir but are not children of | |||
| the basedir. | |||
| * Nested <property>'s inside <ant> can now be overriden by subsequent | |||
| <ant> and <antcall> tasks. | |||
| * <xslt>'s outputtype attribute wouldn't do anything. | |||
| * <linecontains> filterreader could swallow lines. | |||
| * <sequential> used to configure the tasks (set their attributes) | |||
| before the first task has been executed. This means that properties | |||
| that have been set by nested task seemed to be unset for the other | |||
| tasks in the same <sequential> element. | |||
| * <javac>'s sourcepath setting has been ignored by some compiler | |||
| implementations. | |||
| * <javadoc>'s packagelist attribute didn't work. | |||
| * the plain mailer would always use port 25 in <mail>. | |||
| * Ant's default logger could swallow empty lines. | |||
| * ejbjar's iPlanet nested element now can process multiple descriptors. | |||
| * IPlanetEjbc was looking in the wrong place for four iiop files. | |||
| * <javac> would pass the -source switch to JDK 1.3's javac, even | |||
| though it doesn't support it. | |||
| Other changes: | |||
| -------------- | |||
| * <checksum> now uses a buffer (of configurable size). | |||
| * The "Trying to override task definition" warning has been degraded | |||
| to verbose level if the two task definitions only differ in the class | |||
| loader instance that has loaded the definition. | |||
| * Add a jvmargs to the ejbjar's weblogic element to allow additional | |||
| arguments to be provided to the VM runnign ejbc. Document the | |||
| jvmdebuglevel attribute which can be used to avoid warnings about | |||
| interface classess being found on the classpath. Document the new | |||
| <sysproperty> element which allows JVM properties to be defined. | |||
| Added an outputdir attribute to allow the destination to be a | |||
| directory into which the exploded jar is written. | |||
| * ejbjar now supports Borland Enterprise Server 5 and Jonas 2.5 | |||
| Changes from Ant 1.5beta1 to Ant 1.5beta2 | |||
| ========================================= | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| * Properties will now be expanded in mail message bodies. This means | |||
| that one $ sign will be stripped if your mail message contains the text | |||
| $$. | |||
| * org.apache.tools.ant.taskdefs.Expand no longer extends MatchingTask. | |||
| * Available#setFile now again uses a File argument as it did in 1.4, | |||
| this may break environments that have been adapted to the String | |||
| argument version present in 1.5beta1. | |||
| Fixed bugs: | |||
| ----------- | |||
| * When <move> attempts a rename, it deletes the destination file, if it | |||
| exists, before renaming the source file. However, <move> was not | |||
| checking if the destination file was actually a directory before | |||
| trying to delete it. | |||
| * Make CVS Tasks to work under Cygwin. | |||
| * Fix LineContains to handle huge files elegantly without causing | |||
| Stack Overflows. | |||
| * if you ask for the "classic" compiler on Java1.4, you get upgraded to | |||
| "modern" because there is no classic compiler any more. | |||
| * the <http> condition was viewing 404 'not found' exceptions as success. Now | |||
| it defaults to viewing any response >=400 as an error, and has an errorsBeginAt | |||
| attribute you can use if you want a higher or lower value. | |||
| * <get> throws a build exception on an http authorization error, unless you | |||
| have set ignoreerrors to true. | |||
| * <wsdltodotnet> was spelt in Wintel case: <WsdlToDotnet>. It is now lower | |||
| case, though the old spelling is retained for anyone who used it. | |||
| * Merging of Manifests in jar now works as documented. | |||
| * paths that have been separated by colons would be incorrectly parsed | |||
| on NetWare. | |||
| * runant.pl now supports NetWare. | |||
| * <tempfile> and <setproxy> tasks were in beta1, but not defined by | |||
| default; They now are. <tempfile> fills a property with the name of a | |||
| temporary file; <setproxy> lets you set the JVM's http, ftp and socks proxy | |||
| settings. | |||
| * <available classname="foo" ignoresystemclasses="true"> failed for | |||
| JDK 1.1 and 1.2, even if the class could be found on the | |||
| user-specified classpath. | |||
| * <property environment=... /> now works on z/OS. | |||
| * forked <javac> failed for the wrong reason on JDK 1.1 - Ant would | |||
| use a temporary file to hold the names of the files to compile under | |||
| some conditons, but 1.1 doesn't support this feature. Ant will no | |||
| longer try this, but you may run into problems with the length of the | |||
| command line now. | |||
| * the refid attribute for <property>s nested into <ant> or <param>s | |||
| nested into <antcall> didn't work. | |||
| * <replaceregexp> didn't work for nested <fileset>s. | |||
| * <javadoc> dropped sourcepath entries if no "interesting" .java | |||
| source files could be found below them. This has been backwards | |||
| incompatible and caused problems with custom doclets like xdoclet. | |||
| * Using the doclet, docletpath or docletpathref attributes of | |||
| <javadoc> may have caused NullPointerExceptions. | |||
| * nested <filesets> of <javadoc> would include too much. | |||
| * <dependset> will no longer choke on <targetfileset>s that point to | |||
| non-existing directories. | |||
| * <patch> didn't work at all. | |||
| * <replace> and <replaceregexp> now fail if the file they are working | |||
| on is locked. | |||
| * <javadoc> would pick up the wrong executable in the combination JDK | |||
| 1.2 and AIX. | |||
| Other changes: | |||
| -------------- | |||
| * z/OS now gets detected by the os condition. | |||
| * <fileset> and <dirset> now have an optional followsymlink attribute | |||
| that can prevent Ant from following symbolic links on some platforms. | |||
| * BeanShell is now supported in the <script> task. | |||
| * <ejbjar> under Weblogic attempts to use the ejbc20 compiler for 2.0 beans | |||
| based on the deployment descriptor's DTD reference. Under weblogic 7.00 Beta | |||
| this ejbc class has been deprecated. To avoid the deprecation warning use | |||
| ejbcclass="weblogic.ejbc". | |||
| * <ejbjar> will add a manifest to the generated jar based on the naming | |||
| convention in use. This overrides the manifest specified in the | |||
| <ejbjar> attribute | |||
| Changes from Ant 1.4.1 to 1.5beta1 | |||
| ================================== | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| * Important: Single $ signs are no longer silently stripped! | |||
| ======= | |||
| * Project.getBuildListeners now returns a clone of the listener | |||
| list. Changes to the returned list will not affect the listeners | |||
| currently attached to the Project. It also means that it is safe to | |||
| iterate over the returned list if listeners are added or removed | |||
| during the traversal. | |||
| * <pvcs> default filenameformat has been different from Ant 1.4.1. | |||
| Now it is different from 1.5beta1 and 1.5beta2. | |||
| * Some messages that are printed during startup will not be | |||
| written to the logfile specified via -logfile as they might destroy | |||
| the format of the file for special BuildLoggers (like XmlLogger). | |||
| Fixed bugs: | |||
| ----------- | |||
| * <available> could fail to find files or directories that happen to | |||
| start with the name of the project's basedir but are not children of | |||
| the basedir. | |||
| * Nested <property>'s inside <ant> can now be overriden by subsequent | |||
| <ant> and <antcall> tasks. | |||
| * <xslt>'s outputtype attribute wouldn't do anything. | |||
| * <linecontains> filterreader could swallow lines. | |||
| * <sequential> used to configure the tasks (set their attributes) | |||
| before the first task has been executed. This means that properties | |||
| that have been set by nested task seemed to be unset for the other | |||
| tasks in the same <sequential> element. | |||
| * <javac>'s sourcepath setting has been ignored by some compiler | |||
| implementations. | |||
| * <javadoc>'s packagelist attribute didn't work. | |||
| * the plain mailer would always use port 25 in <mail>. | |||
| * Ant's default logger could swallow empty lines. | |||
| * ejbjar's iPlanet nested element now can process multiple descriptors. | |||
| * IPlanetEjbc was looking in the wrong place for four iiop files. | |||
| * <javac> would pass the -source switch to JDK 1.3's javac, even | |||
| though it doesn't support it. | |||
| Other changes: | |||
| -------------- | |||
| * <checksum> now uses a buffer (of configurable size). | |||
| * The "Trying to override task definition" warning has been degraded | |||
| to verbose level if the two task definitions only differ in the class | |||
| loader instance that has loaded the definition. | |||
| * Add a jvmargs to the ejbjar's weblogic element to allow additional | |||
| arguments to be provided to the VM runnign ejbc. Document the | |||
| jvmdebuglevel attribute which can be used to avoid warnings about | |||
| interface classess being found on the classpath. Document the new | |||
| <sysproperty> element which allows JVM properties to be defined. | |||
| Added an outputdir attribute to allow the destination to be a | |||
| directory into which the exploded jar is written. | |||
| * ejbjar now supports Borland Enterprise Server 5 and Jonas 2.5 | |||
| Changes from Ant 1.5beta1 to Ant 1.5beta2 | |||
| ========================================= | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| @@ -129,8 +418,38 @@ Changes from Ant 1.4.1 to 1.5beta1 | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| <<<<<<< WHATSNEW | |||
| * Important: Single $ signs are no longer silently stripped! | |||
| ======= | |||
| * The filesetmanifest attribute added to <jar> after the 1.4.1 | |||
| release has been removed for now. This change may affect only | |||
| the 1.5Beta/1.6Alpha users. An attempt will be made to add this | |||
| feature back into Ant 1.6. | |||
| Fixed bugs: | |||
| ----------- | |||
| * <zip> and friends would always update existing archive if you set | |||
| the update attribute to true. | |||
| * To support backward compatibility with older versions, <pathconvert> | |||
| will once again set the property, even if the result is the empty | |||
| string, unless the new 'setonempty' attribute is set to false|no|off | |||
| (default is "true"). | |||
| * The manifest task would crash XmlLogger | |||
| Other changes: | |||
| -------------- | |||
| * added **/.svn and **/.svn/** to the default excludes | |||
| Changes from Ant 1.5beta2 to Ant 1.5beta3 | |||
| ========================================= | |||
| Changes that could break older environments: | |||
| -------------------------------------------- | |||
| * Project.getBuildListeners now returns a clone of the listener | |||
| list. Changes to the returned list will not affect the listeners | |||
| currently attached to the Project. It also means that it is safe to | |||
| @@ -144,6 +463,8 @@ Changes that could break older environments: | |||
| written to the logfile specified via -logfile as they might destroy | |||
| the format of the file for special BuildLoggers (like XmlLogger). | |||
| * <pathconvert> won't set the property if the result is the empty string. | |||
| Fixed bugs: | |||
| ----------- | |||
| @@ -431,7 +752,7 @@ Other changes: | |||
| * <ejbjar> now allows control over which additional classes and interfaces | |||
| are added to the generated EJB jars. A new attribute "dependency" can be | |||
| defines which classes are added. The addition of classes now uses | |||
| defined which controls what classes are added. The addition of classes now uses | |||
| the Jakarta-BCEL library rather than reflection, meaning bean classes are | |||
| no longer loaded into Ant's JVM. The default dependency analyzer is known as | |||
| the ancestor analyzer. It provides the same behaviour as the 1.4.1 version of | |||
| @@ -465,7 +786,8 @@ Other changes: | |||
| * New tasks <replaceregexp>, <checksum>, <translate>, <waitfor>, | |||
| <manifest>, <vsscp>, <vssadd>, <vsscreate>, <splash>, <basename>, <dirname>, | |||
| <concat>. | |||
| <concat>, <sourceoffsite>, <jarlib-available>, <jarlib-display>, | |||
| <jarlib-manifest>, <jarlib-resolve>. | |||
| * A new combined <mail> task, which replaces the old <mail> and | |||
| <mimemail> tasks, has been added. The <mimemail> task, and | |||
| @@ -27,6 +27,7 @@ | |||
| <property name="chmod.fail" value="true" /> | |||
| <property name="deprecation" value="false" /> | |||
| <property name="optimize" value="true" /> | |||
| <property name="javac.target" value="1.1" /> | |||
| <property name="junit.fork" value="false" /> | |||
| <property name="junit.filtertrace" value="off"/> | |||
| <property name="junit.summary" value="no"/> | |||
| @@ -135,6 +136,10 @@ | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.package}/ejb/IPlanet*.java" | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.package}/ejb/Borland*.java" | |||
| unless="jdk1.2+" /> | |||
| <exclude name="${optional.package}/j2ee/*.java" | |||
| unless="jdk1.2+" /> | |||
| <!-- uses the context classloader --> | |||
| <exclude name="${optional.package}/junit/JUnitClassLoaderTest.java" | |||
| unless="jdk1.2+" /> | |||
| @@ -307,6 +312,20 @@ | |||
| <exclude name="${ant.package}/types/XMLCatalogTest.java"/> | |||
| </patternset> | |||
| <!-- | |||
| =================================================================== | |||
| Set up a patternsets that matches the parts of our JUnit testsuite | |||
| that may be useful for task developers. | |||
| =================================================================== | |||
| --> | |||
| <patternset id="useful.tests"> | |||
| <include name="${ant.package}/BuildFileTest*" /> | |||
| <include name="${regexp.package}/RegexpMatcherTest*" /> | |||
| <include name="${regexp.package}/RegexpTest*" /> | |||
| <include name="${optional.package}/AbstractXSLTLiaisonTest*" /> | |||
| <include name="${ant.package}/types/AbstractFileSetTest*" /> | |||
| </patternset> | |||
| <!-- | |||
| =================================================================== | |||
| Set up a patternsets that matches the parts of our JUnit testsuite | |||
| @@ -559,6 +578,7 @@ | |||
| destdir="${build.classes}" | |||
| debug="${debug}" | |||
| deprecation="${deprecation}" | |||
| target="${javac.target}" | |||
| optimize="${optimize}" > | |||
| <classpath refid="classpath" /> | |||
| @@ -635,6 +655,8 @@ | |||
| <fileset dir="."> | |||
| <include name="LICENSE" /> | |||
| <include name="LICENSE.xerces" /> | |||
| <include name="LICENSE.dom" /> | |||
| <include name="LICENSE.sax" /> | |||
| </fileset> | |||
| <mapper type="glob" from="*" to="*.txt" /> | |||
| </copy> | |||
| @@ -656,7 +678,7 @@ | |||
| <metainf dir="${build.dir}" includes="LICENSE.txt"/> | |||
| <manifest> | |||
| <section name="${ant.package}"> | |||
| <section name="${ant.package}/"> | |||
| <attribute name="Extension-name" | |||
| value="org.apache.tools.ant" /> | |||
| <attribute name="Specification-Title" | |||
| @@ -696,7 +718,7 @@ | |||
| <metainf dir="${build.dir}" includes="LICENSE.txt"/> | |||
| <manifest> | |||
| <section name="${optional.package}"> | |||
| <section name="${optional.package}/"> | |||
| <attribute name="Extension-name" | |||
| value="org.apache.tools.ant.taskdefs.optional" /> | |||
| <attribute name="Specification-Title" | |||
| @@ -817,9 +839,12 @@ | |||
| <include name="README"/> | |||
| <include name="LICENSE"/> | |||
| <include name="LICENSE.xerces"/> | |||
| <include name="LICENSE.dom"/> | |||
| <include name="LICENSE.sax"/> | |||
| <include name="TODO"/> | |||
| <include name="WHATSNEW"/> | |||
| <include name="KEYS"/> | |||
| <include name="welcome.html"/> | |||
| </fileset> | |||
| </copy> | |||
| @@ -901,6 +926,8 @@ | |||
| <include name="README"/> | |||
| <include name="LICENSE"/> | |||
| <include name="LICENSE.xerces"/> | |||
| <include name="LICENSE.dom"/> | |||
| <include name="LICENSE.sax"/> | |||
| <include name="TODO"/> | |||
| <include name="WHATSNEW"/> | |||
| <include name="KEYS"/> | |||
| @@ -909,6 +936,7 @@ | |||
| <include name="bootstrap.bat"/> | |||
| <include name="bootstrap.sh"/> | |||
| <include name="build.xml"/> | |||
| <include name="welcome.html"/> | |||
| </fileset> | |||
| </copy> | |||
| @@ -1147,6 +1175,7 @@ | |||
| <javac srcdir="${tests.dir}" | |||
| destdir="${build.tests}" | |||
| debug="${debug}" | |||
| target="${javac.target}" | |||
| deprecation="${deprecation}" > | |||
| <classpath refid="tests-classpath" /> | |||
| @@ -35,13 +35,13 @@ development, maintenance and code size reasons. | |||
| Execute will spawn off separate programs under all the platforms which | |||
| ant supports, dealing with Java version issues as well as platform | |||
| issues. Always use this task to invoke other programs. | |||
| issues. Always use this task to invoke other programs. | |||
| <h4>Java, ExecuteJava</h4> | |||
| These classes can be used to spawn Java programs in a separate VM (they | |||
| use execute) or in the same VM -with or without a different classloader. | |||
| When deriving tasks from this, it often benefits users to permit the | |||
| use execute) or in the same VM -with or without a different classloader. | |||
| When deriving tasks from this, it often benefits users to permit the | |||
| classpath to be specified, and for forking to be an optional attribute. | |||
| @@ -84,17 +84,16 @@ editors and platforms. Some IDEs (JEdit) can highlight tabs, to stop you | |||
| accidentally inserting them | |||
| <h2>Attributes and elements</h2> | |||
| Use the Ant introspection based mapping of attributes into Java datatypes, | |||
| rather than implementing all your attributes as setFoo(String) and doing | |||
| the mapping to Int, bool or file yourself. This saves work on your part, | |||
| lets Java callers use you in a typesafe manner, and will let the Xdocs | |||
| documentation generator work out what the parameters are. | |||
| lets Java callers use you in a typesafe manner, and will let the Xdocs | |||
| documentation generator work out what the parameters are. | |||
| <p> | |||
| The ant1.x tasks are very inconsistent regarding naming of attributes | |||
| -some tasks use <tt>source<tt>, others <tt>src</tt>tt>. | |||
| Here is a list of preferred attribute names. | |||
| -some tasks use <tt>source</tt>, others <tt>src</tt>. | |||
| Here is a list of preferred attribute names. | |||
| <table> | |||
| <tr> | |||
| @@ -102,7 +101,7 @@ Here is a list of preferred attribute names. | |||
| failonerror | |||
| </td> | |||
| <td> | |||
| boolean to control whether failure to execute should throw a | |||
| boolean to control whether failure to execute should throw a | |||
| <tt>BuildException</tt> or just print an error. | |||
| Parameter validation failures should always throw an error, regardless | |||
| of this flag | |||
| @@ -156,32 +155,32 @@ to their ant system configuration. | |||
| Keep member variables private. If read access by subclasses is required. | |||
| add accessor methods rather than change the accessiblity of the member. | |||
| This enables subclasses to access the contents, yet | |||
| still be decoupled from the actual implementation. | |||
| still be decoupled from the actual implementation. | |||
| <p> | |||
| The other common re-use mechanism in ant is for one task to create and | |||
| configure another. This is fairly simple. | |||
| configure another. This is fairly simple. | |||
| <h2>Do your own Dependency Checking</h2> | |||
| Make has the edge over Ant in its integrated dependency checking: the | |||
| command line apps make invokes dont need to do their own work. Ant tasks | |||
| do have to do their own dependency work, but if this can be done then | |||
| do have to do their own dependency work, but if this can be done then | |||
| it can be done well. A good dependency aware task can work out the dependencies | |||
| without explicit dependency information in the build file, and be smart | |||
| without explicit dependency information in the build file, and be smart | |||
| enough to work out the real dependencies, perhaps through a bit of file parsing. | |||
| The <tt>depends</tt> task is the best example of this. Some of the zip/jar | |||
| tasks are pretty good too, as they can update the archive when needed. | |||
| Most tasks just compare source and destination timestamps and work from there. | |||
| Most tasks just compare source and destination timestamps and work from there. | |||
| Tasks which don't do any dependency checking do not help users as much as | |||
| they can, because their needless work can trickle through the entire build, test | |||
| and deploy process. | |||
| and deploy process. | |||
| <h2>Support Java 1.1 through Java 1.4</h2> | |||
| Ant is designed to support Java1.1: to build on it, to run on it. Sometimes | |||
| functionality of tasks have to degrade in that environment -<touch> | |||
| is a case in point- this is usually due to library limitations; | |||
| is a case in point- this is usually due to library limitations; | |||
| such behaviour change must always be noted in the documentation. | |||
| <p> | |||
| What is problematic is code which is dependent on Java1.2 features | |||
| @@ -189,20 +188,20 @@ What is problematic is code which is dependent on Java1.2 features | |||
| These can not be used directly by any code and still be able to compile | |||
| and run on a Java 1.1 system. So please stick to the older collection | |||
| classes, and the older IO classes. If a new method in an existing class | |||
| is to be used, it must be used via reflection and the | |||
| <tt>NoSuchMethodException</tt> handled somehow. | |||
| is to be used, it must be used via reflection and the | |||
| <tt>NoSuchMethodException</tt> handled somehow. | |||
| <p> | |||
| What if code simply does not work on Java1.1? It can happen. It will | |||
| probably be OK to have the task as an optional task, with compilation | |||
| restricted to Java1.2 or later through build.xml modifications. | |||
| What if code simply does not work on Java1.1? It can happen. It will | |||
| probably be OK to have the task as an optional task, with compilation | |||
| restricted to Java1.2 or later through build.xml modifications. | |||
| Better still, use reflection to link to the classes at run time. | |||
| <p> | |||
| Java 1.4 adds a new optional change to the language itself, the | |||
| Java 1.4 adds a new optional change to the language itself, the | |||
| <tt>assert</tt> keyword, which is only enabled if the compiler is told | |||
| to compile 1.4 version source. Clearly with the 1.1 compatibility requirement, | |||
| Ant tasks can not use this keyword. They also need to move away from | |||
| using the JUnit <tt>assert()</tt> method and call <tt>assertTrue()</tt> | |||
| instead. | |||
| instead. | |||
| @@ -233,7 +232,7 @@ your task -feel free to do so! | |||
| <p> | |||
| A well written set of test cases will break the Ant task while it is in | |||
| development, until the code is actually complete. And every bug which | |||
| development, until the code is actually complete. And every bug which | |||
| surfaces later should have a test case added to demonstrate the problem, | |||
| and to fix it. | |||
| @@ -253,7 +252,7 @@ and patches do what they say. If you've got test cases it increases your | |||
| credibility significantly. To be precise, we hate submissions without | |||
| test cases, as it means we have to write them ourselves. This is | |||
| something that only gets done if we need the task or it is perceived as | |||
| utterly essential to many users. | |||
| utterly essential to many users. | |||
| <p> | |||
| @@ -323,7 +322,7 @@ Tasks calling such code can use the 'exec' or 'java' tasks to run the | |||
| programs, as you are just executing them at this point, not linking to | |||
| them. | |||
| <p> | |||
| Even if we cannot include your task into the Apache codebase, we can | |||
| Even if we cannot include your task into the Apache codebase, we can | |||
| still point to where you host it -just submit a diff to | |||
| xdocs/external.html pointing to your task. | |||
| @@ -337,14 +336,14 @@ was already implemented in a small corner of another task, or it has | |||
| been submitted by someone else and not committed. You can avoid this | |||
| by being aware of what is in the latest CVS tree -keep getting the daily | |||
| source updates, look at manual changes and subscribe to the ant-dev | |||
| mailing list. | |||
| mailing list. | |||
| <p> | |||
| If you are thinking of writing a task, posting a note on your thoughts | |||
| to the list can be informative -you well get other peoples insight and | |||
| maybe some half written task to do the basics, all without writing a | |||
| line of code. | |||
| line of code. | |||
| <h2>Submitting to Ant</h2> | |||
| @@ -357,7 +356,7 @@ It helps to be on this list, as you will see other submissions, and | |||
| any debate about your own submission. | |||
| <p> | |||
| Patches to existing files should be generated with | |||
| Patches to existing files should be generated with | |||
| <code>cvs diff -u filename</code> | |||
| and save the output to a file. If you want to get | |||
| the changes made to multiple files in a directory , just use <code>cvs | |||
| @@ -376,22 +375,22 @@ made. | |||
| New submissions should be proceeded with [SUBMIT]. The mailer-daemon | |||
| will reject any messages over 100KB, so any large update should be | |||
| zipped up. If your submission is bigger than that, why not break it up | |||
| into separate tasks. | |||
| into separate tasks. | |||
| <p> | |||
| We also like submissions to be added to | |||
| We also like submissions to be added to | |||
| <a href="http://nagoya.apache.org/bugzilla/">bugzilla</a>, so that they | |||
| dont get lost. Please submit them by first filing the report with a | |||
| meaningful name, then adding files as attachments. Use CVS diff files | |||
| please! | |||
| <p> | |||
| If you hear nothing after a couple of weeks, remind the mailing list. | |||
| If you hear nothing after a couple of weeks, remind the mailing list. | |||
| Sometimes really good submissions get lost in the noise of other issues. | |||
| This is particularly the case just prior to a new point release of | |||
| This is particularly the case just prior to a new point release of | |||
| the product. At that time anything other than bug fixes will tend | |||
| to be neglected. | |||
| <h2>Checklists</h2> | |||
| These are the things you should verify before submitting patches and new | |||
| @@ -401,14 +400,14 @@ can be addressed in the process. But by the time the code is committed, | |||
| everything including the documentation and some test cases will have | |||
| been done, so by getting them out the way up front can save time. | |||
| The committers look more favourably on patches and submissions with test | |||
| cases, while documentation helps sell the reason for a task. | |||
| cases, while documentation helps sell the reason for a task. | |||
| <h3>Checklist before submitting a patch</h3> | |||
| <ul> | |||
| <li>Added code complies with style guidelines | |||
| <li>Code compiles and runs on Java1.1 | |||
| <li>New member variables are private, and provide public accessor methods | |||
| if access is actually needed. | |||
| if access is actually needed. | |||
| <li>Existing test cases succeed. | |||
| <li>New test cases written and succeed. | |||
| <li>Documentation page extended as appropriate. | |||
| @@ -417,7 +416,7 @@ cases, while documentation helps sell the reason for a task. | |||
| <li>Message to ant-dev contains [PATCH], task name and patch reason in | |||
| subject. | |||
| <li>Message body contains a rationale for the patch. | |||
| <li>Message attachment contains the patch file(s). | |||
| <li>Message attachment contains the patch file(s). | |||
| </ul> | |||
| <h3>Checklist before submitting a new task</h3> | |||
| @@ -427,7 +426,7 @@ subject. | |||
| <li>Source code complies with style guidelines | |||
| <li>Code compiles and runs on Java1.1 | |||
| <li>Member variables are private, and provide public accessor methods | |||
| if access is actually needed. | |||
| if access is actually needed. | |||
| <li><i>Maybe</i> Task has failonerror attribute to control failure behaviour | |||
| <li>New test cases written and succeed | |||
| <li>Documentation page written | |||
| @@ -51,7 +51,7 @@ | |||
| <td valign="top">append</td> | |||
| <td valign="top"> | |||
| Specifies whether or not the file specified by 'destfile' | |||
| should be overwritten. Defaults to "yes". | |||
| should be overwritten. Defaults to "no". | |||
| </td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| @@ -170,6 +170,13 @@ of 400 or greater are viewed as invalid.</p> | |||
| are detected</td> | |||
| <td align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">errorsBeginAt</td> | |||
| <td valign="top">The lowest HTTP response code that signals an error; | |||
| by default '400'; server errors, not-authorized, not-found and the like | |||
| are detected</td> | |||
| <td align="center">No</td> | |||
| </tr> | |||
| </table> | |||
| <h4>socket</h4> | |||
| @@ -263,8 +270,8 @@ that is "true","yes", or "on"</p> | |||
| <pre> | |||
| <istrue value="${someproperty}" /> | |||
| <istrue value="false" /> | |||
| </pre> | |||
| </pre> | |||
| <h4>isfalse</h4> | |||
| <p>Tests whether a string is not true, the negation of <istrue> | |||
| </p> | |||
| @@ -283,8 +290,8 @@ that is "true","yes", or "on"</p> | |||
| <pre> | |||
| <isfalse value="${someproperty}" /> | |||
| <isfalse value="false" /> | |||
| </pre> | |||
| </pre> | |||
| <hr> | |||
| <p align="center">Copyright © 2001-2002 Apache Software | |||
| Foundation. All rights Reserved.</p> | |||
| @@ -31,9 +31,7 @@ multiple ones to merge together different trees of files into one JAR. | |||
| The extended fileset and groupfileset attributes from the zip task are | |||
| also available in the jar task. | |||
| See the <a href="zip.html">Zip</a> task for more details and examples.</p> | |||
| <p>If the manifest is omitted, a simple one will be supplied by Ant. | |||
| If there is a manifest or manifests in your set of files, these manifests can | |||
| be used if <i>filesetmanifests</i> is set to <i>merge</i> or <i>mergewithoutmain</i>.</p> | |||
| <p>If the manifest is omitted, a simple one will be supplied by Ant.</p> | |||
| <p>The <code>update</code> parameter controls what happens if the | |||
| JAR file already exists. When set to <code>yes</code>, the JAR file is | |||
| updated with the files specified. When set to <code>no</code> (the | |||
| @@ -121,19 +119,6 @@ being wrapped and continued on the next line. | |||
| <td valign="top">the manifest file to use. This can be either the location of a manifest, or the name of a jar added through a fileset. If its the name of an added jar, the task expects the manifest to be in the jar at META-INF/MANIFEST.MF</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">filesetmanifest</td> | |||
| <td valign="top">behavior when a Manifest is found in a zipfileset or | |||
| zipgroupfileset file is found. Valid values are "skip", | |||
| "merge", and "mergewithoutmain". "merge" | |||
| will merge all of manifests together, and merge this into any other | |||
| specified manifests. "mergewithoutmain" merges everything | |||
| but the Main section of the manifests. Default value is "skip". | |||
| <b>Note:</b> if this attribute's value is not "skip", the | |||
| created jar will not be readable by using java.util.jar.JarInputStream | |||
| </td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">update</td> | |||
| <td valign="top">indicates whether to update or overwrite | |||
| @@ -72,6 +72,11 @@ drive letters to Unix paths, and vice-versa.</p> | |||
| <td valign="top" align="center">No; if omitted, a nested | |||
| <code><path></code> element must be supplied.</td> | |||
| </tr> | |||
| <td valign="top">setonempty</td> | |||
| <td valign="top">Should the property be set, even if the result | |||
| is the empty string? | |||
| <td valign="top" align="center">No; default is "true". | |||
| </tr> | |||
| </table> | |||
| <h3>Parameters specified as nested elements</h3> | |||
| <h4>map</h4> | |||
| @@ -23,13 +23,13 @@ finally with the <i>defaultexcludes</i> attribute, you can specify whether you | |||
| want to use default exclusions or not. See the section on <a | |||
| href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the | |||
| inclusion/exclusion of files works, and how to write patterns.</p> | |||
| <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and supports all | |||
| attributes of <code><fileset></code> (<code>dir</code> becomes <code>basedir</code>) | |||
| as well as the nested <code><include></code>, <code><exclude></code> | |||
| <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and supports all | |||
| attributes of <code><fileset></code> (<code>dir</code> becomes <code>basedir</code>) | |||
| as well as the nested <code><include></code>, <code><exclude></code> | |||
| and <code><patternset></code> elements.</p> | |||
| <p>This task supports the use of a nested <param> element which is used to pass values | |||
| <p>This task supports the use of a nested <param> element which is used to pass values | |||
| to an <xsl:param> declaration.</p> | |||
| <p>This task supports the use of a nested <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | |||
| <p>This task supports the use of a nested <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | |||
| element which is used to perform Entity and URI resolution</p> | |||
| <p><i><style> and <xslt> refer to the same Ant task and can be used interchangeably.</i></p> | |||
| <p>If you want to use Xalan-J 1 or XSL:P, you also need Ant's optional.jar</p> | |||
| @@ -54,7 +54,7 @@ element which is used to perform Entity and URI resolution</p> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">extension</td> | |||
| <td valign="top">desired file extension to be used for the targets. If not | |||
| <td valign="top">desired file extension to be used for the targets. If not | |||
| specified, the default is ".html".</td> | |||
| <td align="center" valign="top">No</td> | |||
| </tr> | |||
| @@ -68,7 +68,7 @@ element which is used to perform Entity and URI resolution</p> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">classpath</td> | |||
| <td valign="top">classpath</td> | |||
| <td valign="top">the classpath to use when looking up the XSLT | |||
| processor.</td> | |||
| <td align="center" valign="top">No</td> | |||
| @@ -89,39 +89,40 @@ element which is used to perform Entity and URI resolution</p> | |||
| <td valign="top">processor</td> | |||
| <td valign="top">name of the XSLT processor to use. Permissible values are | |||
| "trax" for a TraX compliant processor, | |||
| "trax" for a TraX compliant processor (ie JAXP interface | |||
| implementation such as Xalan 2 or Saxon), | |||
| "xslp" for the XSL:P processor, "xalan" for | |||
| the Apache XML Xalan (version 1) processor the name of an | |||
| arbitrary XSLTLiaison class. Defaults to trax, followed by xalan | |||
| and then xslp (in that order). The first one found in your class | |||
| path is the one that is used. | |||
| <em><strong>DEPRECATED</strong> - XSL:P is deprecated and will | |||
| be removed in the next version. Use trax or xalan instead.</em>. | |||
| <em><strong>DEPRECATED</strong> - XSL:P and xalan are deprecated and no | |||
| more supported.</em>. | |||
| </td> | |||
| <td align="center" valign="top">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">includes</td> | |||
| <td valign="top">comma- or space-separated list of patterns of files that must be included. | |||
| <td valign="top">comma- or space-separated list of patterns of files that must be included. | |||
| All files are included when omitted.</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">includesfile</td> | |||
| <td valign="top">the name of a file. Each line of this file is taken to be | |||
| <td valign="top">the name of a file. Each line of this file is taken to be | |||
| an include pattern</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">excludes</td> | |||
| <td valign="top">comma- or space-separated list of patterns of files that must be excluded. | |||
| <td valign="top">comma- or space-separated list of patterns of files that must be excluded. | |||
| No files (except default excludes) are excluded when omitted.</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">excludesfile</td> | |||
| <td valign="top">the name of a file. Each line of this file is taken to be | |||
| <td valign="top">the name of a file. Each line of this file is taken to be | |||
| an exclude pattern</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| @@ -133,23 +134,16 @@ element which is used to perform Entity and URI resolution</p> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">in</td> | |||
| <td valign="top">specifies a single XML document to be styled. Should be used | |||
| <td valign="top">specifies a single XML document to be styled. Should be used | |||
| with the out attribute.</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">out</td> | |||
| <td valign="top">specifies the output name for the styled result from the | |||
| <td valign="top">specifies the output name for the styled result from the | |||
| in attribute.</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">outputtype</td> | |||
| <td valign="top">specifies the output method to be used. Only "xml" is | |||
| guaranteed to be supported by all translators. Xalan2 supports "xml", | |||
| "html", and "text"</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">scanincludeddirectories</td> | |||
| <td valign="top">If any directories are matched by the | |||
| @@ -161,32 +155,58 @@ element which is used to perform Entity and URI resolution</p> | |||
| <h3>Parameters specified as nested elements</h3> | |||
| <h4>classpath</h4> | |||
| <p>The classpath to load the processor from can be specified via a | |||
| nested <code><classpath></code>, as well - that is, a | |||
| nested <code><classpath></code>, as well - that is, a | |||
| <a href="../using.html#path">path</a>-like structure.</p> | |||
| <h4>xmlcatalog</h4> | |||
| <p>The <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | |||
| <p>The <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | |||
| element is used to perform Entity and URI resolution.</p> | |||
| <h4>param</h4> | |||
| <p>Param is used to pass a parameter to the XSL stylesheet.</p> | |||
| <h4>Parameters</h4> | |||
| <table width="60%" border="1" cellpadding="2" cellspacing="0"> | |||
| <tr> | |||
| <tr> | |||
| <td valign="top"><b>Attribute</b></td> | |||
| <td valign="top"><b>Description</b></td> | |||
| <td align="center" valign="top"><b>Required</b></td> | |||
| </tr> | |||
| <tr> | |||
| <tr> | |||
| <td valign="top">name</td> | |||
| <td valign="top">Name of the XSL parameter</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <tr> | |||
| <td valign="top">expression</td> | |||
| <td valign="top">XSL expression to be placed into the param. To pass a text | |||
| <td valign="top">XSL expression to be placed into the param. To pass a text | |||
| value into the style sheet it needs to be escaped using single quotes.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| </table> | |||
| <h4>outputproperty ('trax' processors only)</h4> | |||
| <p>Used to specify how you wish the result tree to be output | |||
| as specified in the <a href="http://www.w3.org/TR/xslt#output"> | |||
| XSLT specifications</a>. | |||
| <h4>Parameters</h4> | |||
| <table width="60%" border="1" cellpadding="2" cellspacing="0"> | |||
| <tr> | |||
| <td valign="top"><b>Attribute</b></td> | |||
| <td valign="top"><b>Description</b></td> | |||
| <td align="center" valign="top"><b>Required</b></td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">name</td> | |||
| <td valign="top">Name of the property</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">value</td> | |||
| <td valign="top">value of the property.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote> | |||
| <pre> | |||
| @@ -201,7 +221,7 @@ element is used to perform Entity and URI resolution.</p> | |||
| <xslt basedir="doc" destdir="build/doc" | |||
| extension=".html" style="style/apache.xsl"> | |||
| <xmlcatalog> | |||
| <dtd | |||
| <dtd | |||
| publicId="-//ArielPartners//DTD XML Article V1.0//EN" | |||
| location="com/arielpartners/knowledgebase/dtd/article.dtd"/> | |||
| </xmlcatalog> | |||
| @@ -216,6 +236,17 @@ element is used to perform Entity and URI resolution.</p> | |||
| element <xsl:param name="date"/>, the variable | |||
| <code>$date</code> will subsequently have the value 07-01-2000. | |||
| </p> | |||
| <h4>Using output properties</h4> | |||
| <pre><xslt in="doc.xml" out="build/doc/output.xml" | |||
| style="style/apache.xsl"> | |||
| <outputproperty name="method" value="xml";/> | |||
| <outputproperty name="standalone" value="yes"/> | |||
| <outputproperty name="encoding" value="iso8859_1"/> | |||
| <outputproperty name="indent" value="yes"/> | |||
| </xslt></pre> | |||
| </blockquote> | |||
| <hr> | |||
| <p align="center">Copyright © 2000-2002 Apache Software Foundation. All rights | |||
| @@ -57,8 +57,8 @@ support VAJ has not (out of the box).</P> | |||
| To Tool API'. Therefore builds containing VAJ tasks can also be executed | |||
| from the command line (Kudos to Glenn McAllister for describing the | |||
| concept and providing source code at | |||
| <A href="http://www7.software.ibm.com/vad.nsf/Data/Document4366"> | |||
| http://www7.software.ibm.com/vad.nsf/Data/Document4366</A>. | |||
| <A href="http://www7.software.ibm.com/vad.nsf/Data/Document4366"> | |||
| http://www7.software.ibm.com/vad.nsf/Data/Document4366</A>. | |||
| <LI>It is possible to cancel a running build | |||
| executed from the plugin | |||
| @@ -125,14 +125,7 @@ workspace.</P> | |||
| <td valign="top">version</TD> | |||
| <td valign="top">name of the requested version</TD> | |||
| <td valign="top" align="middle">yes</TD></TR> | |||
| <tr> | |||
| <td valign="top">remote</TD> | |||
| <td valign="top"> | |||
| <P>name and port of a remote tool server. (format: | |||
| <servername>:<port no>).<BR>If this | |||
| attribute is set, the tasks will be executed on the specified tool | |||
| server. </P></TD> | |||
| <td valign="top" align="middle">no</TD></TR></TABLE> | |||
| </TABLE> | |||
| <h3>Example</H3> | |||
| <pre><vajload remote="localhost:32767"> | |||
| @@ -246,11 +239,11 @@ This example exports all packages in the VAJ project 'MyProject', except | |||
| packages starting with 'test'. | |||
| <h3>Default Excludes</H3> | |||
| The default excludes are:<br> | |||
| <pre> IBM*/** | |||
| Java class libraries/** | |||
| Sun class libraries*/** | |||
| JSP Page Compile Generated Code/** | |||
| VisualAge*/** | |||
| <pre> IBM*/** | |||
| Java class libraries/** | |||
| Sun class libraries*/** | |||
| JSP Page Compile Generated Code/** | |||
| VisualAge*/** | |||
| </PRE> | |||
| <hr> | |||
| <h2><a name="vajimport"></A>VAJImport</H2> | |||
| @@ -273,17 +266,17 @@ from the file system into VAJ. These imports can be specified with a fileset. | |||
| <td valign="top" align="middle">yes</TD></TR> | |||
| <tr> | |||
| <td valign="top">importSources</TD> | |||
| <td valign="top">export source files (default: | |||
| <td valign="top">import source files (default: | |||
| "yes")</TD> | |||
| <td valign="top" align="middle">no</TD></TR> | |||
| <tr valign="top"> | |||
| <td valign="top">importResources</TD> | |||
| <td valign="top">export resource files (default: | |||
| <td valign="top">import resource files (default: | |||
| "yes")</TD> | |||
| <td valign="top" align="middle">no</TD></TR> | |||
| <tr valign="top"> | |||
| <td valign="top">importClasses</TD> | |||
| <td valign="top">export class files (default: "no")</TD> | |||
| <td valign="top">import class files (default: "no")</TD> | |||
| <td valign="top" align="middle">no</TD></TR> | |||
| <tr> | |||
| <td valign="top">remote</TD> | |||
| @@ -369,8 +362,8 @@ install directory. If You have installed it elsewhere, adapt the pathes below. | |||
| For | |||
| a good introduction into the VAJ Remote Tool Access see the | |||
| great introduction from Glenn McAllister at | |||
| <A href="http://www7.software.ibm.com/vad.nsf/Data/Document4366"> | |||
| http://www7.software.ibm.com/vad.nsf/Data/Document4366</A>. It | |||
| <A href="http://www7.software.ibm.com/vad.nsf/Data/Document4366"> | |||
| http://www7.software.ibm.com/vad.nsf/Data/Document4366</A>. It | |||
| is highly recommended to read this article before doing the installation (to | |||
| understand what you do :-) ). | |||
| <LI>insert the following lines into | |||
| @@ -169,6 +169,13 @@ or are out of date, the ejbc tool is run to generate new versions.</p> | |||
| processed.</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">keepgenerated</td> | |||
| <td>Controls whether ejbc will keep the | |||
| intermediate Java files used to build the class files. This can be | |||
| useful when debugging.</td> | |||
| <td>No, defaults to false.</td> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <pre><ejbc descriptors="${gen.classes}" | |||
| @@ -323,7 +330,7 @@ and hence ant, will not complete until the weblogic instance is stopped.</p> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">BEA Home</td> | |||
| <td valign="top">The location of the BEA Home qwhere the server's config is defined. | |||
| <td valign="top">The location of the BEA Home where the server's config is defined. | |||
| If this attribute is present, wlrun assumes that the server will | |||
| be running under Weblogic 6.0</td> | |||
| <td valign="top" align="center">N/A</td> | |||
| @@ -407,8 +414,8 @@ and hence ant, will not complete until the weblogic instance is stopped.</p> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">args</td> | |||
| <td valign="top">Additional argument string passed to the Weblogic instance.</td> | |||
| <td valign="top">weblogicMainClass</td> | |||
| <td valign="top">name of the main class for weblogic</td> | |||
| <td valign="top" align="center">No</td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| @@ -473,7 +480,7 @@ specify the BEA Home to have this task work correctly under 6.0</p> | |||
| <tr> | |||
| <td valign="top">classpath</td> | |||
| <td valign="top">The classpath to be used with the Java Virtual Machine that runs the Weblogic | |||
| Shutdown comment.</td> | |||
| Shutdown command.</td> | |||
| <td valign="top" align="center">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -502,7 +509,7 @@ specify the BEA Home to have this task work correctly under 6.0</p> | |||
| <h3>Nested Element</h3> | |||
| <p>The classpath of the welstop task can be set by a <classpath> nested element.</p> | |||
| <p>The classpath of the wlstop task can be set by a <classpath> nested element.</p> | |||
| <h3>Examples</h3> | |||
| @@ -1002,8 +1009,8 @@ define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.</p> | |||
| the weblogic class hierarchy. This should not be necessary if you | |||
| have weblogic in your classpath. If you do not, you should use a | |||
| nested <dtd> element, described above. If you do choose | |||
| to use an attribute, you should use the ejbdtd attribute in | |||
| preference to this one, anyway. | |||
| to use an attribute, you should use a | |||
| nested <dtd> element. | |||
| </td> | |||
| <td valign="top" align="center">No.</td> | |||
| </tr> | |||
| @@ -1071,7 +1078,7 @@ define this as META-INF/Customer-weblogic-cmp-rdbms-jar.xml.</p> | |||
| <tr> | |||
| <td valign="top">outputdir</td> | |||
| <td valign="top">If set ejbc will be given this directory as the output | |||
| desitination rather than a jar file. This allows for the | |||
| destination rather than a jar file. This allows for the | |||
| generation of "exploded" jars. | |||
| </td> | |||
| <td valign="top" align="center">No.</td> | |||
| @@ -1286,7 +1293,7 @@ the classpath of the ejbdeploy tool (look at the examples below). | |||
| <td valign="top" align="center">No, defaults to false</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">alwaysrebuild</td> | |||
| <td valign="top">rebuild</td> | |||
| <td valign="top">This controls whether ejbdeploy is called although no changes | |||
| have occurred.</td> | |||
| <td valign="top" align="center">No, defaults to false</td> | |||
| @@ -1308,6 +1315,7 @@ the classpath of the ejbdeploy tool (look at the examples below). | |||
| <li>SQL92</li> <li>SQL99</li> <li>DB2UDBWIN_V71</li> | |||
| <li>DB2UDBOS390_V6</li> <li>DB2UDBAS400_V4R5</li> <li>ORACLE_V8</li> | |||
| <li>INFORMIX_V92</li> <li>SYBASE_V1192</li> <li>MYSQL_V323</li> | |||
| <li>MSSQLSERVER_V7</li> | |||
| </ul> | |||
| This is also used to determine the name of the Map.mapxmi and | |||
| Schema.dbxmi files, for example Account-DB2UDBWIN_V71-Map.mapxmi | |||
| @@ -1623,6 +1631,7 @@ documentation for more details.</p> | |||
| <tr> | |||
| <td valign="Top">verbose</td> | |||
| <td valign="Top">Indicates whether or not to use -verbose switch. If | |||
| omitted, it defaults to <code>false</code>.</td> | |||
| <td align="Center" valign="Top">No</td> | |||
| </tr> | |||
| @@ -54,65 +54,57 @@ Perform code covering functions by comparing source code line execution to the p | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">home</td> | |||
| <td valign="top">The directory where is intalled JProbe.</td> | |||
| <td valign="top">The directory where JProbe is intalled.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">vm</td> | |||
| <td valign="top"> | |||
| Indicates which virtual machine to run. | |||
| Must be one of "jdk117", "jdk118" or "java2".If "java2" is specified, the user is | |||
| also required to specify a path via <tt>javahome</tt>, otherwise it will check if | |||
| the current executing VM is 1.2+ and use its java.home property to determine its | |||
| location. | |||
| in the registry for the default 1.2.x (Java 2) VM.</td> | |||
| Indicates which virtual machine to run. | |||
| Must be one of "jdk117", "jdk118" or "java2".If "java2" is specified, the user is | |||
| also required to specify a path via <tt>javaexe</tt>, otherwise it will check if | |||
| the current executing VM is 1.2+ and use its java.home property to determine its | |||
| location.</td> | |||
| <td align="center" valign="top">No, default to embedded VM if 1.2+</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">javahome</td> | |||
| <td valign="top">For Java 2 only, specifies the path of the jdk1.2.x virtual | |||
| machine to be used. This is only valid when specifying the <tt>vm="java2"</tt>.</td> | |||
| <td align="center" valign="top">No, use only for java2</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">javaexe</td> | |||
| <td valign="top">Similar to <tt>javahome</tt>, except this is the path to | |||
| the java executable.</td> | |||
| <td align="center" valign="top">No, use only for java2</td> | |||
| <td valign="top">The path to the java executable.</td> | |||
| <td align="center" valign="top">No, use only for java2 vm.</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">applet</td> | |||
| <td valign="top">Run an applet. The default is false, unless the file under | |||
| analysis ends with htm or html.</td> | |||
| analysis ends with htm or html.</td> | |||
| <td align="center" valign="top">No, default is "false".</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">seedname</td> | |||
| <td valign="top">Seed name for the temporary snapshot files (files will be named | |||
| seed.jpc, seed1.jpc, seed2.jpc, ...)</td> | |||
| seed.jpc, seed1.jpc, seed2.jpc, ...)</td> | |||
| <td align="center" valign="top">No, default to "snapshot"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">exitprompt</td> | |||
| <td valign="top">Toggles display of the console prompt: "Press Enter to close | |||
| this window." "always": Always displays the prompt. "never": Never displays the | |||
| prompt. "error": Only displays prompt after an error.</td> | |||
| this window." "always": Always displays the prompt. "never": Never displays the | |||
| prompt. "error": Only displays prompt after an error.</td> | |||
| <td align="center" valign="top">No, default is "never"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">finalsnapshot</td> | |||
| <td valign="top">Type of snapshot to send at program termination. Must be one | |||
| of "none","coverage","all"</td> | |||
| of "none","coverage","all"</td> | |||
| <td align="center" valign="top">No, default to "coverage"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">recordfromstart</td> | |||
| <td valign="top">Must be one of "coverage", "all", "none". If you want | |||
| Coverage to start analyzing as soon as the program begins to run, use "all". | |||
| If not, select "none".</td> | |||
| Coverage to start analyzing as soon as the program begins to run, use "all". | |||
| If not, select "none".</td> | |||
| <td align="center" valign="top">No, default to "coverage"</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -123,8 +115,8 @@ Perform code covering functions by comparing source code line execution to the p | |||
| <tr> | |||
| <td valign="top">snapshotdir</td> | |||
| <td valign="top">The path to the directory where snapshot files are stored. | |||
| Choose a directory that is reachable by both the remote and local computers, | |||
| and enter the same path on the command line and in the viewer.</td> | |||
| Choose a directory that is reachable by both the remote and local computers, | |||
| and enter the same path on the command line and in the viewer.</td> | |||
| <td align="center" valign="top">No, default to current directory</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -135,7 +127,7 @@ Perform code covering functions by comparing source code line execution to the p | |||
| <tr> | |||
| <td valign="top">tracknatives</td> | |||
| <td valign="top">Test native methods. Note that testing native methods with | |||
| Java 2 disables the JIT</td> | |||
| Java 2 disables the JIT</td> | |||
| <td align="center" valign="top">No, default to "false".</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -214,14 +206,14 @@ The syntax is filters is similar to a <a href="../CoreTypes/fileset.html">filese | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">defaultexclude</td> | |||
| <td valign="top">As a default, the coverage exclude all classes and methods. | |||
| <td valign="top">As a default, the coverage excludes all classes and methods. | |||
| Default filters are equivalent to | |||
| <pre> | |||
| <filters> | |||
| <exclude class="*" method="*"/> | |||
| </filters> | |||
| </pre> | |||
| </td> | |||
| </pre> | |||
| </td> | |||
| <td align="center">No, default to "true"</td> | |||
| </tr> | |||
| </table> | |||
| @@ -239,12 +231,17 @@ with a <tt>name</tt> attribute. | |||
| <tr> | |||
| <td valign="top">class</td> | |||
| <td valign="top">The class mask as a simple regular expression</td> | |||
| <td align="center">No, default to *</td> | |||
| <td align="center">No, defaults to "*"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">method</td> | |||
| <td valign="top">The method mask as a simple regular expression</td> | |||
| <td align="center">No, default to *</td> | |||
| <td align="center">No, defaults to "*"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">enabled</td> | |||
| <td valign="top">is the filter enabled?</td> | |||
| <td align="center">No, defaults to true</td> | |||
| </tr> | |||
| </table> | |||
| </blockquote> | |||
| @@ -280,21 +277,21 @@ on method) and it has the following attributes: | |||
| <tr> | |||
| <td valign="top">name</td> | |||
| <td valign="top">The name of the method(s) as a regular expression. The name | |||
| is the fully qualified name on the form <tt>package.classname.method</tt></td> | |||
| is the fully qualified name on the form <tt>package.classname.method</tt></td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">event</td> | |||
| <td valign="top">the event on the method that will trigger the action. Must be | |||
| "enter" or "exit".</td> | |||
| "enter" or "exit".</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">action</td> | |||
| <td valign="top">the action to execute. Must be one of "clear", | |||
| "pause", "resume", "snapshot", "suspend", | |||
| or "exit". They respectively clear recording, pause recording, | |||
| resume recording, take a snapshot, suspend the recording and exit the program. | |||
| "pause", "resume", "snapshot", "suspend", | |||
| or "exit". They respectively clear recording, pause recording, | |||
| resume recording, take a snapshot, suspend the recording and exit the program. | |||
| </td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| @@ -323,26 +320,26 @@ same class.</p> | |||
| <h3>Parameters</h3> | |||
| <table border="1" cellpadding="2" cellspacing="0"> | |||
| <tr> | |||
| <td width="12%" valign="top"><b>Attribute</b></td> | |||
| <td width="78%" valign="top"><b>Description</b></td> | |||
| <td width="10%" valign="top"><b>Required</b></td> | |||
| <td width="12%" valign="top"><b>Attribute</b></td> | |||
| <td width="78%" valign="top"><b>Description</b></td> | |||
| <td width="10%" valign="top"><b>Required</b></td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">home</td> | |||
| <td valign="top">The directory where is installed JProbe.</td> | |||
| <td valign="top">home</td> | |||
| <td valign="top">The directory where JProbe is installed.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">tofile</td> | |||
| <td valign="top">the output filename that will be the result | |||
| of the name.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| <td valign="top">tofile</td> | |||
| <td valign="top">the output filename that will be the result | |||
| of the name.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">verbose</td> | |||
| <td valign="top">Perform the merge in verbose mode giving | |||
| details about the snapshot processing.</td> | |||
| <td align="center" valign="top">No. Default to false</td> | |||
| <td valign="top">verbose</td> | |||
| <td valign="top">Perform the merge in verbose mode giving | |||
| details about the snapshot processing.</td> | |||
| <td align="center" valign="top">No. Default to false</td> | |||
| </tr> | |||
| </table> | |||
| @@ -377,47 +374,47 @@ Oro</a> in Ant classpath, to run the <tt>reference</tt> feature.</p> | |||
| <h3>Parameters</h3> | |||
| <table border="1" cellpadding="2" cellspacing="0"> | |||
| <tr> | |||
| <td width="12%" valign="top"><b>Attribute</b></td> | |||
| <td width="78%" valign="top"><b>Description</b></td> | |||
| <td width="10%" valign="top"><b>Required</b></td> | |||
| <td width="12%" valign="top"><b>Attribute</b></td> | |||
| <td width="78%" valign="top"><b>Description</b></td> | |||
| <td width="10%" valign="top"><b>Required</b></td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">home</td> | |||
| <td valign="top">The directory where is intalled JProbe.</td> | |||
| <td valign="top">home</td> | |||
| <td valign="top">The directory where JProbe is intalled.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">format</td> | |||
| <td valign="top">The format of the generated report. Must be "xml", "html" or "text"</td> | |||
| <td align="center" valign="top">No, default to "html"</td> | |||
| <td valign="top">format</td> | |||
| <td valign="top">The format of the generated report. Must be "xml", "html" or "text"</td> | |||
| <td align="center" valign="top">No, default to "html"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">type</td> | |||
| <td valign="top">The type of report to be generated. Must be "executive", | |||
| "summary", "detailed" or "verydetailed"</td> | |||
| <td align="center" valign="top">No. Default to "detailed"</td> | |||
| <td valign="top">type</td> | |||
| <td valign="top">The type of report to be generated. Must be "executive", | |||
| "summary", "detailed" or "verydetailed"</td> | |||
| <td align="center" valign="top">No. Default to "detailed"</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">percent</td> | |||
| <td valign="top">A numeric value for the threshold for printing methods. Must | |||
| be between 0 and 100.</td> | |||
| <td align="center" valign="top">No, default to 100</td> | |||
| <td valign="top">percent</td> | |||
| <td valign="top">A numeric value for the threshold for printing methods. Must | |||
| be between 0 and 100.</td> | |||
| <td align="center" valign="top">No, default to 100</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">snapshot</td> | |||
| <td valign="top">The name of the snapshot file that is the source to the report.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| <td valign="top">snapshot</td> | |||
| <td valign="top">The name of the snapshot file that is the source to the report.</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">tofile</td> | |||
| <td valign="top">The name of the generated output file</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| <td valign="top">tofile</td> | |||
| <td valign="top">The name of the generated output file</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">includesource</td> | |||
| <td valign="top">Include text of the source code lines. Only applies to | |||
| <td valign="top">includesource</td> | |||
| <td valign="top">Include text of the source code lines. Only applies to | |||
| format="xml" and type="verydetailed"</td> | |||
| <td align="center" valign="top">No. Defaults to "yes"</td> | |||
| <td align="center" valign="top">No. Defaults to "yes"</td> | |||
| </tr> | |||
| </table> | |||
| @@ -526,7 +523,7 @@ one for JUnit. It needs either Xalan 1.2.2 or Xalan 2.x.</p> | |||
| </p> | |||
| <pre><style processor="xalan" in="./reports/xml/results.xml" out="./reports/html/dummy.file" | |||
| style="${ant.home}/etc/coverage-frames.xsl"> | |||
| <param name="output.dir" expression="'${basedir}/reports/html'"/> | |||
| <param name="output.dir" expression="'${basedir}/reports/html'"/> | |||
| </style></pre> | |||
| <p>Xalan 2.x (note the parameter without single quote)</p> | |||
| <pre><style processor="trax" in="./reports/xml/results.xml" out="./reports/html/dummy.file" | |||
| @@ -535,7 +532,7 @@ one for JUnit. It needs either Xalan 1.2.2 or Xalan 2.x.</p> | |||
| </style></pre> | |||
| <hr> | |||
| <p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||
| <p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||
| Reserved.</p> | |||
| </body> | |||
| </html> | |||
| @@ -174,10 +174,6 @@ classpath. | |||
| <h4>classpathref</h4> | |||
| a reference to an existing classpath | |||
| <h4>compilerclasspath</h4> | |||
| The classpath used to locate an optional compiler adapter specified by | |||
| <code>compiler</code> | |||
| <h4>webapp</h4> | |||
| Instructions to jasper to build an entire web application. | |||
| The base directory must have a WEB-INF subdirectory beneath it. | |||
| @@ -279,8 +279,8 @@ although P4Edit can open files to the default change, P4Submit cannot yet submi | |||
| <h3>Examples</h3> | |||
| <pre> | |||
| <p4edit | |||
| view="//depot/projects/projectfoo/main/src/Blah.java..." | |||
| change="${p4.change}" /> | |||
| view="//depot/projects/projectfoo/main/src/Blah.java..." | |||
| change="${p4.change}" /> | |||
| </pre> | |||
| <hr> | |||
| @@ -16,7 +16,7 @@ by | |||
| <li>Don Jeffery (<a href="mailto:donj@apogeenet.com">donj@apogeenet.com</a>)</li> | |||
| </ul> | |||
| Version 1.1 - 2001/06/27<br> | |||
| <p>Problems with UNC pathnames and the use of () in paths are fixed and an updateonly | |||
| <p>Problems with UNC pathnames and the use of () in paths are fixed and an updateonly | |||
| argument introduced.</p> | |||
| Version 1.0 - 2001/01/31<br> | |||
| <p>Initial release.</p> | |||
| @@ -34,7 +34,7 @@ The pvcs task allows the user of ant to extract the latest edition | |||
| of the source code from a PVCS repository. PVCS is a version control system | |||
| developed by <a href="http://www.merant.com/products/pvcs">Merant</a>. | |||
| <br> | |||
| Before using this tag, the user running ant must have access to the commands | |||
| Before using this tag, the user running ant must have access to the commands | |||
| of PVCS (get and pcli) and must have access to the repository. Note that the way to specify | |||
| the repository is platform dependent so use property to specify location of repository. | |||
| <br> | |||
| @@ -88,8 +88,8 @@ specified)</td> | |||
| <tr> | |||
| <td VALIGN=TOP WIDTH="12%">promotiongroup</td> | |||
| <td VALIGN=TOP WIDTH="78%">Only files within this promotion group are extracted. Using | |||
| both the <i>label</i> and the <i>promotiongroup</i> tag will cause the files in the | |||
| <td VALIGN=TOP WIDTH="78%">Only files within this promotion group are extracted. Using | |||
| both the <i>label</i> and the <i>promotiongroup</i> tag will cause the files in the | |||
| promotion group and with that label to be extracted. | |||
| </td> | |||
| @@ -125,34 +125,34 @@ tag expects the executables to be found using the PATH environment variable.</td | |||
| <td VALIGN=TOP WIDTH="10%">No</td> | |||
| </tr> | |||
| <tr> | |||
| <tr> | |||
| <td VALIGN=TOP WIDTH="12%">ignorereturncode</td> | |||
| <td VALIGN=TOP WIDTH="78%">If set to <i>true</i> the return value from executing | |||
| <td VALIGN=TOP WIDTH="78%">If set to <i>true</i> the return value from executing | |||
| the pvcs commands are ignored.</td> | |||
| <td VALIGN=TOP WIDTH="10%">No</td> | |||
| </tr> | |||
| <tr> | |||
| <tr> | |||
| <td VALIGN=TOP WIDTH="12%">updateonly</td> | |||
| <td VALIGN=TOP WIDTH="78%">If set to <i>true</i> files are gotten only if | |||
| <td VALIGN=TOP WIDTH="78%">If set to <i>true</i> files are gotten only if | |||
| newer than existing local files.</td> | |||
| <td VALIGN=TOP WIDTH="10%">No</td> | |||
| </tr> | |||
| <tr> | |||
| <tr> | |||
| <td valign="TOP">filenameformat</td> | |||
| <td valign="TOP">The format of your folder names in a | |||
| format suitable for <code>java.text.MessageFormat</code>. | |||
| Index 1 of the format will be used as the file name. | |||
| Defaults to <code>{0}-arc({1})</code>.</td> | |||
| Defaults to <code>{0}-arc({1})</code>. Repositories where | |||
| the archive extension is not <code>-arc</code> should set | |||
| this.</td> | |||
| <td valign="TOP">No</td> | |||
| </tr> | |||
| <tr> | |||
| <tr> | |||
| <td valign="TOP">linestart</td> | |||
| <td valign="TOP">What a valid return value from PVCS looks like | |||
| when it describes a file. Defaults to <code>"P:</code>. | |||
| If you are not using an UNC name for your repository and the | |||
| drive letter <code>P</code> is incorrect for your setup, you may | |||
| need to change this value, UNC names will always be | |||
| accepted.</td> | |||
| <td valign="TOP">Used to parse the output of the pcli | |||
| command. It defaults to <code>"P:</code>. The parser already | |||
| knows about / and \\, this property is useful in cases where the | |||
| repository is accessed on a Windows platform via a drive letter | |||
| mapping.</td> | |||
| <td valign="TOP">No</td> | |||
| </tr> | |||
| </table> | |||
| @@ -66,10 +66,10 @@ We <b>strongly</b> recommend that you use Jakarta Oro. | |||
| <td valign="top">flags</td> | |||
| <td valign="top">The flags to use when matching the regular expression. For more | |||
| information, consult the Perl5 syntax<br /> | |||
| g --> Global replacement. Replace all occurences found<br /> | |||
| i --> Case Insensitive. Do not consider case in the match<br /> | |||
| m --> Multiline. Treat the string as multiple lines of input, using "^" and "$" as the start or end of any line, respectively, rather than start or end of string.<br /> | |||
| s --> Singleline. Treat the string as a single line of input, using "." to match any character, including a newline, which normally, it would not match.<br /> | |||
| g : Global replacement. Replace all occurences found<br /> | |||
| i : Case Insensitive. Do not consider case in the match<br /> | |||
| m : Multiline. Treat the string as multiple lines of input, using "^" and "$" as the start or end of any line, respectively, rather than start or end of string.<br /> | |||
| s : Singleline. Treat the string as a single line of input, using "." to match any character, including a newline, which normally, it would not match.<br /> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -37,7 +37,7 @@ | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">cleanBuildDir</td> | |||
| <td valign="top">his will remove the generated files in the BUILD | |||
| <td valign="top">This will remove the generated files in the BUILD | |||
| directory.</td> | |||
| <td align="center" valign="top">No</td> | |||
| </tr> | |||
| @@ -47,6 +47,12 @@ directory.</td> | |||
| <td align="center" valign="top">No</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">removeSource</td> | |||
| <td valign="top"> Flag (optional, default=false) | |||
| to remove the sources after the build. | |||
| See the the <tt>--rmsource</tt> option of rpmbuild.</td> | |||
| <td align="center" valign="top">No</td> | |||
| </tr> <tr> | |||
| <td valign="top">command</td> | |||
| <td valign="top">very similar idea to the cvs task. the default is "-bb"</td> | |||
| <td align="center" valign="top">No</td> | |||
| @@ -59,7 +65,7 @@ directory.</td> | |||
| </table> | |||
| <hr> | |||
| <p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||
| <p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||
| Reserved.</p> | |||
| </body> | |||
| @@ -35,7 +35,7 @@ still required. | |||
| <td valign="top">language</td> | |||
| <td valign="top">The programming language the script is written in. | |||
| Must be a supported BSF language</td> | |||
| <td valign="top" align="center">No</td> | |||
| <td valign="top" align="center">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">src</td> | |||
| @@ -190,7 +190,7 @@ required for all actions. | |||
| It is in the form <code><component>:<target1>,<target2>...</code> | |||
| Where component is the archive name (minus the .jar, .ear, .war | |||
| extension). Targets are the servers where the components will be deployed</td> | |||
| <td>Yes</td> | |||
| <td>no</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">debug</td> | |||
| @@ -222,7 +222,7 @@ WebLogic server:</p> | |||
| <pre> | |||
| <serverdeploy action="delete" source="${lib.dir}/ejb_myApp.jar"/> | |||
| <weblogic application="myapp" | |||
| <weblogic application="myapp" | |||
| server="t3://myserver:7001" | |||
| classpath="${weblogic.home}/lib/weblogic.jar" | |||
| username="${user.name}" | |||
| @@ -23,7 +23,7 @@ Version 1.1 2002/01/23 | |||
| <h2>Contents</h2> | |||
| <ul> | |||
| <li><a href="#intro">Introduction</a></li> | |||
| <li><a href="#intro">Introduction</a></li> | |||
| <li><a href="#tasks">The Tasks</a></li> | |||
| </ul> | |||
| @@ -55,17 +55,17 @@ have been tested with Linux, Solaris & Windows2000.</p> | |||
| <td>Retrieves a read-only copy of the specified project or file.</td> | |||
| </tr> | |||
| <tr> | |||
| <td><a href="#SOSLabel"> soslabel</a></td> | |||
| <td><a href="#SOSLabel">soslabel</a></td> | |||
| <td>Assigns a label to the specified project.</td> | |||
| </tr> | |||
| <tr> | |||
| <td><a href="#SOSCheckIn"> soscheckin</a></td> | |||
| <td><a href="#SOSCheckIn">soscheckin</a></td> | |||
| <td>Updates VSS with changes made to a checked out file or project, | |||
| and unlocks the VSS master copy.</td> | |||
| </tr> | |||
| <tr> | |||
| <td><a href="#SOSCheckOut"> soscheckout</a></td> | |||
| <td>Retrieves a read-write copy of the specified project | |||
| <td><a href="#SOSCheckOut">soscheckout</a></td> | |||
| <td>Retrieves a read-write copy of the specified project | |||
| or file, locking the VSS master copy</td> | |||
| </tr> | |||
| @@ -28,6 +28,26 @@ whilst waiting for your builds to complete...</p> | |||
| <td valign="top" align="center">No</td> | |||
| <td valign="top" align="center">antlogo.gif from the classpath</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">showduration</td> | |||
| <td valign="top">Initial period to pause the build to show the | |||
| splash in milliseconds.</td> | |||
| <td valign="top" align="center">No</td> | |||
| <td valign="top" align="center">5000 ms</td> | |||
| </tr> | |||
| </table> | |||
| <h3>Deprecated properties</h3> | |||
| The following properties can be used to configure the proxy settings to retrieve | |||
| an image from behind a firewall. However, the settings apply not just to this | |||
| task, but to all following tasks. Therefore they are now mostly deprecated in | |||
| preference to the <setproxy> task, that makes it clear to readers of | |||
| the build exactly what is going on. We say mostly as this task's support | |||
| includes proxy authentication, so you may still need to use its | |||
| proxy attributes. | |||
| <table border="1" cellpadding="2" cellspacing="0"> | |||
| <tr> | |||
| <td valign="top">useproxy</td> | |||
| <td valign="top">Use a proxy to access imgurl. Note: Only tested | |||
| @@ -60,13 +80,7 @@ whilst waiting for your builds to complete...</p> | |||
| <td valign="top" align="center">No</td> | |||
| <td valign="top" align="center">None</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">showduration</td> | |||
| <td valign="top">Initial period to pause the build to show the | |||
| splash in milliseconds.</td> | |||
| <td valign="top" align="center">No</td> | |||
| <td valign="top" align="center">5000 ms</td> | |||
| </tr> | |||
| </table> | |||
| <h3>Examples</h3> | |||
| <blockquote><pre> | |||
| @@ -76,15 +90,10 @@ whilst waiting for your builds to complete...</p> | |||
| <blockquote><pre> | |||
| <splash imageurl="http://jakarta.apache.org/images/jakarta-logo.gif" | |||
| useproxy="true" | |||
| showduration="5000" | |||
| proxy="proxy.mydomain.com" | |||
| port="8080" | |||
| user="BuildEng" | |||
| password="LetMePass"/> | |||
| showduration="5000"/> | |||
| </pre></blockquote> | |||
| <p>Splashes the jakarta logo, via a connection through the proxy at | |||
| proxy.mydomain.com on port 8080 (as user BuildEng/LetMePass) for | |||
| <p>Splashes the jakarta logo, for | |||
| an initial period of 5 seconds.</p> | |||
| <hr> | |||
| <p align="center">Copyright © 2002 Apache Software Foundation. All rights | |||
| @@ -170,7 +170,7 @@ If false (default) has no effect. | |||
| username="auser" | |||
| password="secret" | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| force="true" | |||
| force="true" | |||
| /> | |||
| </pre> | |||
| @@ -184,7 +184,7 @@ created for them and any non-StarTeam files found in the tree will be deleted. | |||
| username="auser" | |||
| password="secret" | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| And this is a simpler way of accomplishing the same thing as the previous example, using the URL attribute. | |||
| @@ -197,7 +197,7 @@ And this is a simpler way of accomplishing the same thing as the previous exampl | |||
| rootstarteamfolder="\Dev" | |||
| excludes="*.bak *.old" | |||
| label="v2.6.001" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -211,7 +211,7 @@ end in <i>.bak</i> or <i>.old</i> with the label <i>v2.6.001</i>. | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| includes="*.htm,*.html" | |||
| excludes="index.*" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -227,8 +227,8 @@ not be checked out by this command. | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| includes="*.htm,*.html" | |||
| excludes="index.*" | |||
| forced="true" | |||
| recursive="false" | |||
| forced="true" | |||
| recursive="false" | |||
| /> | |||
| </pre> | |||
| This example is like the previous one, but will only check out files in | |||
| @@ -240,7 +240,7 @@ C:\dev\buildtest\co, because of the turning off of the recursive attribute. | |||
| password="secret" | |||
| rootstarteamfolder="src/java" | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| <br></br> | |||
| @@ -258,7 +258,7 @@ C:\dev\buildtest\co, because of the turning off of the recursive attribute. | |||
| password="secret" | |||
| rootstarteamfolder="src/java" | |||
| rootlocalfolder="C:\dev\buildtest\co\src\java" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -351,7 +351,7 @@ change it. If false (default) lock status will not change. | |||
| username="auser" | |||
| password="secret" | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -365,7 +365,7 @@ For files and folders in the local tree but not in starteam, nothing will be don | |||
| username="auser" | |||
| password="secret" | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| And this is a simpler way of giving the same commands as the command above using the URL shortcut. | |||
| @@ -377,7 +377,7 @@ And this is a simpler way of giving the same commands as the command above using | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| rootstarteamfolder="\Dev" | |||
| excludes="*.bak *.old" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -391,7 +391,7 @@ end in <i>.bak</i> or <i>.old</i> from the tree rooted at"C:\dev\buildtest\co" . | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| includes="*.htm,*.html" | |||
| excludes="index.*" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -408,8 +408,8 @@ not be checked in by this command. | |||
| rootstarteamfolder="src/java" | |||
| includes="*.htm,*.html" | |||
| excludes="index.*" | |||
| forced="true" | |||
| recursive="false" | |||
| forced="true" | |||
| recursive="false" | |||
| /> | |||
| </pre> | |||
| This example is like the previous one, but will only check in files from | |||
| @@ -422,8 +422,8 @@ C:\dev\buildtest\co, because of the turning off of the recursive attribute. | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| rootstarteamfolder="src/java" | |||
| includes="version.txt" | |||
| forced="true" | |||
| recursive="false" | |||
| forced="true" | |||
| recursive="false" | |||
| /> | |||
| </pre> | |||
| This example is like the previous one, but will only check only in one file, C:\dev\buildtest\co\version.txt to the StarTeam folder src/java. | |||
| @@ -435,10 +435,10 @@ This example is like the previous one, but will only check only in one file, C:\ | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| rootstarteamfolder="src/java" | |||
| includes="version.java" | |||
| forced="true" | |||
| recursive="false" | |||
| addUncontrolled="true" | |||
| comment="Fix Bug #667" | |||
| forced="true" | |||
| recursive="false" | |||
| addUncontrolled="true" | |||
| comment="Fix Bug #667" | |||
| /> | |||
| </pre> | |||
| This example is like the previous one, but will only check only in one file, C:\dev\buildtest\co\version.java to the StarTeam folder src/java. Because the <i>addUncontrolled</i> attribute has been set, if StarTeam does not already control this file in this location, it will be added to the repository. Also, it will write a comment to the repository for this version of the file. | |||
| @@ -449,7 +449,7 @@ This example is like the previous one, but will only check only in one file, C:\ | |||
| password="secret" | |||
| rootstarteamfolder="src/java" | |||
| rootlocalfolder="C:\dev\buildtest\co" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| <br></br> | |||
| @@ -467,7 +467,7 @@ This example is like the previous one, but will only check only in one file, C:\ | |||
| password="secret" | |||
| rootstarteamfolder="src/java" | |||
| rootlocalfolder="C:\dev\buildtest\co\src\java" | |||
| forced="true" | |||
| forced="true" | |||
| /> | |||
| </pre> | |||
| @@ -606,8 +606,8 @@ while adding a <i>rootlocalfolder</i> and an <i>excludes</i> param ... | |||
| <stlist url="WASHINGTON:49201/build" | |||
| username="auser" | |||
| password="secret" | |||
| rootlocalfolder="srcdir2" | |||
| excludes="*.properties" | |||
| rootlocalfolder="srcdir2" | |||
| excludes="*.properties" | |||
| /> | |||
| </pre> | |||
| @@ -14,6 +14,11 @@ Unlike the commandline version of this tool, all three arguments | |||
| are required to run stylebook.</p> | |||
| <p><b>Note:</b> This task depends on external libraries not included in the Ant distribution. | |||
| See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p> | |||
| <p> | |||
| Being extended from <Java>, all the parent's attributes | |||
| and options are available. Do not set any apart from the <tt>classpath</tt> | |||
| as they are not guaranteed to be there in future. | |||
| </p> | |||
| <h3>Parameters</h3> | |||
| <table border="1" cellpadding="2" cellspacing="0"> | |||
| @@ -57,7 +62,7 @@ The above will generate documentation in build/docs starting from the book | |||
| src/xdocs/book.xml and using the skin located in directory src/skins/myskin. | |||
| <hr> | |||
| <p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||
| <p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||
| Reserved.</p> | |||
| </body> | |||
| @@ -31,7 +31,11 @@ The <code>org.apache.tools.ant.taskdefs.optional.vss</code> package consists of | |||
| vss functionality as well as some Ant tasks encapsulating frequently used vss commands. | |||
| Although it is possible to use these commands on the desktop, | |||
| they were primarily intended to be used by automated build systems.</p> | |||
| <p> | |||
| If you get a CreateProcesss IOError=2 when running these, it means | |||
| that ss.exe was not found. Check to see if you can run it from the | |||
| command line -you may need to alter your path, or set the <tt>ssdir</tt> | |||
| property. | |||
| <h2><a name="tasks">The Tasks</a></h2> | |||
| <table border="0" cellspacing="0" cellpadding="3"> | |||
| @@ -64,9 +68,9 @@ they were primarily intended to be used by automated build systems.</p> | |||
| <td>Change the current project being used in VSS</td> | |||
| </tr> | |||
| <tr> | |||
| <td><a href="#vsscreate">vsscreate</a></td> | |||
| <td>Creates a project in VSS.</td> | |||
| </tr> | |||
| <td><a href="#vsscreate">vsscreate</a></td> | |||
| <td>Creates a project in VSS.</td> | |||
| </tr> | |||
| </table> | |||
| <hr> | |||
| @@ -114,17 +118,17 @@ label only one will be used in the order version, date, label.</p> | |||
| </tr> | |||
| <tr> | |||
| <td>serverPath</td> | |||
| <td>directory where <code>srssafe.ini</code> resides.</td> | |||
| <td>directory where <code>ss.ini</code> resides.</td> | |||
| <td>No</td> | |||
| </tr> | |||
| <tr> | |||
| <td>writable</td> | |||
| <td>true or false</td> | |||
| <td>true or false<; default false/td> | |||
| <td>No</td> | |||
| </tr> | |||
| <tr> | |||
| <td>recursive</td> | |||
| <td>true or false</td> | |||
| <td>true or false; default false</td> | |||
| <td>No</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -303,7 +307,7 @@ Task to perform HISTORY commands to Microsoft Visual SourceSafe. | |||
| </tr> | |||
| <tr> | |||
| <td>toDate</td> | |||
| <td>Start date for comparison</td> | |||
| <td>End date for comparison</td> | |||
| <td>See below</td> | |||
| </tr> | |||
| <tr> | |||
| @@ -343,6 +347,11 @@ Task to perform HISTORY commands to Microsoft Visual SourceSafe. | |||
| <td>brief, codediff, default or nofile. The default is default.</td> | |||
| <td>No</td> | |||
| </tr> | |||
| <tr> | |||
| <td>user</td> | |||
| <td>Name the user whose changes we would like to see</td> | |||
| <td>No</td> | |||
| </tr> | |||
| </table> | |||
| <h4>Specifying the time-frame</h4> | |||
| @@ -15,8 +15,8 @@ task uses the SAX2 parser implementation provided by JAXP by default | |||
| SAX1/2 parser if needed.</p> | |||
| <p>This task supports the use of nested <a | |||
| href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> elements and/or nested | |||
| <dtd> elements which are used to resolve DTDs and entities.</p> | |||
| href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> elements and/or nested | |||
| <tt><dtd></tt> elements which are used to resolve DTDs and entities.</p> | |||
| <h3>Parameters</h3> | |||
| <table border="1" cellpadding="2" cellspacing="0"> | |||
| @@ -34,7 +34,7 @@ href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> elements and/or nested | |||
| <td valign="top">lenient</td> | |||
| <td valign="top"> | |||
| if true, only check the xml document is well formed | |||
| (ignored if the specified parser is as SAX1 parser) | |||
| (ignored if the specified parser is as SAX1 parser) | |||
| </td> | |||
| <td valign="top" align="center">No</td> | |||
| </tr> | |||
| @@ -70,19 +70,19 @@ href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> elements and/or nested | |||
| <td width="10%" valign="top"><b>Required</b></td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">publicId</td> | |||
| <td valign="top">publicId</td> | |||
| <td valign="top">Public ID of the DTD to resolve</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">location</td> | |||
| <td valign="top">location</td> | |||
| <td valign="top">Location of the DTD to use, which can be a file, | |||
| a resource, or a URL</td> | |||
| <td align="center" valign="top">Yes</td> | |||
| </tr> | |||
| </table> | |||
| <h4>xmlcatalog</h4> | |||
| <p>The <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | |||
| <p>The <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | |||
| element is used to perform Entity resolution.</p> | |||
| @@ -93,9 +93,9 @@ element is used to perform Entity resolution.</p> | |||
| <xmlvalidate failonerror="no" lenient="yes" warn="yes" | |||
| classname="org.apache.xerces.parsers.SAXParser" > | |||
| classpath="lib/xerces.jar"> | |||
| <fileset dir="src" includes="style/*.xsl"/> | |||
| <fileset dir="src" includes="style/*.xsl"/> | |||
| </xmlvalidate> | |||
| <xmlvalidate file="struts-config.xml" warn="false"> | |||
| <dtd publicId="-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" | |||
| location="struts-config_1_0.dtd"/> | |||
| @@ -109,7 +109,7 @@ element is used to perform Entity resolution.</p> | |||
| <xmlvalidate failonerror="no"> | |||
| <fileset dir="${project.dir}" includes="**/*.xml"/> | |||
| <xmlcatalog> | |||
| <dtd | |||
| <dtd | |||
| publicId="-//ArielPartners//DTD XML Article V1.0//EN" | |||
| location="com/arielpartners/knowledgebase/dtd/article.dtd"/> | |||
| </xmlcatalog> | |||
| @@ -11,6 +11,8 @@ | |||
| <h2><a href="toc.html" target="navFrame">Table of Contents</a></h2> | |||
| <a href="optionaltasklist.html" target="navFrame">Optional Tasks</a><br> | |||
| <a href="tasksoverview.html" target="mainFrame">Overview of Ant Tasks</a><br> | |||
| <a href="conceptstypeslist.html" target="navFrame">Concepts and Types</a><br> | |||
| <h3>Core Tasks</h3> | |||
| <a href="CoreTasks/ant.html">Ant</a><br> | |||
| @@ -74,6 +76,7 @@ | |||
| <a href="CoreTasks/style.html">Style</a><br> | |||
| <a href="CoreTasks/tar.html">Tar</a><br> | |||
| <a href="CoreTasks/taskdef.html">Taskdef</a><br> | |||
| <a href="CoreTasks/tempfile.html">Tempfile</a><br> | |||
| <a href="CoreTasks/touch.html">Touch</a><br> | |||
| <a href="CoreTasks/tstamp.html">TStamp</a><br> | |||
| <a href="CoreTasks/typedef.html">Typedef</a><br> | |||
| @@ -161,6 +161,8 @@ They are:</p> | |||
| **/SCCS | |||
| **/SCCS/** | |||
| **/vssver.scc | |||
| **/.svn | |||
| **/.svn/** | |||
| </pre> | |||
| <p>If you do not want these default excludes applied, you may disable them with the | |||
| <code>defaultexcludes="no"</code> attribute.</p> | |||
| @@ -67,10 +67,25 @@ compiler is supported. | |||
| </p> | |||
| <hr> | |||
| <h2><a name="installing">Installing Ant</a></h2> | |||
| <p>The binary distribution of Ant consists of three directories: | |||
| <code>bin</code>, | |||
| <code>docs</code> and | |||
| <code>lib</code> | |||
| <p>The binary distribution of Ant consists of the following directory layout: | |||
| <pre> | |||
| ant | |||
| +--- bin // contains launcher scripts | |||
| | | |||
| +--- lib // contains Ant jars plus necessary dependencies | |||
| | | |||
| +--- docs // contains documentation | |||
| | +--- ant2 // a brief description of ant2 requirements | |||
| | | | |||
| | +--- images // various logos for html documentation | |||
| | | | |||
| | +--- manual // Ant documentation (a must read ;-) | |||
| | | |||
| +--- etc // contains xsl goodies to: | |||
| // - create an enhanced report from xml output of various tasks. | |||
| // - migrate your build files and get rid of 'deprecated' warning | |||
| // - ... and more ;-) | |||
| </pre> | |||
| Only the <code>bin</code> and <code>lib</code> directories are | |||
| required to run Ant. | |||
| @@ -193,7 +208,7 @@ for examples on how to do this for your operating system. </p> | |||
| <p>Make sure you have downloaded any auxiliary jars required to | |||
| build tasks you are interested in. These should either be available | |||
| on the CLASSPATH or added to the <code>lib/optional</code> | |||
| on the CLASSPATH or added to the <code>lib</code> | |||
| directory. | |||
| See <a href="#librarydependencies">Library Dependencies</a> | |||
| for a list of jar requirements for various features. | |||
| @@ -11,6 +11,8 @@ | |||
| <h2><a href="toc.html" target="navFrame">Table of Contents</a></h2> | |||
| <a href="coretasklist.html" target="navFrame">Core Tasks</a><br> | |||
| <a href="tasksoverview.html" target="mainFrame">Overview of Ant Tasks</a><br> | |||
| <a href="conceptstypeslist.html" target="navFrame">Concepts and Types</a><br> | |||
| <h3>Optional Tasks</h3> | |||
| <a href="OptionalTasks/dotnet.html">.NET Tasks</a><br> | |||
| @@ -23,10 +25,10 @@ | |||
| <a href="OptionalTasks/echoproperties.html">Echoproperties</a><br> | |||
| <a href="OptionalTasks/ftp.html">FTP</a><br> | |||
| <a href="OptionalTasks/icontract.html">IContract</a><br> | |||
| <a href="OptionalTasks/jarlib-available.html">jarlib-available</a><br> | |||
| <a href="OptionalTasks/jarlib-display.html">jarlib-display</a><br> | |||
| <a href="OptionalTasks/jarlib-manifest.html">jarlib-manifest</a><br> | |||
| <a href="OptionalTasks/jarlib-resolve.html">jarlib-resolve</a><br> | |||
| <a href="OptionalTasks/jarlib-available.html">Jarlib-available</a><br> | |||
| <a href="OptionalTasks/jarlib-display.html">Jarlib-display</a><br> | |||
| <a href="OptionalTasks/jarlib-manifest.html">Jarlib-manifest</a><br> | |||
| <a href="OptionalTasks/jarlib-resolve.html">Jarlib-resolve</a><br> | |||
| <a href="OptionalTasks/javacc.html">JavaCC</a><br> | |||
| <a href="OptionalTasks/javah.html">Javah</a><br> | |||
| <a href="OptionalTasks/jspc.html">JspC</a><br> | |||
| @@ -49,6 +51,7 @@ | |||
| <a href="OptionalTasks/replaceregexp.html">ReplaceRegExp</a><br> | |||
| <a href="OptionalTasks/rpm.html">Rpm</a><br> | |||
| <a href="OptionalTasks/serverdeploy.html">ServerDeploy</a><br> | |||
| <a href="OptionalTasks/setproxy.html">Setproxy</a><br> | |||
| <a href="OptionalTasks/script.html">Script</a><br> | |||
| <a href="OptionalTasks/sound.html">Sound</a><br> | |||
| <a href="OptionalTasks/sos.html">SourceOffSite</a><br> | |||
| @@ -21,6 +21,7 @@ documentation.</p> | |||
| <a href="#ejb">EJB Tasks</a><br> | |||
| <a href="#exec">Execution Tasks</a><br> | |||
| <a href="#file">File Tasks</a><br> | |||
| <a href="#extensions">Java2 Extensions Tasks</a><br> | |||
| <a href="#log">Logging Tasks</a><br> | |||
| <a href="#mail">Mail Tasks</a><br> | |||
| <a href="#misc">Miscellaneous Tasks</a><br> | |||
| @@ -561,6 +562,12 @@ documentation.</p> | |||
| files.</p></td> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap><a href="CoreTasks/tempfile.html">Tempfile</a></td> | |||
| <td><p>Generates a name for a new temporary file and sets the specified | |||
| property to that name.</p></td> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap><a href="CoreTasks/touch.html">Touch</a></td> | |||
| <td><p>Changes the modification time of a file and possibly creates it at | |||
| @@ -568,6 +575,60 @@ documentation.</p> | |||
| </tr> | |||
| </table> | |||
| <p></p> | |||
| <table width="100%" border="0" cellpadding="4" cellspacing="0"> | |||
| <th align="left"> | |||
| <font size="+0" face="arial,helvetica,sanserif"> | |||
| <a name="extensions">Java2 Extensions Tasks</a></th> | |||
| </font> | |||
| <font size="-1" face="arial,helvetica,sanserif"> | |||
| <th align="right"><a href="#top">[Back to top]</a></th> | |||
| </font> | |||
| </table> | |||
| <table width="100%" border="1" cellpadding="4" cellspacing="0"> | |||
| <tr valign="top"> | |||
| <th nowrap>Task Name</th> | |||
| <th>Description</th> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap> | |||
| <a href="OptionalTasks/jarlib-available.html">Jarlib-available</a></td> | |||
| <td><p>Check whether an extension is present in a FileSet or an | |||
| ExtensionSet. If the extension is present, the specified property is | |||
| set.</p> | |||
| </td> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap> | |||
| <a href="OptionalTasks/jarlib-display.html">Jarlib-display</a></td> | |||
| <td><p>Display the "Optional Package" and | |||
| "Package Specification" information contained within the | |||
| specified jars.</p> | |||
| </td> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap> | |||
| <a href="OptionalTasks/jarlib-manifest.html">Jarlib-manifest</a></td> | |||
| <td><p>Task to generate a manifest that declares all the dependencies | |||
| in manifest. The dependencies are determined by looking in the | |||
| specified path and searching for Extension/"Optional Package" | |||
| specifications in the manifests of the jars.</p> | |||
| </td> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap> | |||
| <a href="OptionalTasks/jarlib-resolve.html">Jarlib-resolve</a></td> | |||
| <td><p>Try to locate a jar to satisfy an extension, and place the | |||
| location of the jar into the specified property.</p> | |||
| </td> | |||
| </tr> | |||
| </table> | |||
| <p></p> | |||
| <p></p> | |||
| <table width="100%" border="0" cellpadding="4" cellspacing="0"> | |||
| <th align="left"> | |||
| @@ -949,7 +1010,13 @@ documentation.</p> | |||
| nested <code><read></code> and <code><write></code> tags | |||
| to indicate strings to wait for and specify text to send.</p></td> | |||
| </tr> | |||
| <tr valign="top"> | |||
| <td nowrap><a href="OptionalTasks/setproxy.html">setproxy</a></td> | |||
| <td><p>Sets Java's web proxy properties, so that tasks and code run | |||
| in the same JVM can have through-the-firewall access to remote web sites.</p></td> | |||
| </tr> | |||
| </table> | |||
| <p></p> | |||
| @@ -30,7 +30,7 @@ to be unique. (For additional information, see the | |||
| <tr> | |||
| <td valign="top">default</td> | |||
| <td valign="top">the default target to use when no target is supplied.</td> | |||
| <td align="center" valign="top">No. Will default to "main" if not specified.</td> | |||
| <td align="center" valign="top">Yes.</td> | |||
| </tr> | |||
| <tr> | |||
| <td valign="top">basedir</td> | |||
| @@ -2,7 +2,14 @@ Please refer to the Ant manual under Installing Ant / Library | |||
| Dependencies for a list of the jar requirements for various optional | |||
| tasks and features. | |||
| This directory contains xercesImpl.jar and xmlParserAPIs from the | |||
| 2.0.1 release of Apache Xerces. For more information or newer | |||
| releases see <http://xml.apache.org/xerces2-j/>. | |||
| This directory contains xercesImpl.jar from the 2.0.2 release of | |||
| Apache Xerces. For more information or newer releases see | |||
| <http://xml.apache.org/xerces2-j/>. See the file LICENSE.xerces for | |||
| the terms of distribution. | |||
| It also contains xml-apis.jar, an Apache-controlled collection of | |||
| standard classes from the 1.0b2 release of the Apache XML-Commons | |||
| release. For more information or newer releases see | |||
| <http://xml.apache.org/commons/>. See the files LICENSE.dom and | |||
| LICENSE.sax for the terms of distribution. | |||
| @@ -0,0 +1,17 @@ | |||
| <?xml version="1.0"?> | |||
| <!DOCTYPE project [ | |||
| <!ENTITY included_file SYSTEM "file:./included_file.xml"> | |||
| ]> | |||
| <project name="test" default="test" basedir="."> | |||
| <target name="setup"> | |||
| </target> | |||
| &included_file; | |||
| <target name="test" depends="included-target"> | |||
| <echo>test target ran.</echo> | |||
| </target> | |||
| </project> | |||
| @@ -0,0 +1,4 @@ | |||
| <target name="included-target"> | |||
| extraneous_text | |||
| <echo>included-target ran.</echo> | |||
| </target> | |||
| @@ -0,0 +1,17 @@ | |||
| <?xml version="1.0"?> | |||
| <!DOCTYPE project [ | |||
| <!ENTITY included_file SYSTEM "file:./included_file.xml"> | |||
| ]> | |||
| <project name="test" default="test" basedir="."> | |||
| <target name="setup"> | |||
| </target> | |||
| &included_file; | |||
| <target name="test" depends="included-target"> | |||
| <echo>test target ran.</echo> | |||
| </target> | |||
| </project> | |||
| @@ -0,0 +1,4 @@ | |||
| <target name="included-target"> | |||
| <copy file="nonexistent-file" todir="/non/existent/dir"/> | |||
| <echo>included-target ran.</echo> | |||
| </target> | |||
| @@ -0,0 +1,19 @@ | |||
| <?xml version="1.0"?> | |||
| <!DOCTYPE project [ | |||
| <!ENTITY included_file SYSTEM "file:./included_file.xml"> | |||
| ]> | |||
| <project name="test" default="test" basedir="."> | |||
| <target name="setup"> | |||
| </target> | |||
| &included_file; | |||
| extraneous_text | |||
| <target name="test" depends="included-target"> | |||
| <echo>test target ran.</echo> | |||
| </target> | |||
| </project> | |||
| @@ -0,0 +1,3 @@ | |||
| <target name="included-target"> | |||
| <echo>included-target ran.</echo> | |||
| </target> | |||
| @@ -0,0 +1,18 @@ | |||
| <?xml version="1.0"?> | |||
| <!DOCTYPE project [ | |||
| <!ENTITY included_file SYSTEM "file:./included_file.xml"> | |||
| ]> | |||
| <project name="test" default="test" basedir="."> | |||
| <target name="setup"> | |||
| </target> | |||
| &included_file; | |||
| <target name="test" depends="included-target"> | |||
| <copy file="nonexistent-file" todir="/non/existent/dir"/> | |||
| <echo>test target ran.</echo> | |||
| </target> | |||
| </project> | |||
| @@ -0,0 +1,3 @@ | |||
| <target name="included-target"> | |||
| <echo>included-target ran.</echo> | |||
| </target> | |||
| @@ -0,0 +1,8 @@ | |||
| <root> | |||
| <a>this is the first line</a> | |||
| <b><c>not indented</c></b> | |||
| <b> | |||
| <c>indented</c> | |||
| </b> | |||
| </root> | |||
| @@ -0,0 +1,8 @@ | |||
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |||
| <!-- Copy every node and attributes recursively --> | |||
| <xsl:template match="node()|@*"> | |||
| <xsl:copy> | |||
| <xsl:apply-templates select="@*|node()"/> | |||
| </xsl:copy> | |||
| </xsl:template> | |||
| </xsl:stylesheet> | |||
| @@ -31,5 +31,16 @@ | |||
| </style> | |||
| </target> | |||
| <target name="testOutputProperty" depends="init"> | |||
| <style in="xml/test.xml" | |||
| out="xml/out/test-out.xml" | |||
| style="xml/test.xsl"> | |||
| <outputproperty name="method" value="xml"/> | |||
| <outputproperty name="standalone" value="yes"/> | |||
| <outputproperty name="encoding" value="iso8859_1"/> | |||
| <outputproperty name="indent" value="yes"/> | |||
| </style> | |||
| </target> | |||
| </project> | |||
| @@ -78,6 +78,22 @@ | |||
| </zip> | |||
| </target> | |||
| <target name="testUpdateNotNecessary" depends="feather"> | |||
| <zip destFile="asf-logo.gif.zip" | |||
| basedir=".." | |||
| includes="asf-logo.gif" | |||
| update="true" /> | |||
| </target> | |||
| <target name="testUpdateIsNecessary" depends="feather"> | |||
| <sleep seconds="5" /> | |||
| <touch file="../dummyfile" /> | |||
| <zip destFile="asf-logo.gif.zip" | |||
| basedir=".." | |||
| includes="asf-logo.gif,dummyfile" | |||
| update="true" /> | |||
| </target> | |||
| <target name="cleanup"> | |||
| <delete file="test3.zip"/> | |||
| <delete file="test4.zip"/> | |||
| @@ -88,5 +104,6 @@ | |||
| <delete file="test8.zip"/> | |||
| <delete file="asf-logo.gif.zip"/> | |||
| <delete file="zipgroupfileset.zip"/> | |||
| <delete file="../dummyfile" /> | |||
| </target> | |||
| </project> | |||
| @@ -5,6 +5,8 @@ | |||
| <property name="etc.dir" value=".."/> | |||
| <property name="test.dir" | |||
| value="selectortest"/> | |||
| <property name="mirror.dir" | |||
| value="selectortest2"/> | |||
| <target name="setupfiles"> | |||
| <mkdir dir="${test.dir}" /> | |||
| @@ -57,4 +59,27 @@ | |||
| <delete dir="${test.dir}" /> | |||
| </target> | |||
| <target name="mirrorfiles"> | |||
| <mkdir dir="${mirror.dir}" /> | |||
| <mkdir dir="${mirror.dir}/zip" /> | |||
| <mkdir dir="${mirror.dir}/tar" /> | |||
| <mkdir dir="${mirror.dir}/tar/gz" /> | |||
| <mkdir dir="${mirror.dir}/tar/bz2" /> | |||
| <touch file="${mirror.dir}/asf-logo.gif.md5"/> | |||
| <touch file="${mirror.dir}/asf-logo.gif.bz2"/> | |||
| <sleep seconds="2"/> | |||
| <touch file="${mirror.dir}/zip/asf-logo.gif.zip"/> | |||
| <sleep seconds="3"/> | |||
| <touch file="${mirror.dir}/tar/asf-logo.gif.tar"/> | |||
| <sleep seconds="2"/> | |||
| <touch file="${mirror.dir}/tar/asf-logo-huge.tar"/> | |||
| <touch file="${mirror.dir}/tar/gz/asf-logo.gif.tar.gz"/> | |||
| <touch file="${mirror.dir}/tar/bz2/asf-logo.gif.tar.bz2"/> | |||
| <touch file="${mirror.dir}/tar/bz2/asf-logo-huge.tar.bz2"/> | |||
| </target> | |||
| <target name="cleanup.mirrorfiles"> | |||
| <delete dir="${mirror.dir}" /> | |||
| </target> | |||
| </project> | |||
| @@ -0,0 +1,307 @@ | |||
| /* | |||
| * The Apache Software License, Version 1.1 | |||
| * | |||
| * Copyright (c) 2002 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 "The Jakarta Project", "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 apache@apache.org. | |||
| * | |||
| * 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; | |||
| import java.io.File; | |||
| import java.io.FilenameFilter; | |||
| import java.io.PrintStream; | |||
| import java.io.InputStream; | |||
| import java.io.IOException; | |||
| import java.util.Enumeration; | |||
| import java.util.Properties; | |||
| import java.lang.reflect.Method; | |||
| import java.lang.reflect.InvocationTargetException; | |||
| /** | |||
| * A little diagnostic helper that output some information that may help | |||
| * in support. It should quickly give correct information about the | |||
| * jar existing in ant.home/lib and the jar versions... | |||
| * | |||
| * @since Ant 1.5 | |||
| * @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a> | |||
| */ | |||
| public final class Diagnostics { | |||
| /** utility class */ | |||
| private Diagnostics(){ | |||
| } | |||
| /** | |||
| * Check if optional tasks are available. Not that it does not check | |||
| * for implementation version. Use <tt>validateVersion()</tt> for this. | |||
| * @return <tt>true</tt> if optional tasks are available. | |||
| */ | |||
| public static boolean isOptionalAvailable() { | |||
| try { | |||
| Class.forName("org.apache.tools.ant.taskdefs.optional.Test"); | |||
| } catch (ClassNotFoundException e){ | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| /** | |||
| * Check if core and optional implementation version do match. | |||
| * @throws BuildException if the implementation version of optional tasks | |||
| * does not match the core implementation version. | |||
| */ | |||
| public static void validateVersion() throws BuildException { | |||
| try { | |||
| Class optional = Class.forName("org.apache.tools.ant.taskdefs.optional.Test"); | |||
| String coreVersion = getImplementationVersion(Main.class); | |||
| String optionalVersion = getImplementationVersion(optional); | |||
| if (coreVersion != null && !coreVersion.equals(optionalVersion) ){ | |||
| throw new BuildException( | |||
| "Invalid implementation version between Ant core and Ant optional tasks.\n" + | |||
| " core : " + coreVersion + "\n" + | |||
| " optional: " + optionalVersion); | |||
| } | |||
| } catch (ClassNotFoundException e){ | |||
| } | |||
| } | |||
| /** | |||
| * return the list of jar files existing in ANT_HOME/lib | |||
| * and that must have been picked up by Ant script. | |||
| * @return the list of jar files existing in ant.home/lib or | |||
| * <tt>null</tt> if an error occurs. | |||
| */ | |||
| public static File[] listLibraries() { | |||
| String home = System.getProperty("ant.home"); | |||
| File libDir = new File(home, "lib"); | |||
| FilenameFilter filter = new FilenameFilter() { | |||
| public boolean accept(File dir, String name) { | |||
| return name.endsWith(".jar"); | |||
| } | |||
| }; | |||
| // listFiles is JDK 1.2+ method... | |||
| String[] filenames = libDir.list(filter); | |||
| File[] files = new File[filenames.length]; | |||
| for (int i = 0; i < filenames.length; i++){ | |||
| files[i] = new File(libDir, filenames[i]); | |||
| } | |||
| return files; | |||
| } | |||
| /** | |||
| * main entry point for command line | |||
| * @param args command line arguments. | |||
| */ | |||
| public static void main(String[] args){ | |||
| doReport(System.out); | |||
| } | |||
| /** | |||
| * Helper method to get the implementation version. | |||
| * @param clazz the class to get the information from. | |||
| * @return null if there is no package or implementation version. | |||
| * '?.?' for JDK 1.0 or 1.1. | |||
| */ | |||
| private static String getImplementationVersion(Class clazz){ | |||
| try { | |||
| // Package pkg = clazz.getPackage(); | |||
| Method method = Class.class.getMethod("getPackage", new Class[0]); | |||
| Object pkg = method.invoke(clazz, null); | |||
| if (pkg != null) { | |||
| // pkg.getImplementationVersion(); | |||
| method = pkg.getClass().getMethod("getImplementationVersion", new Class[0]); | |||
| Object version = method.invoke(pkg, null); | |||
| return (String)version; | |||
| } | |||
| } catch (Exception e){ | |||
| // JDK < 1.2 should land here because the methods above don't exist. | |||
| return "?.?"; | |||
| } | |||
| return null; | |||
| } | |||
| /** | |||
| * Print a report to the given stream. | |||
| * @param out the stream to print the report to. | |||
| */ | |||
| public static void doReport(PrintStream out){ | |||
| out.println("------- Ant diagnostics report -------"); | |||
| out.println(Main.getAntVersion()); | |||
| out.println(); | |||
| out.println("-------------------------------------------"); | |||
| out.println(" Implementation Version (JDK1.2+ only)"); | |||
| out.println("-------------------------------------------"); | |||
| out.println("core tasks : " + getImplementationVersion(Main.class)); | |||
| Class optional = null; | |||
| try { | |||
| optional = Class.forName( | |||
| "org.apache.tools.ant.taskdefs.optional.Test"); | |||
| out.println("optional tasks : " + getImplementationVersion(optional)); | |||
| } catch (ClassNotFoundException e){ | |||
| out.println("optional tasks : not available"); | |||
| } | |||
| out.println(); | |||
| out.println("-------------------------------------------"); | |||
| out.println(" ANT_HOME/lib jar listing"); | |||
| out.println("-------------------------------------------"); | |||
| doReportLibraries(out); | |||
| out.println(); | |||
| out.println("-------------------------------------------"); | |||
| out.println(" Tasks availability"); | |||
| out.println("-------------------------------------------"); | |||
| doReportTasksAvailability(out); | |||
| out.println(); | |||
| out.println("-------------------------------------------"); | |||
| out.println(" org.apache.env.Which diagnostics"); | |||
| out.println("-------------------------------------------"); | |||
| doReportWhich(out); | |||
| out.println(); | |||
| out.println("-------------------------------------------"); | |||
| out.println(" System properties"); | |||
| out.println("-------------------------------------------"); | |||
| doReportSystemProperties(out); | |||
| out.println(); | |||
| } | |||
| /** | |||
| * Report a listing of system properties existing in the current vm. | |||
| * @param out the stream to print the properties to. | |||
| */ | |||
| private static void doReportSystemProperties(PrintStream out){ | |||
| for( Enumeration keys = System.getProperties().keys(); | |||
| keys.hasMoreElements(); ){ | |||
| String key = (String)keys.nextElement(); | |||
| out.println(key + " : " + System.getProperty(key)); | |||
| } | |||
| } | |||
| /** | |||
| * Report the content of ANT_HOME/lib directory | |||
| * @param out the stream to print the content to | |||
| */ | |||
| private static void doReportLibraries(PrintStream out){ | |||
| File[] libs = listLibraries(); | |||
| for (int i = 0; i < libs.length; i++){ | |||
| out.println(libs[i].getName() | |||
| + " (" + libs[i].length() + " bytes)"); | |||
| } | |||
| } | |||
| /** | |||
| * Call org.apache.env.Which if available | |||
| * @param out the stream to print the content to. | |||
| */ | |||
| private static void doReportWhich(PrintStream out){ | |||
| Throwable error = null; | |||
| try { | |||
| Class which = Class.forName("org.apache.env.Which"); | |||
| Method method = which.getMethod("main", new Class[]{ String[].class }); | |||
| method.invoke(null, new Object[]{new String[]{}}); | |||
| } catch (ClassNotFoundException e) { | |||
| out.println("Not available."); | |||
| out.println("Download it at http://xml.apache.org/commons/"); | |||
| } catch (InvocationTargetException e) { | |||
| error = e.getTargetException() == null ? e : e.getTargetException(); | |||
| } catch (Exception e) { | |||
| error = e; | |||
| } | |||
| // report error if something weird happens...this is diagnostic. | |||
| if (error != null) { | |||
| out.println("Error while running org.apache.env.Which"); | |||
| error.printStackTrace(); | |||
| } | |||
| } | |||
| /** | |||
| * Create a report about non-available tasks that are defined in the | |||
| * mapping but could not be found via lookup. It might generally happen | |||
| * because Ant requires multiple libraries to compile and one of them | |||
| * was missing when compiling Ant. | |||
| * @param out the stream to print the tasks report to | |||
| * @param is the stream defining the mapping task name/classname, can be | |||
| * <tt>null</tt> for a missing stream (ie mapping). | |||
| */ | |||
| private static void doReportTasksAvailability(PrintStream out){ | |||
| InputStream is = Main.class.getResourceAsStream("/org/apache/tools/ant/taskdefs/defaults.properties"); | |||
| if (is == null) { | |||
| out.println("None available"); | |||
| } else { | |||
| Properties props = new Properties(); | |||
| try { | |||
| props.load(is); | |||
| for (Enumeration keys = props.keys(); keys.hasMoreElements();){ | |||
| String key = (String)keys.nextElement(); | |||
| String classname = props.getProperty(key); | |||
| try { | |||
| Class.forName(classname); | |||
| props.remove(key); | |||
| } catch (ClassNotFoundException e){ | |||
| out.println(key + " : Not Available"); | |||
| } | |||
| } | |||
| if (props.size() == 0){ | |||
| out.println("All defined tasks are available"); | |||
| } | |||
| } catch (IOException e){ | |||
| out.println(e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -169,7 +169,9 @@ public class DirectoryScanner implements FileScanner, SelectorScanner { | |||
| "**/.cvsignore", | |||
| "**/SCCS", | |||
| "**/SCCS/**", | |||
| "**/vssver.scc" | |||
| "**/vssver.scc", | |||
| "**/.svn", | |||
| "**/.svn/**" | |||
| }; | |||
| /** The base directory to be scanned. */ | |||
| @@ -176,6 +176,7 @@ public class Main { | |||
| Main m = null; | |||
| try { | |||
| Diagnostics.validateVersion(); | |||
| m = new Main(args); | |||
| } catch (Throwable exc) { | |||
| printMessage(exc); | |||
| @@ -264,6 +265,9 @@ public class Main { | |||
| } else if (arg.equals("-version")) { | |||
| printVersion(); | |||
| return; | |||
| } else if (arg.equals("-diagnostics")){ | |||
| Diagnostics.doReport(System.out); | |||
| return; | |||
| } else if (arg.equals("-quiet") || arg.equals("-q")) { | |||
| msgOutputLevel = Project.MSG_WARN; | |||
| } else if (arg.equals("-verbose") || arg.equals("-v")) { | |||
| @@ -589,7 +593,7 @@ public class Main { | |||
| } | |||
| project.setUserProperty("ant.file", | |||
| buildFile.getAbsolutePath()); | |||
| buildFile.getAbsolutePath()); | |||
| ProjectHelper.configureProject(project, buildFile); | |||
| @@ -732,6 +736,8 @@ public class Main { | |||
| msg.append(" -help print this message" + lSep); | |||
| msg.append(" -projecthelp print project help information" + lSep); | |||
| msg.append(" -version print the version information and exit" + lSep); | |||
| msg.append(" -diagnostics print information that might be helpful to" + lSep); | |||
| msg.append(" diagnose or report problems." + lSep); | |||
| msg.append(" -quiet, -q be extra quiet" + lSep); | |||
| msg.append(" -verbose, -v be extra verbose" + lSep); | |||
| msg.append(" -debug print debugging information" + lSep); | |||
| @@ -785,7 +791,6 @@ public class Main { | |||
| props.load(in); | |||
| in.close(); | |||
| String lSep = System.getProperty("line.separator"); | |||
| StringBuffer msg = new StringBuffer(); | |||
| msg.append("Apache Ant version "); | |||
| msg.append(props.getProperty("VERSION")); | |||
| @@ -155,7 +155,7 @@ public class ProjectHelperImpl extends ProjectHelper { | |||
| parser.parse(inputSource); | |||
| } catch (SAXParseException exc) { | |||
| Location location = | |||
| new Location(buildFile.toString(), exc.getLineNumber(), | |||
| new Location(exc.getSystemId(), exc.getLineNumber(), | |||
| exc.getColumnNumber()); | |||
| Throwable t = exc.getException(); | |||
| @@ -452,7 +452,9 @@ public class ProjectHelperImpl extends ProjectHelper { | |||
| } | |||
| if (def == null) { | |||
| helperImpl.project.setDefaultTarget("main"); | |||
| throw new SAXParseException("The default attribute of project " | |||
| + "is required", | |||
| helperImpl.locator); | |||
| } else { | |||
| helperImpl.project.setDefaultTarget(def); | |||
| } | |||
| @@ -791,7 +793,7 @@ public class ProjectHelperImpl extends ProjectHelper { | |||
| task.setTaskName(tag); | |||
| } | |||
| task.setLocation(new Location(helperImpl.buildFile.toString(), helperImpl.locator.getLineNumber(), | |||
| task.setLocation(new Location(helperImpl.locator.getSystemId(), helperImpl.locator.getLineNumber(), | |||
| helperImpl.locator.getColumnNumber())); | |||
| helperImpl.configureId(task, attrs); | |||
| @@ -72,7 +72,7 @@ import java.util.Hashtable; | |||
| import java.util.Enumeration; | |||
| /** | |||
| * Call Ant in a sub-project. | |||
| * Build a sub-project. | |||
| * | |||
| * <pre> | |||
| * <target name="foo" depends="init"> | |||
| @@ -329,7 +329,10 @@ public class Ant extends Task { | |||
| if (dir != null) { | |||
| newProject.setBaseDir(dir); | |||
| newProject.setUserProperty("basedir" , dir.getAbsolutePath()); | |||
| if (savedDir != null) { // has been set explicitly | |||
| newProject.setInheritedProperty("basedir" , | |||
| dir.getAbsolutePath()); | |||
| } | |||
| } else { | |||
| dir = project.getBaseDir(); | |||
| } | |||
| @@ -487,7 +490,7 @@ public class Ant extends Task { | |||
| } | |||
| /** | |||
| * The directory to use as a basedir for the new Ant project. | |||
| * The directory to use as a base directory for the new Ant project. | |||
| * Defaults to the current project's basedir, unless inheritall | |||
| * has been set to false, in which case it doesn't have a default | |||
| * value. This will override the basedir setting of the called project. | |||
| @@ -59,8 +59,8 @@ import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.Task; | |||
| /** | |||
| * Task to determine the basename of a specified file, optionally minus a | |||
| * specified suffix. | |||
| * Sets a property to the base name of a specified file, optionally minus a | |||
| * suffix. | |||
| * | |||
| * This task can accept the following attributes: | |||
| * <ul> | |||
| @@ -63,7 +63,8 @@ import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| /** | |||
| * This is a basic task that can be used to track build numbers. It will first | |||
| * Read, increment, and write a build number in a file | |||
| * It will first | |||
| * attempt to read a build number from a file, then set the property | |||
| * "build.number" to the value that was read in (or 0 if no such value). Then | |||
| * it will increment the build number by one and write it back out into the | |||
| @@ -67,9 +67,7 @@ import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| /** | |||
| * CVSLogin | |||
| * | |||
| * Adds an new entry to a CVS password file | |||
| * Adds an new entry to a CVS password file. | |||
| * | |||
| * @author <a href="jeff@custommonkey.org">Jeff Martin</a> | |||
| * @version $Revision$ | |||
| @@ -136,7 +136,6 @@ public class CallTarget extends Task { | |||
| location); | |||
| } | |||
| callee.setDir(getProject().getBaseDir()); | |||
| callee.setAntfile(getProject().getProperty("ant.file")); | |||
| callee.setTarget(subTarget); | |||
| callee.setInheritAll(inheritAll); | |||
| @@ -68,7 +68,7 @@ import org.apache.tools.ant.types.PatternSet; | |||
| * Chmod equivalent for unix-like environments. | |||
| * | |||
| * @author costin@eng.sun.com | |||
| * @author Mariusz Nowostawski (Marni) | |||
| * @author Mariusz Nowostawski (Marni) | |||
| * <a href="mailto:mnowostawski@infoscience.otago.ac.nz">mnowostawski@infoscience.otago.ac.nz</a> | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * | |||
| @@ -233,29 +233,26 @@ public class Chmod extends ExecuteOn { | |||
| } | |||
| /** | |||
| * Not supported. | |||
| * @param e | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setExecutable(String e) { | |||
| throw new BuildException(taskType | |||
| throw new BuildException(taskType | |||
| + " doesn\'t support the executable attribute", location); | |||
| } | |||
| /** | |||
| * Not supported. | |||
| * @param cmdl | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setCommand(Commandline cmdl) { | |||
| throw new BuildException(taskType | |||
| throw new BuildException(taskType | |||
| + " doesn\'t support the command attribute", location); | |||
| } | |||
| /** | |||
| * Not supported. | |||
| * @param skip | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setSkipEmptyFilesets(boolean skip) { | |||
| throw new BuildException(taskType | |||
| throw new BuildException(taskType | |||
| + " doesn\'t support the skipemptyfileset attribute", location); | |||
| } | |||
| @@ -76,7 +76,7 @@ import java.util.Hashtable; | |||
| import java.util.Enumeration; | |||
| /** | |||
| * A consolidated copy task. Copies a file or directory to a new file | |||
| * Copies a file or directory to a new file | |||
| * or directory. Files are only copied if the source file is newer | |||
| * than the destination file, or when the destination file does not | |||
| * exist. It is possible to explicitly overwrite existing files.</p> | |||
| @@ -85,7 +85,7 @@ import java.util.Enumeration; | |||
| * document, the following mailing list discussions, and the | |||
| * copyfile/copydir tasks.</p> | |||
| * | |||
| * @author Glenn McAllister | |||
| * @author Glenn McAllister | |||
| * <a href="mailto:glennm@ca.ibm.com">glennm@ca.ibm.com</a> | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * @author <A href="gholam@xtra.co.nz">Michael McCallum</A> | |||
| @@ -122,7 +122,7 @@ public class Copy extends Task { | |||
| private String encoding = null; | |||
| /** | |||
| * Copy task constructor. | |||
| * Copy task constructor. | |||
| */ | |||
| public Copy() { | |||
| fileUtils = FileUtils.newFileUtils(); | |||
| @@ -316,12 +316,12 @@ public class Copy extends Task { | |||
| // will be removed in validateAttributes | |||
| savedFileSet = (FileSet) filesets.elementAt(0); | |||
| } | |||
| // make sure we don't have an illegal set of options | |||
| validateAttributes(); | |||
| try { | |||
| // deal with the single file | |||
| if (file != null) { | |||
| if (file.exists()) { | |||
| @@ -331,10 +331,10 @@ public class Copy extends Task { | |||
| if (forceOverwrite || | |||
| (file.lastModified() > destFile.lastModified())) { | |||
| fileCopyMap.put(file.getAbsolutePath(), | |||
| fileCopyMap.put(file.getAbsolutePath(), | |||
| destFile.getAbsolutePath()); | |||
| } else { | |||
| log(file + " omitted as " + destFile | |||
| log(file + " omitted as " + destFile | |||
| + " is up to date.", Project.MSG_VERBOSE); | |||
| } | |||
| } else { | |||
| @@ -353,7 +353,7 @@ public class Copy extends Task { | |||
| FileSet fs = (FileSet) filesets.elementAt(i); | |||
| DirectoryScanner ds = fs.getDirectoryScanner(project); | |||
| File fromDir = fs.getDir(project); | |||
| String[] srcFiles = ds.getIncludedFiles(); | |||
| String[] srcDirs = ds.getIncludedDirectories(); | |||
| boolean isEverythingIncluded = ds.isEverythingIncluded(); | |||
| @@ -363,7 +363,7 @@ public class Copy extends Task { | |||
| } | |||
| scan(fromDir, destDir, srcFiles, srcDirs); | |||
| } | |||
| // do all the copy operations now... | |||
| doFileOperations(); | |||
| } finally { | |||
| @@ -447,7 +447,7 @@ public class Copy extends Task { | |||
| * Compares source files to destination files to see if they should be | |||
| * copied. | |||
| */ | |||
| protected void scan(File fromDir, File toDir, String[] files, | |||
| protected void scan(File fromDir, File toDir, String[] files, | |||
| String[] dirs) { | |||
| FileNameMapper mapper = null; | |||
| if (mapperElement != null) { | |||
| @@ -496,8 +496,8 @@ public class Copy extends Task { | |||
| */ | |||
| protected void doFileOperations() { | |||
| if (fileCopyMap.size() > 0) { | |||
| log("Copying " + fileCopyMap.size() | |||
| + " file" + (fileCopyMap.size() == 1 ? "" : "s") | |||
| log("Copying " + fileCopyMap.size() | |||
| + " file" + (fileCopyMap.size() == 1 ? "" : "s") | |||
| + " to " + destDir.getAbsolutePath()); | |||
| Enumeration e = fileCopyMap.keys(); | |||
| @@ -513,20 +513,20 @@ public class Copy extends Task { | |||
| try { | |||
| log("Copying " + fromFile + " to " + toFile, verbosity); | |||
| FilterSetCollection executionFilters = | |||
| FilterSetCollection executionFilters = | |||
| new FilterSetCollection(); | |||
| if (filtering) { | |||
| executionFilters | |||
| .addFilterSet(project.getGlobalFilterSet()); | |||
| } | |||
| for (Enumeration filterEnum = filterSets.elements(); | |||
| for (Enumeration filterEnum = filterSets.elements(); | |||
| filterEnum.hasMoreElements();) { | |||
| executionFilters | |||
| .addFilterSet((FilterSet) filterEnum.nextElement()); | |||
| } | |||
| fileUtils.copyFile(fromFile, toFile, executionFilters, | |||
| filterChains, forceOverwrite, | |||
| preserveLastModified, encoding, | |||
| fileUtils.copyFile(fromFile, toFile, executionFilters, | |||
| filterChains, forceOverwrite, | |||
| preserveLastModified, encoding, | |||
| project); | |||
| } catch (IOException ioe) { | |||
| String msg = "Failed to copy " + fromFile + " to " + toFile | |||
| @@ -543,7 +543,7 @@ public class Copy extends Task { | |||
| File d = new File((String) e.nextElement()); | |||
| if (!d.exists()) { | |||
| if (!d.mkdirs()) { | |||
| log("Unable to create directory " | |||
| log("Unable to create directory " | |||
| + d.getAbsolutePath(), Project.MSG_ERR); | |||
| } else { | |||
| count++; | |||
| @@ -66,7 +66,7 @@ import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.FileList; | |||
| /** | |||
| * A Task to record explicit dependencies. If any of the target files | |||
| * Examines and removes out of date target files. If any of the target files | |||
| * are out of date with respect to any of the source files, all target | |||
| * files are removed. This is useful where dependencies cannot be | |||
| * computed (for example, dynamically interpreted parameters or files | |||
| @@ -60,7 +60,7 @@ import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.Task; | |||
| /** | |||
| * Task to determine the directory name of the specified file. | |||
| * Determines the directory name of the specified file. | |||
| * | |||
| * This task can accept the following attributes: | |||
| * <ul> | |||
| @@ -63,7 +63,7 @@ import java.io.File; | |||
| import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| /** | |||
| * Echo | |||
| * Writes a message to the Ant logging facilities. | |||
| * | |||
| * @author costin@dnt.ro | |||
| * | |||
| @@ -99,9 +99,9 @@ public class ExecTask extends Task { | |||
| private boolean failIfExecFails = true; | |||
| private boolean append = false; | |||
| /** | |||
| /** | |||
| * Controls whether the VM (1.3 and above) is used to execute the | |||
| * command | |||
| * command | |||
| */ | |||
| private boolean vmLauncher = true; | |||
| @@ -147,8 +147,7 @@ public class ExecTask extends Task { | |||
| } | |||
| /** | |||
| * Deprecated, use executable instead. | |||
| * The full commandline to execute, executable + arguments. | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setCommand(Commandline cmdl) { | |||
| log("The command attribute is deprecated. " + | |||
| @@ -209,9 +208,9 @@ public class ExecTask extends Task { | |||
| public void setResultProperty(String resultProperty) { | |||
| this.resultProperty = resultProperty; | |||
| } | |||
| /** | |||
| * helper method to set result property to the | |||
| * helper method to set result property to the | |||
| * passed in value if appropriate | |||
| */ | |||
| protected void maybeSetResultPropertyValue(int result) { | |||
| @@ -220,16 +219,16 @@ public class ExecTask extends Task { | |||
| project.setNewProperty(resultProperty, res); | |||
| } | |||
| } | |||
| /** | |||
| * Stop the build if program cannot be started. Defaults to true. | |||
| * | |||
| * @since Ant 1.5 | |||
| * @since Ant 1.5 | |||
| */ | |||
| public void setFailIfExecutionFails(boolean flag) { | |||
| failIfExecFails = flag; | |||
| } | |||
| /** | |||
| * Whether output should be appended to or overwrite an existing file. | |||
| * Defaults to false. | |||
| @@ -281,7 +280,7 @@ public class ExecTask extends Task { | |||
| log("Current OS is " + myos, Project.MSG_VERBOSE); | |||
| if ((os != null) && (os.indexOf(myos) < 0)){ | |||
| // this command will be executed only on the specified OS | |||
| log("This OS, " + myos | |||
| log("This OS, " + myos | |||
| + " was not found in the specified list of valid OSes: " + os, | |||
| Project.MSG_VERBOSE); | |||
| return false; | |||
| @@ -330,7 +329,7 @@ public class ExecTask extends Task { | |||
| err = exe.execute(); | |||
| //test for and handle a forced process death | |||
| if (exe.killedProcess()) { | |||
| log("Timeout: killed the sub-process", Project.MSG_WARN); | |||
| log("Timeout: killed the sub-process", Project.MSG_WARN); | |||
| } | |||
| maybeSetResultPropertyValue(err); | |||
| if (err != 0) { | |||
| @@ -390,10 +389,10 @@ public class ExecTask extends Task { | |||
| log("Output redirected to " + out, Project.MSG_VERBOSE); | |||
| return new PumpStreamHandler(fos); | |||
| } catch (FileNotFoundException fne) { | |||
| throw new BuildException("Cannot write to " + out, fne, | |||
| throw new BuildException("Cannot write to " + out, fne, | |||
| location); | |||
| } catch (IOException ioe) { | |||
| throw new BuildException("Cannot write to " + out, ioe, | |||
| throw new BuildException("Cannot write to " + out, ioe, | |||
| location); | |||
| } | |||
| } else if (outputprop != null) { | |||
| @@ -184,6 +184,10 @@ public class ExecuteOn extends ExecTask { | |||
| return mapperElement; | |||
| } | |||
| /** | |||
| * @todo using taskName here is brittle, as a user could override it. | |||
| * this should probably be modified to use the classname instead. | |||
| */ | |||
| protected void checkConfiguration() { | |||
| if ("execon".equals(taskName)) { | |||
| log("!! execon is deprecated. Use apply instead. !!"); | |||
| @@ -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 The Apache Software Foundation. All rights | |||
| * reserved. | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without | |||
| @@ -59,7 +59,7 @@ import org.apache.tools.ant.BuildException; | |||
| /** | |||
| * Exit the active build, giving an additional message | |||
| * Exits the active build, giving an additional message | |||
| * if available. | |||
| * | |||
| * @author <a href="mailto:nico@seessle.de">Nico Seessle</a> | |||
| @@ -68,7 +68,7 @@ import org.apache.tools.ant.BuildException; | |||
| * | |||
| * @ant.task name="fail" category="control" | |||
| */ | |||
| public class Exit extends Task { | |||
| public class Exit extends Task { | |||
| private String message; | |||
| private String ifCondition, unlessCondition; | |||
| @@ -100,7 +100,7 @@ public class Exit extends Task { | |||
| public void execute() throws BuildException { | |||
| if (testIfCondition() && testUnlessCondition()) { | |||
| if (message != null && message.length() > 0) { | |||
| if (message != null && message.length() > 0) { | |||
| throw new BuildException(message); | |||
| } else { | |||
| throw new BuildException("No message"); | |||
| @@ -122,7 +122,7 @@ public class Exit extends Task { | |||
| if (ifCondition == null || "".equals(ifCondition)) { | |||
| return true; | |||
| } | |||
| return project.getProperty(ifCondition) != null; | |||
| } | |||
| @@ -61,11 +61,11 @@ import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.Project; | |||
| /** | |||
| * Sets a token filter that is used by the file copy methods | |||
| * of the project to do token substitution, or sets mutiple tokens by | |||
| * Sets a token filter that is used by the file copy tasks | |||
| * to do token substitution. Sets mutiple tokens by | |||
| * reading these from a file. | |||
| * | |||
| * @author Stefano Mazzocchi | |||
| * @author Stefano Mazzocchi | |||
| * <a href="mailto:stefano@apache.org">stefano@apache.org</a> | |||
| * @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a> | |||
| * @author <A href="gholam@xtra.co.nz">Michael McCallum</A> | |||
| @@ -107,26 +107,26 @@ public class Filter extends Task { | |||
| } | |||
| public void execute() throws BuildException { | |||
| boolean isFiltersFromFile = | |||
| boolean isFiltersFromFile = | |||
| filtersFile != null && token == null && value == null; | |||
| boolean isSingleFilter = | |||
| boolean isSingleFilter = | |||
| filtersFile == null && token != null && value != null; | |||
| if (!isFiltersFromFile && !isSingleFilter) { | |||
| throw new BuildException("both token and value parameters, or " | |||
| + "only a filtersFile parameter is " | |||
| + "required", location); | |||
| } | |||
| if (isSingleFilter) { | |||
| project.getGlobalFilterSet().addFilter(token, value); | |||
| } | |||
| if (isFiltersFromFile) { | |||
| readFilters(); | |||
| } | |||
| } | |||
| protected void readFilters() throws BuildException { | |||
| log("Reading filters from " + filtersFile, Project.MSG_VERBOSE); | |||
| project.getGlobalFilterSet().readFiltersFromFile(filtersFile); | |||
| @@ -449,7 +449,7 @@ public class FixCRLF extends MatchingTask { | |||
| break; | |||
| case IN_MULTI_COMMENT: | |||
| endComment | |||
| endComment | |||
| = lineString.indexOf("*/", line.getNext()); | |||
| if (endComment >= 0) { | |||
| // End of multiLineComment on this line | |||
| @@ -486,7 +486,7 @@ public class FixCRLF extends MatchingTask { | |||
| if (line.getNextCharInc() == '\t') { | |||
| line.setColumn(line.getColumn() + | |||
| tablength - | |||
| (line.getColumn() | |||
| (line.getColumn() | |||
| % tablength)); | |||
| } else { | |||
| line.incColumn(); | |||
| @@ -495,7 +495,7 @@ public class FixCRLF extends MatchingTask { | |||
| // Now output the substring | |||
| try { | |||
| outWriter.write(line.substring(begin, | |||
| outWriter.write(line.substring(begin, | |||
| line.getNext())); | |||
| } catch (IOException e) { | |||
| throw new BuildException(e); | |||
| @@ -547,7 +547,7 @@ public class FixCRLF extends MatchingTask { | |||
| lines.close(); | |||
| lines = null; | |||
| } catch (IOException e) { | |||
| throw new BuildException("Unable to close source file " | |||
| throw new BuildException("Unable to close source file " | |||
| + srcFile); | |||
| } | |||
| @@ -69,7 +69,7 @@ import org.apache.tools.ant.util.FileUtils; | |||
| import org.apache.tools.ant.util.JavaEnvUtils; | |||
| /** | |||
| * Get a particular file from a URL source. | |||
| * Gets a particular file from a URL source. | |||
| * Options include verbose reporting, timestamp based fetches and controlling | |||
| * actions on failures. NB: access through a firewall only works if the whole | |||
| * Java runtime is correctly configured. | |||
| @@ -83,7 +83,7 @@ import java.sql.Statement; | |||
| import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.taskdefs.JDBCTask; | |||
| public class SQLExampleTask extends JDBCTask { | |||
| public class SQLExampleTask extends JDBCTask { | |||
| private String tableName; | |||
| @@ -93,7 +93,7 @@ public class SQLExampleTask extends JDBCTask { | |||
| try { | |||
| if (tableName == null ) { | |||
| throw new BuildException("TableName must be specified",location); | |||
| } | |||
| } | |||
| String sql = "SELECT * FROM "+tableName; | |||
| stmt= conn.createStatement(); | |||
| ResultSet rs = stmt.executeQuery(sql); | |||
| @@ -101,7 +101,7 @@ public class SQLExampleTask extends JDBCTask { | |||
| log(rs.getObject(1).toString()); | |||
| } | |||
| } catch (SQLException e) { | |||
| } finally { | |||
| if (stmt != null) { | |||
| try {stmt.close();}catch (SQLException ingore){} | |||
| @@ -117,7 +117,7 @@ public class SQLExampleTask extends JDBCTask { | |||
| } | |||
| </pre></code> | |||
| @@ -182,7 +182,7 @@ public abstract class JDBCTask extends Task { | |||
| private String version = null; | |||
| /** | |||
| * Sets the classpath. | |||
| * Sets the classpath for loading the driver. | |||
| * @param classpath The classpath to set | |||
| */ | |||
| public void setClasspath(Path classpath) { | |||
| @@ -200,7 +200,7 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Add the classpath for loading the driver; | |||
| * Add a path to the classpath for loading the driver. | |||
| */ | |||
| public Path createClasspath() { | |||
| if (this.classpath == null) { | |||
| @@ -210,7 +210,7 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Set the classpath for loading the driver | |||
| * Set the classpath for loading the driver | |||
| * using the classpath reference. | |||
| */ | |||
| public void setClasspathRef(Reference r) { | |||
| @@ -218,7 +218,7 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Class name of the jdbc driver; required. | |||
| * Class name of the JDBC driver; required. | |||
| * @param driver The driver to set | |||
| */ | |||
| public void setDriver(String driver) { | |||
| @@ -226,20 +226,13 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Sets the database connection url; required. | |||
| * Sets the database connection URL; required. | |||
| * @param url The url to set | |||
| */ | |||
| public void setUrl(String url) { | |||
| this.url = url; | |||
| } | |||
| /** | |||
| * Set the user name for the connection; required. | |||
| */ | |||
| public void setUserid(String userId) { | |||
| this.userId = userId; | |||
| } | |||
| /** | |||
| * Sets the password; required. | |||
| * @param password The password to set | |||
| @@ -258,7 +251,7 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Execute task only if the lower case product name | |||
| * Execute task only if the lower case product name | |||
| * of the DB matches this | |||
| * @param rdbms The rdbms to set | |||
| */ | |||
| @@ -267,7 +260,7 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Sets the version string, execute task only if | |||
| * Sets the version string, execute task only if | |||
| * rdbms version match; optional. | |||
| * @param version The version to set | |||
| */ | |||
| @@ -460,10 +453,10 @@ public abstract class JDBCTask extends Task { | |||
| } | |||
| /** | |||
| * Sets the userId. | |||
| * Set the user name for the connection; required. | |||
| * @param userId The userId to set | |||
| */ | |||
| public void setUserId(String userId) { | |||
| public void setUserid(String userId) { | |||
| this.userId = userId; | |||
| } | |||
| @@ -137,9 +137,7 @@ public class Jar extends Zip { | |||
| } | |||
| /** | |||
| * Not supported. | |||
| * | |||
| * @param we | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setWhenempty(WhenEmpty we) { | |||
| log("JARs are never empty, they contain at least a manifest file", | |||
| @@ -246,10 +244,12 @@ public class Jar extends Zip { | |||
| * | |||
| * @param config setting for found manifest behavior. | |||
| */ | |||
| /* | |||
| public void setFilesetmanifest(FilesetManifestConfig config) { | |||
| filesetManifestConfig = config; | |||
| mergeManifestsMain = "merge".equals(config.getValue()); | |||
| } | |||
| */ | |||
| /** | |||
| * Adds a zipfileset to include in the META-INF directory. | |||
| @@ -439,7 +439,13 @@ public class Jar extends Zip { | |||
| Project.MSG_VERBOSE); | |||
| try { | |||
| Manifest newManifest = getManifest(new InputStreamReader(is)); | |||
| Manifest newManifest = null; | |||
| if (is != null) { | |||
| newManifest = getManifest(new InputStreamReader(is)); | |||
| } else { | |||
| newManifest = getManifest(file); | |||
| } | |||
| if (filesetManifest == null) { | |||
| filesetManifest = newManifest; | |||
| } else { | |||
| @@ -72,7 +72,7 @@ import java.io.IOException; | |||
| import java.util.Vector; | |||
| /** | |||
| * This task acts as a loader for java applications but allows to use | |||
| * Launcher for Java applications. Allows use of | |||
| * the same JVM for the called application thus resulting in much | |||
| * faster operation. | |||
| * | |||
| @@ -231,6 +231,7 @@ public class Java extends Task { | |||
| /** | |||
| * Deprecated: use nested arg instead. | |||
| * Set the command line arguments for the class. | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setArgs(String s) { | |||
| log("The args attribute is deprecated. " + | |||
| @@ -97,7 +97,7 @@ import java.io.File; | |||
| * compile decision based on timestamp. | |||
| * | |||
| * @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a> | |||
| * @author Robin Green | |||
| * @author Robin Green | |||
| * <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a> | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * @author <a href="mailto:jayglanville@home.com">J D Glanville</a> | |||
| @@ -198,7 +198,7 @@ public class Javac extends MatchingTask { | |||
| * | |||
| * If you use this attribute together with jikes, you must | |||
| * make sure that your version of jikes supports the -source switch. | |||
| * Legal values are 1.3 and 1.4 – by default, no -source argument | |||
| * Legal values are 1.3 and 1.4 - by default, no -source argument | |||
| * will be used at all. | |||
| * | |||
| * @param v Value to assign to source. | |||
| @@ -220,7 +220,7 @@ public class Javac extends MatchingTask { | |||
| } | |||
| /** | |||
| * Recreate src | |||
| * Recreate src. | |||
| * | |||
| * @return a nested src element. | |||
| */ | |||
| @@ -296,7 +296,7 @@ public class Javac extends MatchingTask { | |||
| /** | |||
| * Set the classpath to be used for this compilation. | |||
| * | |||
| * | |||
| * @param classpath an Ant Path object containing the compilation classpath. | |||
| */ | |||
| public void setClasspath(Path classpath) { | |||
| @@ -417,8 +417,7 @@ public class Javac extends MatchingTask { | |||
| } | |||
| /** | |||
| * Proceed if compilation fails, but use | |||
| * failonerror instead. | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setProceed(boolean proceed) { | |||
| failOnError = !proceed; | |||
| @@ -654,7 +653,7 @@ public class Javac extends MatchingTask { | |||
| facade.setImplementation(chosen); | |||
| } | |||
| } | |||
| /** | |||
| * Executes the task. | |||
| @@ -669,8 +668,8 @@ public class Javac extends MatchingTask { | |||
| for (int i = 0; i < list.length; i++) { | |||
| File srcDir = project.resolveFile(list[i]); | |||
| if (!srcDir.exists()) { | |||
| throw new BuildException("srcdir \"" | |||
| + srcDir.getPath() | |||
| throw new BuildException("srcdir \"" | |||
| + srcDir.getPath() | |||
| + "\" does not exist!", location); | |||
| } | |||
| @@ -748,9 +747,9 @@ public class Javac extends MatchingTask { | |||
| * <p>If fork has been set to true, the result will be extJavac | |||
| * and not classic or java1.2 - no matter what the compiler | |||
| * attribute looks like.</p> | |||
| * | |||
| * | |||
| * @see #getCompilerVersion | |||
| * | |||
| * | |||
| * @since Ant 1.5 | |||
| */ | |||
| public String getCompiler() { | |||
| @@ -776,7 +775,7 @@ public class Javac extends MatchingTask { | |||
| * | |||
| * <p>This method does not take the fork attribute into | |||
| * account.</p> | |||
| * | |||
| * | |||
| * @see #getCompiler | |||
| * | |||
| * @since Ant 1.5 | |||
| @@ -794,17 +793,17 @@ public class Javac extends MatchingTask { | |||
| */ | |||
| protected void checkParameters() throws BuildException { | |||
| if (src == null) { | |||
| throw new BuildException("srcdir attribute must be set!", | |||
| throw new BuildException("srcdir attribute must be set!", | |||
| location); | |||
| } | |||
| if (src.size() == 0) { | |||
| throw new BuildException("srcdir attribute must be set!", | |||
| throw new BuildException("srcdir attribute must be set!", | |||
| location); | |||
| } | |||
| if (destDir != null && !destDir.isDirectory()) { | |||
| throw new BuildException("destination directory \"" | |||
| + destDir | |||
| throw new BuildException("destination directory \"" | |||
| + destDir | |||
| + "\" does not exist " | |||
| + "or is not a directory", location); | |||
| } | |||
| @@ -831,7 +830,7 @@ public class Javac extends MatchingTask { | |||
| } | |||
| } | |||
| CompilerAdapter adapter = | |||
| CompilerAdapter adapter = | |||
| CompilerAdapterFactory.getCompiler(compilerImpl, this); | |||
| // now we need to populate the compiler adapter | |||
| @@ -853,7 +852,7 @@ public class Javac extends MatchingTask { | |||
| * filter command line attributes based on the current | |||
| * implementation. | |||
| */ | |||
| public class ImplementationSpecificArgument extends | |||
| public class ImplementationSpecificArgument extends | |||
| org.apache.tools.ant.util.facade.ImplementationSpecificArgument { | |||
| public void setCompiler(String impl) { | |||
| @@ -1654,7 +1654,6 @@ public class Javadoc extends Task { | |||
| } | |||
| } | |||
| if (la.isLinkOffline()) { | |||
| File packageListLocation = la.getPackagelistLoc(); | |||
| if (packageListLocation == null) { | |||
| @@ -58,9 +58,6 @@ import java.util.Vector; | |||
| import java.util.Hashtable; | |||
| import java.util.Enumeration; | |||
| import java.io.BufferedReader; | |||
| import java.io.File; | |||
| import java.io.FileReader; | |||
| import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.io.InputStreamReader; | |||
| @@ -70,16 +67,11 @@ import java.io.StringWriter; | |||
| import java.io.UnsupportedEncodingException; | |||
| import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.util.CollectionUtils; | |||
| /** | |||
| * Holds the data of a jar manifest. | |||
| * | |||
| * Creates a manifest file for inclusion in a JAR. | |||
| * This task can be used to write a Manifest file, optionally | |||
| * replacing or updating an existing file. | |||
| * Manifests are processed according to the | |||
| * {@link <a href="http://java.sun.com/j2se/1.4/docs/guide/jar/jar.html">Jar | |||
| * file specification.</a>}. | |||
| @@ -89,16 +81,13 @@ import org.apache.tools.ant.util.CollectionUtils; | |||
| * greater than 72 bytes being wrapped and continued on the next | |||
| * line. If an application can not handle the continuation mechanism, it | |||
| * is a defect in the application, not this task. | |||
| * @author Conor MacNeill | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * @author <a href="mailto:j_a_fernandez@yahoo.com">Jose Alberto Fernandez</a> | |||
| * | |||
| * @since Ant 1.4 | |||
| * | |||
| * @ant.task category="java" | |||
| */ | |||
| public class Manifest extends Task { | |||
| public class Manifest { | |||
| /** The standard manifest version header */ | |||
| public static final String ATTRIBUTE_MANIFEST_VERSION | |||
| = "Manifest-Version"; | |||
| @@ -131,20 +120,6 @@ public class Manifest extends Task { | |||
| /** The End-Of-Line marker in manifests */ | |||
| public static final String EOL = "\r\n"; | |||
| /** | |||
| * Helper class for Manifest's mode attribute. | |||
| */ | |||
| public static class Mode extends EnumeratedAttribute { | |||
| /** | |||
| * Get Allowed values for the mode attribute. | |||
| * | |||
| * @return a String array of the allowed values. | |||
| */ | |||
| public String[] getValues() { | |||
| return new String[] {"update", "replace"}; | |||
| } | |||
| } | |||
| /** | |||
| * An attribute for the manifest. | |||
| * Those attributes that are not nested into a section will be added to the "Main" section. | |||
| @@ -704,7 +679,7 @@ public class Manifest extends Task { | |||
| Section rhsSection = (Section) rhs; | |||
| return attributes.equals(rhsSection.attributes); | |||
| return CollectionUtils.equals(attributes, rhsSection.attributes); | |||
| } | |||
| } | |||
| @@ -721,16 +696,6 @@ public class Manifest extends Task { | |||
| /** Index of sections - used to retain order of sections in manifest */ | |||
| private Vector sectionIndex = new Vector(); | |||
| /** | |||
| * The file to which the manifest should be written when used as a task | |||
| */ | |||
| private File manifestFile; | |||
| /** | |||
| * The mode with which the manifest file is written | |||
| */ | |||
| private Mode mode; | |||
| /** | |||
| * Construct a manifest from Ant's default manifest file. | |||
| * | |||
| @@ -760,8 +725,6 @@ public class Manifest extends Task { | |||
| /** Construct an empty manifest */ | |||
| public Manifest() { | |||
| mode = new Mode(); | |||
| mode.setValue("replace"); | |||
| manifestVersion = null; | |||
| } | |||
| @@ -843,7 +806,14 @@ public class Manifest extends Task { | |||
| */ | |||
| public void addConfiguredAttribute(Attribute attribute) | |||
| throws ManifestException { | |||
| mainSection.addConfiguredAttribute(attribute); | |||
| if (attribute.getKey() == null || attribute.getValue() == null) { | |||
| throw new BuildException("Attributes must have name and value"); | |||
| } | |||
| if (attribute.getKey().equalsIgnoreCase(ATTRIBUTE_MANIFEST_VERSION)) { | |||
| manifestVersion = attribute.getValue(); | |||
| } else { | |||
| mainSection.addConfiguredAttribute(attribute); | |||
| } | |||
| } | |||
| /** | |||
| @@ -1017,24 +987,7 @@ public class Manifest extends Task { | |||
| return false; | |||
| } | |||
| return sections.equals(rhsManifest.sections); | |||
| } | |||
| /** | |||
| * The name of the manifest file to create/update. | |||
| * Required if used as a task. | |||
| * @param f the Manifest file to be written | |||
| */ | |||
| public void setFile(File f) { | |||
| manifestFile = f; | |||
| } | |||
| /** | |||
| * Update policy: either "update" or "replace"; default is "replace". | |||
| * @param m the mode value - update or replace. | |||
| */ | |||
| public void setMode(Mode m) { | |||
| mode = m; | |||
| return CollectionUtils.equals(sections, rhsManifest.sections); | |||
| } | |||
| /** | |||
| @@ -1074,73 +1027,4 @@ public class Manifest extends Task { | |||
| public Enumeration getSectionNames() { | |||
| return sectionIndex.elements(); | |||
| } | |||
| /** | |||
| * Create or update the Manifest when used as a task. | |||
| * | |||
| * @throws BuildException if the manifest cannot be written. | |||
| */ | |||
| public void execute() throws BuildException { | |||
| if (manifestFile == null) { | |||
| throw new BuildException("the file attribute is required"); | |||
| } | |||
| Manifest toWrite = getDefaultManifest(); | |||
| Manifest current = null; | |||
| BuildException error = null; | |||
| if (manifestFile.exists()) { | |||
| FileReader f = null; | |||
| try { | |||
| f = new FileReader(manifestFile); | |||
| current = new Manifest(f); | |||
| } catch (ManifestException m) { | |||
| error = new BuildException("Existing manifest " + manifestFile | |||
| + " is invalid", m, location); | |||
| } catch (IOException e) { | |||
| error = new BuildException("Failed to read " + manifestFile, | |||
| e, location); | |||
| } finally { | |||
| if (f != null) { | |||
| try { | |||
| f.close(); | |||
| } catch (IOException e) {} | |||
| } | |||
| } | |||
| } | |||
| try { | |||
| if (mode.getValue().equals("update") && manifestFile.exists()) { | |||
| if (current != null) { | |||
| toWrite.merge(current); | |||
| } else if (error != null) { | |||
| throw error; | |||
| } | |||
| } | |||
| toWrite.merge(this); | |||
| } catch (ManifestException m) { | |||
| throw new BuildException("Manifest is invalid", m, location); | |||
| } | |||
| if (toWrite.equals(current)) { | |||
| log("Manifest has not changed, do not recreate", | |||
| Project.MSG_VERBOSE); | |||
| return; | |||
| } | |||
| PrintWriter w = null; | |||
| try { | |||
| w = new PrintWriter(new FileWriter(manifestFile)); | |||
| toWrite.write(w); | |||
| } catch (IOException e) { | |||
| throw new BuildException("Failed to write " + manifestFile, | |||
| e, location); | |||
| } finally { | |||
| if (w != null) { | |||
| w.close(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,226 @@ | |||
| /* | |||
| * The Apache Software License, Version 1.1 | |||
| * | |||
| * Copyright (c) 2002 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 "The Jakarta Project", "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 apache@apache.org. | |||
| * | |||
| * 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.BuildException; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import java.io.File; | |||
| import java.io.FileReader; | |||
| import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| import java.io.PrintWriter; | |||
| /** | |||
| * Creates a manifest file for inclusion in a JAR, Ant task wrapper | |||
| * around {@link Manifest Manifest}. This task can be used to write a | |||
| * Manifest file, optionally replacing or updating an existing file. | |||
| * | |||
| * @author Conor MacNeill | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * @author <a href="mailto:j_a_fernandez@yahoo.com">Jose Alberto Fernandez</a> | |||
| * | |||
| * @since Ant 1.5 | |||
| * | |||
| * @ant.task category="java" | |||
| */ | |||
| public class ManifestTask extends Task { | |||
| /** | |||
| * Holds the real data. | |||
| */ | |||
| private Manifest nestedManifest = new Manifest(); | |||
| /** | |||
| * The file to which the manifest should be written when used as a task | |||
| */ | |||
| private File manifestFile; | |||
| /** | |||
| * The mode with which the manifest file is written | |||
| */ | |||
| private Mode mode; | |||
| /** | |||
| * Helper class for Manifest's mode attribute. | |||
| */ | |||
| public static class Mode extends EnumeratedAttribute { | |||
| /** | |||
| * Get Allowed values for the mode attribute. | |||
| * | |||
| * @return a String array of the allowed values. | |||
| */ | |||
| public String[] getValues() { | |||
| return new String[] {"update", "replace"}; | |||
| } | |||
| } | |||
| public ManifestTask() { | |||
| mode = new Mode(); | |||
| mode.setValue("replace"); | |||
| } | |||
| /** | |||
| * Add a section to the manifest | |||
| * | |||
| * @param section the manifest section to be added | |||
| * | |||
| * @exception ManifestException if the secti0on is not valid. | |||
| */ | |||
| public void addConfiguredSection(Manifest.Section section) | |||
| throws ManifestException { | |||
| nestedManifest.addConfiguredSection(section); | |||
| } | |||
| /** | |||
| * Add an attribute to the manifest - it is added to the main section. | |||
| * | |||
| * @param attribute the attribute to be added. | |||
| * | |||
| * @exception ManifestException if the attribute is not valid. | |||
| */ | |||
| public void addConfiguredAttribute(Manifest.Attribute attribute) | |||
| throws ManifestException { | |||
| nestedManifest.addConfiguredAttribute(attribute); | |||
| } | |||
| /** | |||
| * The name of the manifest file to create/update. | |||
| * Required if used as a task. | |||
| * @param f the Manifest file to be written | |||
| */ | |||
| public void setFile(File f) { | |||
| manifestFile = f; | |||
| } | |||
| /** | |||
| * Update policy: either "update" or "replace"; default is "replace". | |||
| * @param m the mode value - update or replace. | |||
| */ | |||
| public void setMode(Mode m) { | |||
| mode = m; | |||
| } | |||
| /** | |||
| * Create or update the Manifest when used as a task. | |||
| * | |||
| * @throws BuildException if the manifest cannot be written. | |||
| */ | |||
| public void execute() throws BuildException { | |||
| if (manifestFile == null) { | |||
| throw new BuildException("the file attribute is required"); | |||
| } | |||
| Manifest toWrite = Manifest.getDefaultManifest(); | |||
| Manifest current = null; | |||
| BuildException error = null; | |||
| if (manifestFile.exists()) { | |||
| FileReader f = null; | |||
| try { | |||
| f = new FileReader(manifestFile); | |||
| current = new Manifest(f); | |||
| } catch (ManifestException m) { | |||
| error = new BuildException("Existing manifest " + manifestFile | |||
| + " is invalid", m, location); | |||
| } catch (IOException e) { | |||
| error = new BuildException("Failed to read " + manifestFile, | |||
| e, location); | |||
| } finally { | |||
| if (f != null) { | |||
| try { | |||
| f.close(); | |||
| } catch (IOException e) {} | |||
| } | |||
| } | |||
| } | |||
| try { | |||
| if (mode.getValue().equals("update") && manifestFile.exists()) { | |||
| if (current != null) { | |||
| toWrite.merge(current); | |||
| } else if (error != null) { | |||
| throw error; | |||
| } | |||
| } | |||
| toWrite.merge(nestedManifest); | |||
| } catch (ManifestException m) { | |||
| throw new BuildException("Manifest is invalid", m, location); | |||
| } | |||
| if (toWrite.equals(current)) { | |||
| log("Manifest has not changed, do not recreate", | |||
| Project.MSG_VERBOSE); | |||
| return; | |||
| } | |||
| PrintWriter w = null; | |||
| try { | |||
| w = new PrintWriter(new FileWriter(manifestFile)); | |||
| toWrite.write(w); | |||
| } catch (IOException e) { | |||
| throw new BuildException("Failed to write " + manifestFile, | |||
| e, location); | |||
| } finally { | |||
| if (w != null) { | |||
| w.close(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -66,12 +66,12 @@ import java.util.StringTokenizer; | |||
| import java.util.Enumeration; | |||
| /** | |||
| * This is an abstract task that should be used by all those tasks that | |||
| * This is an abstract task that should be used by all those tasks that | |||
| * require to include or exclude files based on pattern matching. | |||
| * | |||
| * @author Arnout J. Kuiper | |||
| * <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a> | |||
| * @author Stefano Mazzocchi | |||
| * @author Arnout J. Kuiper | |||
| * <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a> | |||
| * @author Stefano Mazzocchi | |||
| * <a href="mailto:stefano@apache.org">stefano@apache.org</a> | |||
| * @author Sam Ruby <a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a> | |||
| * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a> | |||
| @@ -99,14 +99,14 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||
| public PatternSet.NameEntry createInclude() { | |||
| return fileset.createInclude(); | |||
| } | |||
| /** | |||
| * add a name entry on the include files list | |||
| */ | |||
| public PatternSet.NameEntry createIncludesFile() { | |||
| return fileset.createIncludesFile(); | |||
| } | |||
| /** | |||
| * add a name entry on the exclude list | |||
| */ | |||
| @@ -120,7 +120,7 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||
| public PatternSet.NameEntry createExcludesFile() { | |||
| return fileset.createExcludesFile(); | |||
| } | |||
| /** | |||
| * add a set of patterns | |||
| */ | |||
| @@ -149,7 +149,7 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||
| log("The items attribute is deprecated. " + | |||
| "Please use the includes attribute.", | |||
| Project.MSG_WARN); | |||
| if (itemString == null || itemString.equals("*") | |||
| if (itemString == null || itemString.equals("*") | |||
| || itemString.equals(".")) { | |||
| createInclude().setName("**"); | |||
| } else { | |||
| @@ -162,7 +162,7 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| * Sets the set of exclude patterns. Patterns may be separated by a comma | |||
| * or a space. | |||
| @@ -174,7 +174,7 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||
| } | |||
| /** | |||
| * List of filenames and directory names to not include. They should be | |||
| * List of filenames and directory names to not include. They should be | |||
| * either , or " " (space) separated. The ignored files will be logged. | |||
| * | |||
| * @param ignoreString the string containing the files to ignore. | |||
| @@ -232,6 +232,25 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||
| fileset.setExcludesfile(excludesfile); | |||
| } | |||
| /** | |||
| * Sets case sensitivity of the file system | |||
| * | |||
| * @param isCaseSensitive "true"|"on"|"yes" if file system is case | |||
| * sensitive, "false"|"off"|"no" when not. | |||
| */ | |||
| public void setCaseSensitive(boolean isCaseSensitive) { | |||
| fileset.setCaseSensitive(isCaseSensitive); | |||
| } | |||
| /** | |||
| * Sets whether or not symbolic links should be followed. | |||
| * | |||
| * @param followSymlinks whether or not symbolic links should be followed | |||
| */ | |||
| public void setFollowSymlinks(boolean followSymlinks) { | |||
| fileset.setFollowSymlinks(followSymlinks); | |||
| } | |||
| /** | |||
| * Indicates whether there are any selectors here. | |||
| * | |||
| @@ -69,7 +69,7 @@ import java.util.Vector; | |||
| import java.io.File; | |||
| /** | |||
| * This task converts path and classpath information to a specific target OS | |||
| * Converts path and classpath information to a specific target OS | |||
| * format. The resulting formatted path is placed into the specified property. | |||
| * | |||
| * @author Larry Streepy <a href="mailto:streepy@healthlanguage.com"> | |||
| @@ -100,6 +100,10 @@ public class PathConvert extends Task { | |||
| * Set if we're running on windows | |||
| */ | |||
| private boolean onWindows = false; | |||
| /** | |||
| * Set if we should create a new property even if the result is empty | |||
| */ | |||
| private boolean setonempty = true; | |||
| /** | |||
| * The property to receive the conversion | |||
| */ | |||
| @@ -268,6 +272,17 @@ public class PathConvert extends Task { | |||
| targetWindows = !targetOS.equals("unix"); | |||
| } | |||
| /** | |||
| * Set setonempty | |||
| * | |||
| * If false, don't set the new property if the result is the empty string. | |||
| * @param setonempty true or false | |||
| * | |||
| * @since Ant 1.5 | |||
| */ | |||
| public void setSetonempty(boolean setonempty) { | |||
| this.setonempty = setonempty; | |||
| } | |||
| /** | |||
| * The property into which the converted path will be placed. | |||
| @@ -401,13 +416,20 @@ public class PathConvert extends Task { | |||
| } | |||
| } | |||
| // Place the result into the specified property | |||
| if( rslt.length() > 0 ) { | |||
| String value = rslt.toString(); | |||
| log("Set property " + property + " = " + value, | |||
| Project.MSG_VERBOSE); | |||
| getProject().setNewProperty(property, value); | |||
| } | |||
| // Place the result into the specified property, | |||
| // unless setonempty == false | |||
| String value = rslt.toString(); | |||
| if(setonempty) { | |||
| log("Set property " + property + " = " + value, | |||
| Project.MSG_VERBOSE); | |||
| getProject().setNewProperty(property, value); | |||
| } else { | |||
| if(rslt.length() > 0) { | |||
| log("Set property " + property + " = " + value, | |||
| Project.MSG_VERBOSE); | |||
| getProject().setNewProperty(property, value); | |||
| } | |||
| } | |||
| } finally { | |||
| path = savedPath; | |||
| dirSep = savedDirSep; | |||
| @@ -162,12 +162,10 @@ public class Property extends Task { | |||
| * Sets the value of the property. | |||
| * @param value value to assign | |||
| */ | |||
| public void setValue(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| @@ -250,7 +248,6 @@ public class Property extends Task { | |||
| * will be ${env.Path} not ${env.PATH} on Windows 2000. | |||
| * @param env prefix | |||
| */ | |||
| public void setEnvironment(String env) { | |||
| this.env = env; | |||
| } | |||
| @@ -262,12 +259,10 @@ public class Property extends Task { | |||
| return env; | |||
| } | |||
| /** | |||
| * The classpath to use when looking up a resource. | |||
| * @param classpath to add to any existing classpath | |||
| */ | |||
| public void setClasspath(Path classpath) { | |||
| if (this.classpath == null) { | |||
| this.classpath = classpath; | |||
| @@ -67,7 +67,7 @@ import java.io.IOException; | |||
| import java.util.Hashtable; | |||
| /** | |||
| * Add a listener to the current build process that records the | |||
| * Adds a listener to the current build process that records the | |||
| * output to a file. | |||
| * <p>Several recorders can exist at the same time. Each recorder is | |||
| * associated with a file. The filename is used as a unique identifier for | |||
| @@ -79,7 +79,6 @@ import java.util.Hashtable; | |||
| * <p>Some technical issues: the file's print stream is flushed for "finished" | |||
| * events (buildFinished, targetFinished and taskFinished), and is closed on | |||
| * a buildFinished event.</p> | |||
| * @author <a href="mailto:jayglanville@home.com">J D Glanville</a> | |||
| * @see RecorderEntry | |||
| * @version 0.5 | |||
| @@ -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 The Apache Software Foundation. All rights | |||
| * reserved. | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without | |||
| @@ -54,15 +54,10 @@ | |||
| package org.apache.tools.ant.taskdefs; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.AntClassLoader; | |||
| import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Reference; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import java.io.File; | |||
| @@ -79,39 +74,36 @@ import java.io.FileInputStream; | |||
| import java.util.Enumeration; | |||
| import java.util.StringTokenizer; | |||
| import java.util.Vector; | |||
| import java.util.Properties; | |||
| import java.util.Hashtable; | |||
| import java.sql.Connection; | |||
| import java.sql.Statement; | |||
| import java.sql.Driver; | |||
| import java.sql.SQLException; | |||
| import java.sql.DatabaseMetaData; | |||
| import java.sql.SQLWarning; | |||
| import java.sql.ResultSet; | |||
| import java.sql.ResultSetMetaData; | |||
| /** | |||
| * <p>Executes a series of SQL statements via JDBC to a database. Statements can | |||
| * either be read in from a text file using the <i>src</i> attribute or from | |||
| * Executes a series of SQL statements on a database using JDBC. | |||
| * | |||
| * <p>Statements can | |||
| * either be read in from a text file using the <i>src</i> attribute or from | |||
| * between the enclosing SQL tags.</p> | |||
| * | |||
| * <p>Multiple statements can be provided, separated by semicolons (or the | |||
| * defined <i>delimiter</i>). Individual lines within the statements can be | |||
| * | |||
| * <p>Multiple statements can be provided, separated by semicolons (or the | |||
| * defined <i>delimiter</i>). Individual lines within the statements can be | |||
| * commented using either --, // or REM at the start of the line.</p> | |||
| * | |||
| * <p>The <i>autocommit</i> attribute specifies whether auto-commit should be | |||
| * turned on or off whilst executing the statements. If auto-commit is turned | |||
| * on each statement will be executed and committed. If it is turned off the | |||
| * | |||
| * <p>The <i>autocommit</i> attribute specifies whether auto-commit should be | |||
| * turned on or off whilst executing the statements. If auto-commit is turned | |||
| * on each statement will be executed and committed. If it is turned off the | |||
| * statements will all be executed as one transaction.</p> | |||
| * | |||
| * <p>The <i>onerror</i> attribute specifies how to proceed when an error occurs | |||
| * during the execution of one of the statements. | |||
| * | |||
| * <p>The <i>onerror</i> attribute specifies how to proceed when an error occurs | |||
| * during the execution of one of the statements. | |||
| * The possible values are: <b>continue</b> execution, only show the error; | |||
| * <b>stop</b> execution and commit transaction; | |||
| * and <b>abort</b> execution and transaction and fail task.</p> | |||
| * | |||
| * | |||
| * @author <a href="mailto:jeff@custommonkey.org">Jeff Martin</a> | |||
| * @author <A href="mailto:gholam@xtra.co.nz">Michael McCallum</A> | |||
| * @author <A href="mailto:tim.stephenson@sybase.com">Tim Stephenson</A> | |||
| @@ -133,13 +125,13 @@ public class SQLExec extends JDBCTask { | |||
| } | |||
| } | |||
| private int goodSql = 0; | |||
| private int totalSql = 0; | |||
| /** | |||
| /** | |||
| * Database connection | |||
| */ | |||
| private Connection conn = null; | |||
| @@ -173,13 +165,13 @@ public class SQLExec extends JDBCTask { | |||
| * SQL Statement delimiter | |||
| */ | |||
| private String delimiter = ";"; | |||
| /** | |||
| * The delimiter type indicating whether the delimiter will | |||
| * only be recognized on a line by itself | |||
| */ | |||
| private String delimiterType = DelimiterType.NORMAL; | |||
| /** | |||
| * Print SQL results. | |||
| */ | |||
| @@ -195,12 +187,12 @@ public class SQLExec extends JDBCTask { | |||
| */ | |||
| private File output = null; | |||
| /** | |||
| * Action to perform if an error is found | |||
| **/ | |||
| private String onError = "abort"; | |||
| /** | |||
| * Encoding to use when reading SQL statements from a file | |||
| */ | |||
| @@ -211,23 +203,23 @@ public class SQLExec extends JDBCTask { | |||
| */ | |||
| private boolean append = false; | |||
| /** | |||
| * Set the name of the sql file to be run. | |||
| * Set the name of the SQL file to be run. | |||
| * Required unless statements are enclosed in the build file | |||
| */ | |||
| public void setSrc(File srcFile) { | |||
| this.srcFile = srcFile; | |||
| } | |||
| /** | |||
| * Set an inline SQL command to execute. | |||
| * Set an inline SQL command to execute. | |||
| * NB: Properties are not expanded in this text. | |||
| */ | |||
| public void addText(String sql) { | |||
| this.sqlCommand += sql; | |||
| } | |||
| /** | |||
| * Adds a set of files (nested fileset attribute). | |||
| */ | |||
| @@ -244,7 +236,7 @@ public class SQLExec extends JDBCTask { | |||
| transactions.addElement(t); | |||
| return t; | |||
| } | |||
| /** | |||
| * Set the file encoding to use on the SQL files read in | |||
| * | |||
| @@ -253,9 +245,9 @@ public class SQLExec extends JDBCTask { | |||
| public void setEncoding(String encoding) { | |||
| this.encoding = encoding; | |||
| } | |||
| /** | |||
| * Set the delimiter that separates SQL statements; | |||
| * Set the delimiter that separates SQL statements; | |||
| * optional, default ";" | |||
| * | |||
| * <p>For example, set this to "go" and delimitertype to "ROW" for | |||
| @@ -266,7 +258,7 @@ public class SQLExec extends JDBCTask { | |||
| } | |||
| /** | |||
| * Set the Delimiter type for this sql task; default "normal" | |||
| * Set the delimiter type: "normal" or "row" (default "normal"). | |||
| * | |||
| * <p>The delimiter type takes two values - normal and row. Normal | |||
| * means that any occurence of the delimiter terminate the SQL | |||
| @@ -276,7 +268,7 @@ public class SQLExec extends JDBCTask { | |||
| public void setDelimiterType(DelimiterType delimiterType) { | |||
| this.delimiterType = delimiterType.getValue(); | |||
| } | |||
| /** | |||
| * Print result sets from the statements; | |||
| * optional, default false | |||
| @@ -284,9 +276,9 @@ public class SQLExec extends JDBCTask { | |||
| public void setPrint(boolean print) { | |||
| this.print = print; | |||
| } | |||
| /** | |||
| * Print headers for result sets from the | |||
| * Print headers for result sets from the | |||
| * statements; optional, default true. | |||
| */ | |||
| public void setShowheaders(boolean showheaders) { | |||
| @@ -294,8 +286,8 @@ public class SQLExec extends JDBCTask { | |||
| } | |||
| /** | |||
| * Set the output file; | |||
| * optional, defaults to the ant log | |||
| * Set the output file; | |||
| * optional, defaults to the Ant log. | |||
| */ | |||
| public void setOutput(File output) { | |||
| this.output = output; | |||
| @@ -311,7 +303,7 @@ public class SQLExec extends JDBCTask { | |||
| this.append = append; | |||
| } | |||
| /** | |||
| * Action to perform when statement fails: continue, stop, or abort | |||
| * optional; default "abort" | |||
| @@ -330,15 +322,15 @@ public class SQLExec extends JDBCTask { | |||
| sqlCommand = sqlCommand.trim(); | |||
| try { | |||
| if (srcFile == null && sqlCommand.length() == 0 | |||
| && filesets.isEmpty()) { | |||
| if (srcFile == null && sqlCommand.length() == 0 | |||
| && filesets.isEmpty()) { | |||
| if (transactions.size() == 0) { | |||
| throw new BuildException("Source file or fileset, " | |||
| + "transactions or sql statement " | |||
| + "must be set!", location); | |||
| } | |||
| } | |||
| if (srcFile != null && !srcFile.exists()) { | |||
| throw new BuildException("Source file does not exist!", location); | |||
| } | |||
| @@ -348,16 +340,16 @@ public class SQLExec extends JDBCTask { | |||
| FileSet fs = (FileSet) filesets.elementAt(i); | |||
| DirectoryScanner ds = fs.getDirectoryScanner(project); | |||
| File srcDir = fs.getDir(project); | |||
| String[] srcFiles = ds.getIncludedFiles(); | |||
| // Make a transaction for each file | |||
| for (int j = 0 ; j < srcFiles.length ; j++) { | |||
| Transaction t = createTransaction(); | |||
| t.setSrc(new File(srcDir, srcFiles[j])); | |||
| } | |||
| } | |||
| // Make a transaction group for the outer command | |||
| Transaction t = createTransaction(); | |||
| t.setSrc(srcFile); | |||
| @@ -369,11 +361,11 @@ public class SQLExec extends JDBCTask { | |||
| try { | |||
| statement = conn.createStatement(); | |||
| PrintStream out = System.out; | |||
| try { | |||
| if (output != null) { | |||
| log("Opening PrintStream to output file " + output, | |||
| log("Opening PrintStream to output file " + output, | |||
| Project.MSG_VERBOSE); | |||
| out = new PrintStream( | |||
| new BufferedOutputStream( | |||
| @@ -381,11 +373,11 @@ public class SQLExec extends JDBCTask { | |||
| .getAbsolutePath(), | |||
| append))); | |||
| } | |||
| // Process all transactions | |||
| for (Enumeration e = transactions.elements(); | |||
| for (Enumeration e = transactions.elements(); | |||
| e.hasMoreElements();) { | |||
| ((Transaction) e.nextElement()).runTransaction(out); | |||
| if (!isAutocommit()) { | |||
| log("Commiting transaction", Project.MSG_VERBOSE); | |||
| @@ -396,7 +388,7 @@ public class SQLExec extends JDBCTask { | |||
| if (out != null && out != System.out) { | |||
| out.close(); | |||
| } | |||
| } | |||
| } | |||
| } catch (IOException e){ | |||
| if (!isAutocommit() && conn != null && onError.equals("abort")) { | |||
| try { | |||
| @@ -421,8 +413,8 @@ public class SQLExec extends JDBCTask { | |||
| } | |||
| } catch (SQLException e) {} | |||
| } | |||
| log(goodSql + " of " + totalSql + | |||
| log(goodSql + " of " + totalSql + | |||
| " SQL statements executed successfully"); | |||
| } finally { | |||
| transactions = savedTransaction; | |||
| @@ -434,13 +426,13 @@ public class SQLExec extends JDBCTask { | |||
| /** | |||
| * read in lines and execute them | |||
| */ | |||
| protected void runStatements(Reader reader, PrintStream out) | |||
| protected void runStatements(Reader reader, PrintStream out) | |||
| throws SQLException, IOException { | |||
| String sql = ""; | |||
| String line = ""; | |||
| BufferedReader in = new BufferedReader(reader); | |||
| while ((line = in.readLine()) != null){ | |||
| line = line.trim(); | |||
| line = project.replaceProperties(line); | |||
| @@ -457,36 +449,36 @@ public class SQLExec extends JDBCTask { | |||
| continue; | |||
| } | |||
| } | |||
| sql += " " + line; | |||
| sql = sql.trim(); | |||
| // SQL defines "--" as a comment to EOL | |||
| // and in Oracle it may contain a hint | |||
| // so we cannot just remove it, instead we must end it | |||
| if (line.indexOf("--") >= 0) { | |||
| sql += "\n"; | |||
| } | |||
| if ((delimiterType.equals(DelimiterType.NORMAL) | |||
| && sql.endsWith(delimiter)) | |||
| if ((delimiterType.equals(DelimiterType.NORMAL) | |||
| && sql.endsWith(delimiter)) | |||
| || | |||
| (delimiterType.equals(DelimiterType.ROW) | |||
| (delimiterType.equals(DelimiterType.ROW) | |||
| && line.equals(delimiter))) { | |||
| log("SQL: " + sql, Project.MSG_VERBOSE); | |||
| execSQL(sql.substring(0, sql.length() - delimiter.length()), | |||
| execSQL(sql.substring(0, sql.length() - delimiter.length()), | |||
| out); | |||
| sql = ""; | |||
| } | |||
| } | |||
| // Catch any statements not followed by ; | |||
| if (!sql.equals("")){ | |||
| execSQL(sql, out); | |||
| } | |||
| } | |||
| /** | |||
| * Exec the sql statement. | |||
| */ | |||
| @@ -495,18 +487,18 @@ public class SQLExec extends JDBCTask { | |||
| if ("".equals(sql.trim())) { | |||
| return; | |||
| } | |||
| try { | |||
| try { | |||
| totalSql++; | |||
| if (!statement.execute(sql)) { | |||
| log(statement.getUpdateCount() + " rows affected", | |||
| log(statement.getUpdateCount() + " rows affected", | |||
| Project.MSG_VERBOSE); | |||
| } else { | |||
| if (print) { | |||
| printResults(out); | |||
| } | |||
| } | |||
| SQLWarning warning = conn.getWarnings(); | |||
| while (warning != null){ | |||
| log(warning + " sql warning", Project.MSG_VERBOSE); | |||
| @@ -522,7 +514,7 @@ public class SQLExec extends JDBCTask { | |||
| log(e.toString(), Project.MSG_ERR); | |||
| } | |||
| } | |||
| /** | |||
| * print any results in the statement. | |||
| */ | |||
| @@ -551,7 +543,7 @@ public class SQLExec extends JDBCTask { | |||
| if (columnValue != null) { | |||
| columnValue = columnValue.trim(); | |||
| } | |||
| if (first) { | |||
| first = false; | |||
| } else { | |||
| @@ -605,20 +597,20 @@ public class SQLExec extends JDBCTask { | |||
| /** | |||
| * | |||
| */ | |||
| private void runTransaction(PrintStream out) | |||
| private void runTransaction(PrintStream out) | |||
| throws IOException, SQLException { | |||
| if (tSqlCommand.length() != 0) { | |||
| log("Executing commands", Project.MSG_INFO); | |||
| runStatements(new StringReader(tSqlCommand), out); | |||
| } | |||
| if (tSrcFile != null) { | |||
| log("Executing file: " + tSrcFile.getAbsolutePath(), | |||
| log("Executing file: " + tSrcFile.getAbsolutePath(), | |||
| Project.MSG_INFO); | |||
| Reader reader = | |||
| Reader reader = | |||
| (encoding == null) ? new FileReader(tSrcFile) | |||
| : new InputStreamReader( | |||
| new FileInputStream(tSrcFile), | |||
| new FileInputStream(tSrcFile), | |||
| encoding); | |||
| try { | |||
| runStatements(reader, out); | |||
| @@ -58,18 +58,19 @@ import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.BuildException; | |||
| /** | |||
| * Sleep for a period of time | |||
| * Sleep, or pause, for a period of time. | |||
| * | |||
| * A task for sleeping a short period of time, useful when a | |||
| * build or deployment process requires an interval between tasks. | |||
| *<p> | |||
| * A negative value can be supplied to any of attributes provided the total sleep time | |||
| * A negative value can be supplied to any of attributes provided the total sleep time | |||
| * is positive, pending fundamental changes in physics and JVM | |||
| * execution tims</p> | |||
| * Note that sleep times are always hints to be interpred by the OS how it feels | |||
| * small times may either be ignored or rounded up to a minimum timeslice. Note | |||
| * also that the system clocks often have a fairly low granularity too, which complicates | |||
| * Note that sleep times are always hints to be interpred by the OS how it feels | |||
| * small times may either be ignored or rounded up to a minimum timeslice. Note | |||
| * also that the system clocks often have a fairly low granularity too, which complicates | |||
| * measuring how long a sleep actually took.</p> | |||
| * | |||
| * | |||
| * @author steve_l@iseran.com steve loughran | |||
| * @since Ant 1.4 | |||
| * @ant.task category="utility" | |||
| @@ -87,7 +88,7 @@ public class Sleep extends Task { | |||
| private int seconds = 0; | |||
| /** | |||
| * sleep hours | |||
| * sleep hours | |||
| */ | |||
| private int hours = 0; | |||
| /** | |||
| @@ -110,7 +111,7 @@ public class Sleep extends Task { | |||
| /** | |||
| * adds some seconds to the Sleep | |||
| * seconds to add to the sleep time | |||
| * | |||
| * @param seconds The new Seconds value | |||
| */ | |||
| @@ -120,7 +121,7 @@ public class Sleep extends Task { | |||
| /** | |||
| * hours to to add to the sleep time | |||
| * hours to add to the sleep time. | |||
| * | |||
| * @param hours The new Hours value | |||
| */ | |||
| @@ -130,7 +131,7 @@ public class Sleep extends Task { | |||
| /** | |||
| * Sets the Minutes attribute of the Sleep object | |||
| * minutes to add to the sleep time | |||
| * | |||
| * @param minutes The new Minutes value | |||
| */ | |||
| @@ -140,7 +141,7 @@ public class Sleep extends Task { | |||
| /** | |||
| * minutes to add to the sleep time | |||
| * milliseconds to add to the sleep time | |||
| * | |||
| * @param milliseconds The new Milliseconds value | |||
| */ | |||
| @@ -179,7 +180,7 @@ public class Sleep extends Task { | |||
| */ | |||
| private long getSleepTime() { | |||
| return ((((long) hours * 60) + minutes) * 60 + seconds) * 1000 | |||
| return ((((long) hours * 60) + minutes) * 60 + seconds) * 1000 | |||
| + milliseconds; | |||
| } | |||
| @@ -189,7 +190,7 @@ public class Sleep extends Task { | |||
| * | |||
| * @throws BuildException if something is invalid | |||
| */ | |||
| public void validate() | |||
| public void validate() | |||
| throws BuildException { | |||
| if (getSleepTime() < 0) { | |||
| throw new BuildException("Negative sleep periods are not " | |||
| @@ -57,6 +57,7 @@ package org.apache.tools.ant.taskdefs; | |||
| /** | |||
| * Has been merged into ExecuteOn, empty class for backwards compatibility. | |||
| * | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| * @ant.task ignore="true" | |||
| */ | |||
| public class Transform extends ExecuteOn {} | |||
| @@ -72,7 +72,7 @@ import java.util.Vector; | |||
| import java.text.SimpleDateFormat; | |||
| /** | |||
| * Sets properties to the current time. | |||
| * Sets properties to the current time, or offsets from the current time. | |||
| * The default properties are TSTAMP, DSTAMP and TODAY; | |||
| * | |||
| * @author costin@dnt.ro | |||
| @@ -204,7 +204,7 @@ public class Tstamp extends Task { | |||
| if (st.hasMoreElements()) { | |||
| variant = st.nextToken(); | |||
| if (st.hasMoreElements()) { | |||
| throw new BuildException("bad locale format", | |||
| throw new BuildException("bad locale format", | |||
| getLocation()); | |||
| } | |||
| } | |||
| @@ -212,7 +212,7 @@ public class Tstamp extends Task { | |||
| country = ""; | |||
| } | |||
| } catch (NoSuchElementException e) { | |||
| throw new BuildException("bad locale format", e, | |||
| throw new BuildException("bad locale format", e, | |||
| getLocation()); | |||
| } | |||
| } | |||
| @@ -70,7 +70,7 @@ import java.util.Enumeration; | |||
| import java.util.Vector; | |||
| /** | |||
| * Will set the given property if the specified target has a timestamp | |||
| * Sets the given property if the specified target has a timestamp | |||
| * greater than all of the source files. | |||
| * | |||
| * @author William Ferguson | |||
| @@ -68,7 +68,7 @@ import java.io.IOException; | |||
| * Contains special treatment for files that should end up in the | |||
| * <code>WEB-INF/lib</code>, <code>WEB-INF/classes</code> or | |||
| * <code>WEB-INF</code> directories of the Web Application Archive.</p> | |||
| * <p>(The War task is a shortcut for specifying the particular layout of a WAR file. | |||
| * <p>(The War task is a shortcut for specifying the particular layout of a WAR file. | |||
| * The same thing can be accomplished by using the <i>prefix</i> and <i>fullpath</i> | |||
| * attributes of zipfilesets in a Zip or Jar task.)</p> | |||
| * <p>The extended zipfileset element from the zip task (with attributes <i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the War task.</p> | |||
| @@ -86,7 +86,7 @@ public class War extends Jar { | |||
| * our web.xml deployment descriptor | |||
| */ | |||
| private File deploymentDescriptor; | |||
| /** | |||
| * flag set if the descriptor is added | |||
| */ | |||
| @@ -99,10 +99,10 @@ public class War extends Jar { | |||
| } | |||
| /** | |||
| * <i>Deprecated<i> name of the file to create | |||
| * -use <tt>destfile</tt> instead. | |||
| * <i>Deprecated<i> name of the file to create | |||
| * -use <tt>destfile</tt> instead. | |||
| * @deprecated Use setDestFile(File) instead | |||
| * @ant.attribute ignored="true" | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setWarfile(File warFile) { | |||
| setDestFile(warFile); | |||
| @@ -115,8 +115,8 @@ public class War extends Jar { | |||
| public void setWebxml(File descr) { | |||
| deploymentDescriptor = descr; | |||
| if (!deploymentDescriptor.exists()) { | |||
| throw new BuildException("Deployment descriptor: " | |||
| + deploymentDescriptor | |||
| throw new BuildException("Deployment descriptor: " | |||
| + deploymentDescriptor | |||
| + " does not exist."); | |||
| } | |||
| @@ -131,7 +131,7 @@ public class War extends Jar { | |||
| /** | |||
| * add files under WEB-INF/lib/ | |||
| */ | |||
| public void addLib(ZipFileSet fs) { | |||
| // We just set the prefix for this fileset, and pass it up. | |||
| fs.setPrefix("WEB-INF/lib/"); | |||
| @@ -148,7 +148,7 @@ public class War extends Jar { | |||
| } | |||
| /** | |||
| * files to add under WEB-INF; | |||
| * files to add under WEB-INF; | |||
| */ | |||
| public void addWebinf(ZipFileSet fs) { | |||
| // We just set the prefix for this fileset, and pass it up. | |||
| @@ -180,8 +180,8 @@ public class War extends Jar { | |||
| // it's being added twice, meaning the same file is specified | |||
| // by the "webxml" attribute and in a <fileset> element. | |||
| if (vPath.equalsIgnoreCase("WEB-INF/web.xml")) { | |||
| if (deploymentDescriptor == null | |||
| || !deploymentDescriptor.equals(file) | |||
| if (deploymentDescriptor == null | |||
| || !deploymentDescriptor.equals(file) | |||
| || descriptorAdded) { | |||
| log("Warning: selected " + archiveType | |||
| + " files include a WEB-INF/web.xml which will be ignored " | |||
| @@ -92,15 +92,6 @@ public interface XSLTLiaison { | |||
| */ | |||
| void addParam(String name, String expression) throws Exception; | |||
| /** | |||
| * set the output type to use for the transformation. Only "xml" (the | |||
| * default) is guaranteed to work for all parsers. Xalan2 also | |||
| * supports "html" and "text". | |||
| * @param type the output method to use | |||
| * @since Ant 1.5 | |||
| */ | |||
| void setOutputtype(String type) throws Exception; | |||
| /** | |||
| * Perform the transformation of a file into another. | |||
| * @param infile the input file, probably an XML one. :-) | |||
| @@ -62,6 +62,7 @@ import org.apache.tools.ant.BuildException; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.AntClassLoader; | |||
| import org.apache.tools.ant.taskdefs.optional.TraXLiaison; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Reference; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| @@ -69,7 +70,7 @@ import org.apache.tools.ant.types.XMLCatalog; | |||
| import org.xml.sax.EntityResolver; | |||
| /** | |||
| * A Task to process via XSLT a set of XML documents. This is | |||
| * Processes a set of XML documents via XSLT. This is | |||
| * useful for building views of XML based documentation. | |||
| * | |||
| * @version $Revision$ | |||
| @@ -127,7 +128,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| private FileUtils fileUtils; | |||
| /** XSL output method to be used */ | |||
| private String outputtype = null; | |||
| private Vector outputProperties = new Vector(); | |||
| /** for resolving entities such as dtds */ | |||
| private XMLCatalog xmlCatalog = new XMLCatalog(); | |||
| @@ -137,11 +138,11 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| "org.apache.tools.ant.taskdefs.optional.TraXLiaison"; | |||
| /** Name of the now-deprecated XSLP Liason class */ | |||
| private static final String XSLP_LIASON_CLASS = | |||
| private static final String XSLP_LIAISON_CLASS = | |||
| "org.apache.tools.ant.taskdefs.optional.XslpLiaison"; | |||
| /** Name of the Xalan liason class */ | |||
| private static final String XALAN_LIASON_CLASS = | |||
| private static final String XALAN_LIAISON_CLASS = | |||
| "org.apache.tools.ant.taskdefs.optional.XalanLiaison"; | |||
| /** | |||
| @@ -298,8 +299,6 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| /** | |||
| * Name of the stylesheet to use - given either relative | |||
| * to the project's basedir or as an absolute path; required. | |||
| * | |||
| * @param xslFile the stylesheet to use | |||
| */ | |||
| public void setStyle(String xslFile) { | |||
| this.xslFile = xslFile; | |||
| @@ -371,10 +370,10 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| } else if (proc.equals("xslp")) { | |||
| log("DEPRECATED - xslp processor is deprecated. Use trax or " | |||
| + "xalan instead."); | |||
| final Class clazz = loadClass(XSLP_LIASON_CLASS); | |||
| final Class clazz = loadClass(XSLP_LIAISON_CLASS); | |||
| liaison = (XSLTLiaison) clazz.newInstance(); | |||
| } else if (proc.equals("xalan")) { | |||
| final Class clazz = loadClass(XALAN_LIASON_CLASS); | |||
| final Class clazz = loadClass(XALAN_LIAISON_CLASS); | |||
| liaison = (XSLTLiaison) clazz.newInstance(); | |||
| } else { | |||
| liaison = (XSLTLiaison) loadClass(proc).newInstance(); | |||
| @@ -631,17 +630,64 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| } | |||
| return expression; | |||
| } | |||
| } // Param | |||
| /** | |||
| * Create an instance of an output property to be configured. | |||
| * @return the newly created output property. | |||
| * @since Ant 1.5 | |||
| */ | |||
| public OutputProperty createOutputProperty() { | |||
| OutputProperty p = new OutputProperty(); | |||
| outputProperties.addElement(p); | |||
| return p; | |||
| } | |||
| /** | |||
| * Set the output type to use for the transformation; | |||
| * optional, default="xml". | |||
| * Only "xml" is guaranteed to work for all parsers. | |||
| * Xalan2 also supports "html" and "text". | |||
| * @param type the output method to use | |||
| * Specify how the result tree should be output as specified | |||
| * in the <a href="http://www.w3.org/TR/xslt#output"> | |||
| * specification</a>. | |||
| * @since Ant 1.5 | |||
| */ | |||
| public void setOutputtype(String type) { | |||
| this.outputtype = type; | |||
| public static class OutputProperty { | |||
| /** output property name */ | |||
| private String name; | |||
| /** output property value */ | |||
| private String value; | |||
| /** | |||
| * @return the output property name. | |||
| */ | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| /** | |||
| * set the name for this property | |||
| * @param name A non-null String that specifies an | |||
| * output property name, which may be namespace qualified. | |||
| */ | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| /** | |||
| * @return the output property value. | |||
| */ | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| /** | |||
| * set the value for this property | |||
| * @param value The non-null string value of the output property. | |||
| */ | |||
| public void setValue(String value) { | |||
| this.value = value; | |||
| } | |||
| } | |||
| /** | |||
| @@ -649,7 +695,6 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| */ | |||
| public void init() throws BuildException { | |||
| super.init(); | |||
| xmlCatalog.setProject(project); | |||
| } | |||
| @@ -668,38 +713,37 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||
| try { | |||
| log("Loading stylesheet " + stylesheet, Project.MSG_INFO); | |||
| liaison.setStylesheet(stylesheet); | |||
| if (outputtype != null) { | |||
| liaison.setOutputtype(outputtype); | |||
| } | |||
| for (Enumeration e = params.elements(); e.hasMoreElements();) { | |||
| Param p = (Param) e.nextElement(); | |||
| liaison.addParam(p.getName(), p.getExpression()); | |||
| } | |||
| if (liaison instanceof TraXLiaison) { | |||
| configureTraXLiaison((TraXLiaison)liaison); | |||
| } | |||
| } catch (Exception ex) { | |||
| log("Failed to read stylesheet " + stylesheet, Project.MSG_INFO); | |||
| log("Failed to transform using stylesheet " + stylesheet, Project.MSG_INFO); | |||
| throw new BuildException(ex); | |||
| } | |||
| } | |||
| try { | |||
| // if liaison is a TraxLiason, use XMLCatalog as the entity | |||
| // resolver and URI resolver | |||
| if (liaison.getClass().getName().equals(TRAX_LIAISON_CLASS) && | |||
| xmlCatalog != null) { | |||
| log("Configuring TraxLiaison: setting entity resolver " + | |||
| "and setting URI resolver", Project.MSG_DEBUG); | |||
| Method resolver = liaison.getClass() | |||
| .getDeclaredMethod("setEntityResolver", | |||
| new Class[] {EntityResolver.class}); | |||
| resolver.invoke(liaison, new Object[] {xmlCatalog}); | |||
| resolver = liaison.getClass() | |||
| .getDeclaredMethod("setURIResolver", | |||
| new Class[] {loadClass("javax.xml.transform.URIResolver")}); | |||
| resolver.invoke(liaison, new Object[] {xmlCatalog}); | |||
| } | |||
| } catch (Exception e) { | |||
| throw new BuildException("Failed to configure XMLCatalog for " | |||
| + "TraxLiaison", e); | |||
| /** | |||
| * Specific configuration for the TRaX liaison... support for | |||
| * all other has been dropped so this liaison will soon look | |||
| * like the exact copy of JAXP interface.. | |||
| * @param liaison the TRaXLiaison to configure. | |||
| */ | |||
| protected void configureTraXLiaison(TraXLiaison liaison){ | |||
| // use XMLCatalog as the entity resolver and URI resolver | |||
| if (xmlCatalog != null) { | |||
| liaison.setEntityResolver(xmlCatalog); | |||
| liaison.setURIResolver(xmlCatalog); | |||
| } | |||
| // configure output properties | |||
| for (Enumeration props = outputProperties.elements(); | |||
| props.hasMoreElements();) { | |||
| OutputProperty prop = (OutputProperty)props.nextElement(); | |||
| liaison.setOutputProperty(prop.getName(), prop.getValue()); | |||
| } | |||
| } | |||
| @@ -72,8 +72,9 @@ import java.io.IOException; | |||
| import java.util.Vector; | |||
| /** | |||
| * Task that gets property values from a valid xml file, | |||
| * Loads property values from a valid XML file, | |||
| * generating the property names from the file's element and attribute names. | |||
| * | |||
| * Example: | |||
| * <pre> | |||
| * <root-tag myattr="true"> | |||
| @@ -84,7 +84,7 @@ import org.apache.tools.zip.ZipOutputStream; | |||
| import org.apache.tools.zip.ZipEntry; | |||
| /** | |||
| * Create a zipfile. | |||
| * Create a Zip file. | |||
| * | |||
| * @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a> | |||
| * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a> | |||
| @@ -116,9 +116,9 @@ public class Zip extends MatchingTask { | |||
| protected Hashtable addedDirs = new Hashtable(); | |||
| private Vector addedFiles = new Vector(); | |||
| /** | |||
| /** | |||
| * true when we are adding new files into the Zip file, as opposed | |||
| * to adding back the unchanged files | |||
| * to adding back the unchanged files | |||
| */ | |||
| private boolean addingNewFiles = false; | |||
| @@ -144,7 +144,7 @@ public class Zip extends MatchingTask { | |||
| * create the file. | |||
| * @since Ant 1.5 | |||
| * @deprecated Use setDestFile(File) instead | |||
| * @ant.attribute ignored="true" | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setFile(File file) { | |||
| setDestFile(file); | |||
| @@ -276,12 +276,12 @@ public class Zip extends MatchingTask { | |||
| if (baseDir == null && filesets.size() == 0 | |||
| && groupfilesets.size() == 0 && "zip".equals(archiveType)) { | |||
| throw new BuildException("basedir attribute must be set, " | |||
| + "or at least " | |||
| + "or at least " | |||
| + "one fileset must be given!"); | |||
| } | |||
| if (zipFile == null) { | |||
| throw new BuildException("You must specify the " | |||
| throw new BuildException("You must specify the " | |||
| + archiveType + " file to create!"); | |||
| } | |||
| @@ -292,22 +292,6 @@ public class Zip extends MatchingTask { | |||
| addingNewFiles = true; | |||
| doUpdate = doUpdate && zipFile.exists(); | |||
| if (doUpdate) { | |||
| FileUtils fileUtils = FileUtils.newFileUtils(); | |||
| renamedFile = | |||
| fileUtils.createTempFile("zip", ".tmp", | |||
| fileUtils.getParentFile(zipFile)); | |||
| try { | |||
| if (!zipFile.renameTo(renamedFile)) { | |||
| throw new BuildException("Unable to rename old file to " | |||
| + "temporary file"); | |||
| } | |||
| } catch (SecurityException e) { | |||
| throw new BuildException("Not allowed to rename old file to " | |||
| + "temporary file"); | |||
| } | |||
| } | |||
| // Add the files found in groupfileset to fileset | |||
| for (int i = 0; i < groupfilesets.size(); i++) { | |||
| @@ -319,7 +303,7 @@ public class Zip extends MatchingTask { | |||
| File basedir = scanner.getBasedir(); | |||
| for (int j = 0; j < files.length; j++) { | |||
| log("Adding file " + files[j] + " to fileset", | |||
| log("Adding file " + files[j] + " to fileset", | |||
| Project.MSG_VERBOSE); | |||
| ZipFileSet zf = new ZipFileSet(); | |||
| zf.setSrc(new File(basedir, files[j])); | |||
| @@ -348,9 +332,26 @@ public class Zip extends MatchingTask { | |||
| if (isUpToDate(scanners, zipFile)) { | |||
| return; | |||
| } | |||
| if (doUpdate) { | |||
| FileUtils fileUtils = FileUtils.newFileUtils(); | |||
| renamedFile = | |||
| fileUtils.createTempFile("zip", ".tmp", | |||
| fileUtils.getParentFile(zipFile)); | |||
| try { | |||
| if (!zipFile.renameTo(renamedFile)) { | |||
| throw new BuildException("Unable to rename old file " | |||
| + "to temporary file"); | |||
| } | |||
| } catch (SecurityException e) { | |||
| throw new BuildException("Not allowed to rename old file " | |||
| + "to temporary file"); | |||
| } | |||
| } | |||
| String action = doUpdate ? "Updating " : "Building "; | |||
| log(action + archiveType + ": " + zipFile.getAbsolutePath()); | |||
| ZipOutputStream zOut = | |||
| @@ -416,16 +417,16 @@ public class Zip extends MatchingTask { | |||
| } | |||
| } | |||
| } catch (IOException ioe) { | |||
| String msg = "Problem creating " + archiveType + ": " | |||
| String msg = "Problem creating " + archiveType + ": " | |||
| + ioe.getMessage(); | |||
| // delete a bogus ZIP file | |||
| if (!zipFile.delete()) { | |||
| // delete a bogus ZIP file (but only if it's not the original one) | |||
| if ((!doUpdate || renamedFile != null) && !zipFile.delete()) { | |||
| msg += " (and the archive is probably corrupt but I could not " | |||
| + "delete it)"; | |||
| } | |||
| if (doUpdate) { | |||
| if (doUpdate && renamedFile != null) { | |||
| if (!renamedFile.renameTo(zipFile)) { | |||
| msg += " (and I couldn't rename the temporary file " + | |||
| renamedFile.getName() + " back)"; | |||
| @@ -453,7 +454,7 @@ public class Zip extends MatchingTask { | |||
| * <p>Ensure parent directories have been added as well. | |||
| */ | |||
| protected void addFiles(FileScanner scanner, ZipOutputStream zOut, | |||
| String prefix, String fullpath) | |||
| String prefix, String fullpath) | |||
| throws IOException { | |||
| if (prefix.length() > 0 && fullpath.length() > 0) { | |||
| @@ -504,7 +505,7 @@ public class Zip extends MatchingTask { | |||
| } | |||
| protected void addZipEntries(ZipFileSet fs, DirectoryScanner ds, | |||
| ZipOutputStream zOut, String prefix, | |||
| ZipOutputStream zOut, String prefix, | |||
| String fullpath) | |||
| throws IOException { | |||
| log("adding zip entries: " + fullpath, Project.MSG_VERBOSE); | |||
| @@ -533,7 +534,7 @@ public class Zip extends MatchingTask { | |||
| } else { | |||
| addParentDirs(null, vPath, zOut, prefix); | |||
| if (!entry.isDirectory()) { | |||
| zipFile(in, zOut, prefix + vPath, entry.getTime(), | |||
| zipFile(in, zOut, prefix + vPath, entry.getTime(), | |||
| zipSrc); | |||
| } | |||
| } | |||
| @@ -569,7 +570,7 @@ public class Zip extends MatchingTask { | |||
| // In this case using java.util.zip will not work | |||
| // because it does not permit a zero-entry archive. | |||
| // Must create it manually. | |||
| log("Note: creating empty " + archiveType + " archive " + zipFile, | |||
| log("Note: creating empty " + archiveType + " archive " + zipFile, | |||
| Project.MSG_INFO); | |||
| OutputStream os = null; | |||
| try { | |||
| @@ -584,7 +585,7 @@ public class Zip extends MatchingTask { | |||
| os.write(empty); | |||
| } catch (IOException ioe) { | |||
| throw new BuildException("Could not create empty ZIP archive " | |||
| + "(" + ioe.getMessage() + ")", ioe, | |||
| + "(" + ioe.getMessage() + ")", ioe, | |||
| location); | |||
| } finally { | |||
| if (os != null) { | |||
| @@ -607,7 +608,7 @@ public class Zip extends MatchingTask { | |||
| * already); false if archive creation should proceed | |||
| * @exception BuildException if it likes | |||
| */ | |||
| protected boolean isUpToDate(FileScanner[] scanners, File zipFile) | |||
| protected boolean isUpToDate(FileScanner[] scanners, File zipFile) | |||
| throws BuildException { | |||
| String[][] fileNames = grabFileNames(scanners); | |||
| File[] files = grabFiles(scanners, fileNames); | |||
| @@ -627,7 +628,7 @@ public class Zip extends MatchingTask { | |||
| } else { | |||
| for (int i = 0; i < files.length; ++i) { | |||
| if (files[i].equals(zipFile)) { | |||
| throw new BuildException("A zip file cannot include " | |||
| throw new BuildException("A zip file cannot include " | |||
| + "itself", location); | |||
| } | |||
| } | |||
| @@ -716,12 +717,12 @@ public class Zip extends MatchingTask { | |||
| log(vPath + " already added, skipping", Project.MSG_INFO); | |||
| return; | |||
| } else if (duplicate.equals("fail")) { | |||
| throw new BuildException("Duplicate file " + vPath | |||
| throw new BuildException("Duplicate file " + vPath | |||
| + " was found and the duplicate " | |||
| + "attribute is 'fail'."); | |||
| } else { | |||
| // duplicate equal to add, so we continue | |||
| log("duplicate file " + vPath | |||
| log("duplicate file " + vPath | |||
| + " found, adding.", Project.MSG_VERBOSE); | |||
| } | |||
| } else { | |||
| @@ -791,7 +792,7 @@ public class Zip extends MatchingTask { | |||
| protected void zipFile(File file, ZipOutputStream zOut, String vPath) | |||
| throws IOException { | |||
| if (file.equals(zipFile)) { | |||
| throw new BuildException("A zip file cannot include itself", | |||
| throw new BuildException("A zip file cannot include itself", | |||
| location); | |||
| } | |||
| @@ -74,8 +74,8 @@ import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| /** | |||
| * Change log task. | |||
| * The task will examine the output of cvs log and group related changes together. | |||
| * Examines the output of cvs log and group related changes together. | |||
| * | |||
| * It produces an XML output representing the list of changes. | |||
| * <PRE> | |||
| * <FONT color=#0000ff><!-- Root element --></FONT> | |||
| @@ -217,7 +217,7 @@ public class ChangeLogTask extends Task { | |||
| /** | |||
| * Execute task | |||
| * | |||
| * @exception BuildException if something goes wrong executing the | |||
| * @exception BuildException if something goes wrong executing the | |||
| * cvs command | |||
| */ | |||
| public void execute() throws BuildException { | |||
| @@ -70,8 +70,8 @@ import java.io.UnsupportedEncodingException; | |||
| import java.util.Vector; | |||
| /** | |||
| * Cvs tag diff. | |||
| * The task will examine the output of cvs rdiff between two tags. | |||
| * Examines the output of cvs rdiff between two tags. | |||
| * | |||
| * It produces an XML output representing the list of changes. | |||
| * <PRE> | |||
| * <!-- Root element --> | |||
| @@ -61,7 +61,7 @@ checksum=org.apache.tools.ant.taskdefs.Checksum | |||
| waitfor=org.apache.tools.ant.taskdefs.WaitFor | |||
| input=org.apache.tools.ant.taskdefs.Input | |||
| loadfile=org.apache.tools.ant.taskdefs.LoadFile | |||
| manifest=org.apache.tools.ant.taskdefs.Manifest | |||
| manifest=org.apache.tools.ant.taskdefs.ManifestTask | |||
| loadproperties=org.apache.tools.ant.taskdefs.LoadProperties | |||
| basename=org.apache.tools.ant.taskdefs.Basename | |||
| dirname=org.apache.tools.ant.taskdefs.Dirname | |||
| @@ -119,12 +119,15 @@ stylebook=org.apache.tools.ant.taskdefs.optional.StyleBook | |||
| test=org.apache.tools.ant.taskdefs.optional.Test | |||
| pvcs=org.apache.tools.ant.taskdefs.optional.pvcs.Pvcs | |||
| p4change=org.apache.tools.ant.taskdefs.optional.perforce.P4Change | |||
| p4delete=org.apache.tools.ant.taskdefs.optional.perforce.P4Delete | |||
| p4label=org.apache.tools.ant.taskdefs.optional.perforce.P4Label | |||
| p4have=org.apache.tools.ant.taskdefs.optional.perforce.P4Have | |||
| p4sync=org.apache.tools.ant.taskdefs.optional.perforce.P4Sync | |||
| p4edit=org.apache.tools.ant.taskdefs.optional.perforce.P4Edit | |||
| p4submit=org.apache.tools.ant.taskdefs.optional.perforce.P4Submit | |||
| p4counter=org.apache.tools.ant.taskdefs.optional.perforce.P4Counter | |||
| p4revert=org.apache.tools.ant.taskdefs.optional.perforce.P4Revert | |||
| p4reopen=org.apache.tools.ant.taskdefs.optional.perforce.P4Reopen | |||
| javah=org.apache.tools.ant.taskdefs.optional.Javah | |||
| ccupdate=org.apache.tools.ant.taskdefs.optional.clearcase.CCUpdate | |||
| cccheckout=org.apache.tools.ant.taskdefs.optional.clearcase.CCCheckout | |||
| @@ -70,7 +70,7 @@ import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.Path; | |||
| /** | |||
| * ANTLR task. | |||
| * Invokes the ANTLR Translator generator on a grammar file. | |||
| * | |||
| * @author <a href="mailto:emeade@geekfarm.org">Erik Meade</a> | |||
| * @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a> | |||
| @@ -121,32 +121,38 @@ public class ANTLR extends Task { | |||
| commandline.setClassname("antlr.Tool"); | |||
| } | |||
| /** | |||
| * The grammar file to process. | |||
| */ | |||
| public void setTarget(File target) { | |||
| log("Setting target to: " + target.toString(), Project.MSG_VERBOSE); | |||
| this.target = target; | |||
| } | |||
| /** | |||
| * The directory to write the generated files to. | |||
| */ | |||
| public void setOutputdirectory(File outputDirectory) { | |||
| log("Setting output directory to: " + outputDirectory.toString(), Project.MSG_VERBOSE); | |||
| this.outputDirectory = outputDirectory; | |||
| } | |||
| /** | |||
| * Sets an optional super grammar file | |||
| * Sets an optional super grammar file. | |||
| */ | |||
| public void setGlib(String superGrammar) { | |||
| this.superGrammar = superGrammar; | |||
| } | |||
| /** | |||
| * Sets a flag to enable ParseView debugging | |||
| */ | |||
| public void setDebug(boolean enable) { | |||
| debug = enable; | |||
| } | |||
| /** | |||
| * Sets a flag to emit html | |||
| * If true, emit html | |||
| */ | |||
| public void setHtml(boolean enable) { | |||
| html = enable; | |||
| @@ -158,43 +164,46 @@ public class ANTLR extends Task { | |||
| public void setDiagnostic(boolean enable) { | |||
| diagnostic = enable; | |||
| } | |||
| /** | |||
| * Sets a flag to enable all tracing | |||
| * If true, enables all tracing. | |||
| */ | |||
| public void setTrace(boolean enable) { | |||
| trace = enable; | |||
| } | |||
| /** | |||
| * Sets a flag to enable parser tracing | |||
| * If true, enables parser tracing. | |||
| */ | |||
| public void setTraceParser(boolean enable) { | |||
| traceParser = enable; | |||
| } | |||
| /** | |||
| * Sets a flag to allow the user to enable lexer tracing | |||
| * If true, enables lexer tracing. | |||
| */ | |||
| public void setTraceLexer(boolean enable) { | |||
| traceLexer = enable; | |||
| } | |||
| /** | |||
| * Sets a flag to allow the user to enable tree walker tracing | |||
| */ | |||
| public void setTraceTreeWalker(boolean enable) { | |||
| traceTreeWalker = enable; | |||
| } | |||
| // we are forced to fork ANTLR since there is a call | |||
| // to System.exit() and there is nothing we can do | |||
| // right now to avoid this. :-( (SBa) | |||
| // I'm not removing this method to keep backward compatibility | |||
| /** | |||
| * @ant.attribute ignore="true" | |||
| */ | |||
| public void setFork(boolean s) { | |||
| //this.fork = s; | |||
| } | |||
| /** | |||
| * The working directory of the process | |||
| */ | |||
| @@ -203,15 +212,15 @@ public class ANTLR extends Task { | |||
| } | |||
| /** | |||
| * <code><classpath></code> allows classpath to be set | |||
| * because a directory might be given for Antlr debug... | |||
| * Adds a classpath to be set | |||
| * because a directory might be given for Antlr debug. | |||
| */ | |||
| public Path createClasspath() { | |||
| return commandline.createClasspath(project).createPath(); | |||
| } | |||
| /** | |||
| * Create a new JVM argument. Ignored if no JVM is forked. | |||
| * Adds a new JVM argument. | |||
| * @return create a new JVM argument so that any argument can be passed to the JVM. | |||
| * @see #setFork(boolean) | |||
| */ | |||
| @@ -266,7 +275,7 @@ public class ANTLR extends Task { | |||
| if (target.lastModified() > getGeneratedFile().lastModified()) { | |||
| populateAttributes(); | |||
| commandline.createArgument().setValue(target.toString()); | |||
| log(commandline.describeCommand(), Project.MSG_VERBOSE); | |||
| int err = run(commandline.getCommandline()); | |||
| if (err == 1) { | |||
| @@ -312,12 +321,12 @@ public class ANTLR extends Task { | |||
| if (target == null || !target.isFile()) { | |||
| throw new BuildException("Invalid target: " + target); | |||
| } | |||
| // validate the superGrammar file | |||
| if (superGrammar != null && !new File(superGrammar).isFile()) { | |||
| throw new BuildException("Invalid super grammar file: " + superGrammar); | |||
| } | |||
| // if no output directory is specified, used the target's directory | |||
| if (outputDirectory == null) { | |||
| String fileName = target.toString(); | |||
| @@ -66,6 +66,8 @@ import org.w3c.dom.Element; | |||
| import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import java.util.Properties; | |||
| import java.io.ByteArrayOutputStream; | |||
| @@ -77,12 +77,12 @@ import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Reference; | |||
| /** | |||
| * Instruments Java classes with <a href="http://www.reliable-systems.com/tools/">iContract</a> | |||
| * DBC preprocessor. | |||
| * Instruments Java classes with iContract DBC preprocessor. | |||
| * <br/> | |||
| * The task can generate a properties file for <a href="http://hjem.sol.no/hellesoy/icontrol.html">iControl</a>, | |||
| * a graphical user interface that lets you turn on/off assertions. iControl generates a control file that you can refer to | |||
| * from this task using the controlfile attribute. | |||
| * iContract is at <a href="http://www.reliable-systems.com/tools/">http://www.reliable-systems.com/tools/</a> | |||
| * <p/> | |||
| * Thanks to Rainer Schmitz for enhancements and comments. | |||
| * | |||
| @@ -226,12 +226,6 @@ public class IContract extends MatchingTask { | |||
| private static final String ICONTROL_PROPERTIES_HEADER = | |||
| " You might want to set classRoot to point to your normal compilation class root directory."; | |||
| private static final String ICONTROL_PROPERTIES_MESSAGE = | |||
| "You should probably modify icontrol.properties' classRoot to where comiled (uninstrumented) classes go."; | |||
| /** \ on windows, / on linux/unix */ | |||
| private static final String ps = System.getProperty("path.separator"); | |||
| /** compiler to use for instrumenation */ | |||
| private String icCompiler = "javac"; | |||
| @@ -274,9 +268,6 @@ public class IContract extends MatchingTask { | |||
| /** The -q option */ | |||
| private boolean quiet = false; | |||
| /** Indicates whether or not to use internal compilation */ | |||
| private boolean internalcompilation = false; | |||
| /** The -m option */ | |||
| private File controlFile = null; | |||
| @@ -305,9 +296,8 @@ public class IContract extends MatchingTask { | |||
| /** Regular compilation class root */ | |||
| private File classDir = null; | |||
| /** | |||
| * Sets the source directory | |||
| * Sets the source directory. | |||
| * | |||
| * @param srcDir the source directory | |||
| */ | |||
| @@ -317,9 +307,9 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Sets the class directory (uninstrumented classes) | |||
| * Sets the class directory (uninstrumented classes). | |||
| * | |||
| * @param srcDir the source directory | |||
| * @param classDir the source directory | |||
| */ | |||
| public void setClassdir(File classDir) { | |||
| this.classDir = classDir; | |||
| @@ -327,7 +317,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Sets the instrumentation directory | |||
| * Sets the instrumentation directory. | |||
| * | |||
| * @param instrumentDir the source directory | |||
| */ | |||
| @@ -340,7 +330,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Sets the build directory for instrumented classes | |||
| * Sets the build directory for instrumented classes. | |||
| * | |||
| * @param buildDir the build directory | |||
| */ | |||
| @@ -350,7 +340,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Sets the build directory for repository classes | |||
| * Sets the build directory for repository classes. | |||
| * | |||
| * @param repositoryDir the source directory | |||
| */ | |||
| @@ -363,9 +353,9 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Sets the build directory for instrumented classes | |||
| * Sets the build directory for instrumented classes. | |||
| * | |||
| * @param buildDir the build directory | |||
| * @param repBuildDir the build directory | |||
| */ | |||
| public void setRepbuilddir(File repBuildDir) { | |||
| this.repBuildDir = repBuildDir; | |||
| @@ -373,7 +363,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Turns on/off precondition instrumentation | |||
| * Turns on/off precondition instrumentation. | |||
| * | |||
| * @param pre true turns it on | |||
| */ | |||
| @@ -384,7 +374,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Turns on/off postcondition instrumentation | |||
| * Turns on/off postcondition instrumentation. | |||
| * | |||
| * @param post true turns it on | |||
| */ | |||
| @@ -395,7 +385,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Turns on/off invariant instrumentation | |||
| * Turns on/off invariant instrumentation. | |||
| * | |||
| * @param invariant true turns it on | |||
| */ | |||
| @@ -406,7 +396,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Sets the Throwable (Exception) to be thrown on assertion violation | |||
| * Sets the Throwable (Exception) to be thrown on assertion violation. | |||
| * | |||
| * @param clazz the fully qualified Throwable class name | |||
| */ | |||
| @@ -474,9 +464,12 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Creates a nested classpath element | |||
| * Sets the classpath. | |||
| * | |||
| * @return the nested classpath element | |||
| * @todo this overwrites the classpath so only one | |||
| * effective classpath element would work. This | |||
| * is not how we do this elsewhere. | |||
| */ | |||
| public Path createClasspath() { | |||
| if (classpath == null) { | |||
| @@ -497,7 +490,7 @@ public class IContract extends MatchingTask { | |||
| /** | |||
| * Decides whether or not to update iControl properties file | |||
| * If true, updates iControl properties file | |||
| * | |||
| * @param updateIcontrol true if iControl properties file should be | |||
| * updated | |||
| @@ -71,8 +71,9 @@ import java.util.StringTokenizer; | |||
| import java.util.Enumeration; | |||
| /** | |||
| * Task to generate JNI header files using javah. This task can take the following | |||
| * arguments: | |||
| * Generates JNI header files using javah. | |||
| * | |||
| * This task can take the following arguments: | |||
| * <ul> | |||
| * <li>classname - the fully-qualified name of a class</li> | |||
| * <li>outputFile - Concatenates the resulting header or source files for all | |||
| @@ -118,10 +119,16 @@ public class Javah extends Task { | |||
| //private Path extdirs; | |||
| private static String lSep = System.getProperty("line.separator"); | |||
| /** | |||
| * the fully-qualified name of the class (or classes, separated by commas). | |||
| */ | |||
| public void setClass(String cls) { | |||
| this.cls = cls; | |||
| } | |||
| /** | |||
| * Adds class to process. | |||
| */ | |||
| public ClassArgument createClass() { | |||
| ClassArgument ga = new ClassArgument(); | |||
| classes.addElement(ga); | |||
| @@ -152,6 +159,9 @@ public class Javah extends Task { | |||
| this.destDir = destDir; | |||
| } | |||
| /** | |||
| * the classpath to use. | |||
| */ | |||
| public void setClasspath(Path src) { | |||
| if (classpath == null) { | |||
| classpath = src; | |||
| @@ -159,6 +169,10 @@ public class Javah extends Task { | |||
| classpath.append(src); | |||
| } | |||
| } | |||
| /** | |||
| * Path to use for classpath. | |||
| */ | |||
| public Path createClasspath() { | |||
| if (classpath == null) { | |||
| classpath = new Path(project); | |||
| @@ -167,12 +181,16 @@ public class Javah extends Task { | |||
| } | |||
| /** | |||
| * Adds a reference to a CLASSPATH defined elsewhere. | |||
| * Adds a reference to a classpath defined elsewhere. | |||
| * @todo this needs to be documented in the HTML docs | |||
| */ | |||
| public void setClasspathRef(Reference r) { | |||
| createClasspath().setRefid(r); | |||
| } | |||
| /** | |||
| * location of bootstrap class files. | |||
| */ | |||
| public void setBootclasspath(Path src) { | |||
| if (bootclasspath == null) { | |||
| bootclasspath = src; | |||
| @@ -180,6 +198,10 @@ public class Javah extends Task { | |||
| bootclasspath.append(src); | |||
| } | |||
| } | |||
| /** | |||
| * Adds path to bootstrap class files. | |||
| */ | |||
| public Path createBootclasspath() { | |||
| if (bootclasspath == null) { | |||
| bootclasspath = new Path(project); | |||
| @@ -188,7 +210,8 @@ public class Javah extends Task { | |||
| } | |||
| /** | |||
| * Adds a reference to a CLASSPATH defined elsewhere. | |||
| * Adds a reference to a classpath defined elsewhere. | |||
| * @todo this needs to be documented in the HTML | |||
| */ | |||
| public void setBootClasspathRef(Reference r) { | |||
| createBootclasspath().setRefid(r); | |||
| @@ -217,35 +240,39 @@ public class Javah extends Task { | |||
| //} | |||
| /** | |||
| * Set the output file name. | |||
| * Concatenates the resulting header or source files for all | |||
| * the classes listed into this file. | |||
| */ | |||
| public void setOutputFile(File outputFile) { | |||
| this.outputFile = outputFile; | |||
| } | |||
| /** | |||
| * Set the force-write flag. | |||
| * If true, output files should always be written (JDK1.2 only). | |||
| */ | |||
| public void setForce(boolean force) { | |||
| this.force = force; | |||
| } | |||
| /** | |||
| * Set the old flag. | |||
| * If true, specifies that old JDK1.0-style header files should be | |||
| * generated. | |||
| * (otherwise output file contain JNI-style native method function prototypes) (JDK1.2 only) | |||
| */ | |||
| public void setOld(boolean old) { | |||
| this.old = old; | |||
| } | |||
| /** | |||
| * Set the stubs flag. | |||
| * If true, generate C declarations from the Java object file (used with old). | |||
| */ | |||
| public void setStubs(boolean stubs) { | |||
| this.stubs = stubs; | |||
| } | |||
| /** | |||
| * Set the verbose flag. | |||
| * If true, causes Javah to print a message concerning | |||
| * the status of the generated files. | |||
| */ | |||
| public void setVerbose(boolean verbose) { | |||
| this.verbose = verbose; | |||
| @@ -67,7 +67,7 @@ import org.apache.tools.ant.util.SourceFileScanner; | |||
| import java.io.File; | |||
| /** | |||
| * Convert files from native encodings to ascii. | |||
| * Converts files from native encodings to ASCII. | |||
| * | |||
| * @author <a href="asudell@acm.org">Drew Sudell</a> | |||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | |||
| @@ -73,7 +73,8 @@ import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| /** | |||
| * Task to compile NetRexx source files. This task can take the following | |||
| * Compiles NetRexx source files. | |||
| * This task can take the following | |||
| * arguments: | |||
| * <ul> | |||
| * <li>binary</li> | |||
| @@ -517,9 +518,8 @@ public class NetRexxC extends MatchingTask { | |||
| /** | |||
| * Whether the task should suppress the "FooException is in SIGNALS list | |||
| * but is not signalled within the method", which is sometimes rather | |||
| * useless. The warning is logged as verbose message, though. | |||
| * Tells whether we should filter out any deprecation-messages | |||
| * of the compiler out. | |||
| */ | |||
| public void setSuppressDeprecation(boolean suppressDeprecation) { | |||
| this.suppressDeprecation = suppressDeprecation; | |||
| @@ -78,10 +78,9 @@ import java.text.ParseException; | |||
| import java.text.DecimalFormat; | |||
| /** | |||
| *PropertyFile task uses java.util.Properties to modify integer, String and | |||
| *Date settings in a property file.<p> | |||
| * | |||
| *Modifies settings in a property file. | |||
| * | |||
| * <p> | |||
| *The following is an example of its usage: | |||
| * <ul><target name="setState"><br> | |||
| * <ul><property<br> | |||
| @@ -240,10 +239,16 @@ public class PropertyFile extends Task { | |||
| } | |||
| } | |||
| /** | |||
| * Location of the property file to be edited; required. | |||
| */ | |||
| public void setFile(File file) { | |||
| propertyfile = file; | |||
| } | |||
| /** | |||
| * optional header comment for the file | |||
| */ | |||
| public void setComment(String hdr) { | |||
| comment = hdr; | |||
| } | |||
| @@ -280,8 +285,9 @@ public class PropertyFile extends Task { | |||
| } | |||
| } | |||
| /* | |||
| /** | |||
| * Returns whether the given parameter has been defined. | |||
| * @todo IDEA is saying this method is never used - remove? | |||
| */ | |||
| private boolean checkParam(String param) { | |||
| return !((param == null) || (param.equals("null"))); | |||
| @@ -308,27 +314,69 @@ public class PropertyFile extends Task { | |||
| private String pattern = null; | |||
| private int field = Calendar.DATE; | |||
| /** | |||
| * Name of the property name/value pair | |||
| */ | |||
| public void setKey(String value) { | |||
| this.key = value; | |||
| } | |||
| /** | |||
| * Value to set (=), to add (+) or subtract (-) | |||
| */ | |||
| public void setValue(String value) { | |||
| this.value = value; | |||
| } | |||
| /** | |||
| * operation to apply. | |||
| * "+" or "=" | |||
| *(default) for all datatypes; "-" for date and int only)\. | |||
| */ | |||
| public void setOperation(Operation value) { | |||
| this.operation = Operation.toOperation(value.getValue()); | |||
| } | |||
| /** | |||
| * Regard the value as : int, date or string (default) | |||
| */ | |||
| public void setType(Type value) { | |||
| this.type = Type.toType(value.getValue()); | |||
| } | |||
| /** | |||
| * Initial value to set for a property if it is not | |||
| * already defined in the property file. | |||
| * For type date, an additional keyword is allowed: "now" | |||
| */ | |||
| public void setDefault(String value) { | |||
| this.defaultValue = value; | |||
| } | |||
| /** | |||
| * For int and date type only. If present, Values will | |||
| * be parsed and formatted accordingly. | |||
| */ | |||
| public void setPattern(String value) { | |||
| this.pattern = value; | |||
| } | |||
| /** | |||
| * @since 1.15, Ant 1.5 | |||
| * The unit of the value to be applied to date +/- operations. | |||
| * Valid Values are: | |||
| * <ul> | |||
| * <li>millisecond</li> | |||
| * <li>second</li> | |||
| * <li>minute</li> | |||
| * <li>hour</li> | |||
| * <li>day (default)</li> | |||
| * <li>week</li> | |||
| * <li>month</li> | |||
| * <li>year</li> | |||
| * </ul> | |||
| * This only applies to date types using a +/- operation. | |||
| * @since Ant 1.5 | |||
| */ | |||
| public void setUnit(PropertyFile.Unit unit) { | |||
| field = unit.getCalendarField(); | |||
| @@ -598,8 +646,8 @@ public class PropertyFile extends Task { | |||
| /** | |||
| * Borrowed from Tstamp | |||
| * | |||
| * @since 1.15, Ant 1.5 | |||
| * @todo share all this time stuff across many tasks as a datetime datatype | |||
| * @since Ant 1.5 | |||
| */ | |||
| public static class Unit extends EnumeratedAttribute { | |||
| @@ -97,12 +97,17 @@ public class RenameExtensions extends MatchingTask { | |||
| globType.setValue("glob"); | |||
| } | |||
| /** store fromExtension **/ | |||
| /** | |||
| * The string that files must end in to be renamed | |||
| **/ | |||
| public void setFromExtension(String from) { | |||
| fromExtension = from; | |||
| } | |||
| /** store toExtension **/ | |||
| /** | |||
| * The string that renamed files will end with on | |||
| * completion | |||
| */ | |||
| public void setToExtension(String to) { | |||
| toExtension = to; | |||
| } | |||