ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional ANTLRTest.java
Date Sun, 18 Feb 2001 13:44:44 GMT
conor       01/02/18 05:44:44

  Modified:    .        WHATSNEW build.xml
               docs/manual credits.html optionaltasklist.html toc.html
               docs/manual/CoreTasks filter.html javac.html tar.html
               docs/manual/Integration VAJAntTool.html
               docs/manual/OptionalTasks mparse.html
               src/main/org/apache/tools/ant AntClassLoader.java
                        ProjectHelper.java
               src/main/org/apache/tools/ant/taskdefs Execute.java
                        ExecuteJava.java defaults.properties
               src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        DescriptorHandler.java WeblogicDeploymentTool.java
               src/main/org/apache/tools/ant/taskdefs/optional/ide
                        VAJImport.java
               src/main/org/apache/tools/ant/taskdefs/optional/metamata
                        MParse.java
               src/script antRun.bat
               src/testcases/org/apache/tools/ant/taskdefs
                        TaskdefsTest.java
               src/testcases/org/apache/tools/ant/taskdefs/optional
                        ANTLRTest.java
  Added:       docs/manual/OptionalTasks vsslabel.html
               src/etc/testcases/core/include/basic include.inc include.xml
                        relative.xml
               src/etc/testcases/core/include/frag#ment include.inc
                        include.xml relative.xml simple.xml
               src/etc/testcases/taskdefs property.xml
               src/testcases/org/apache/tools/ant IncludeTest.java
               src/testcases/org/apache/tools/ant/taskdefs
                        PropertyTest.java
  Log:
  Merge 1.3 branch changes into MAIN
  
  Revision  Changes    Path
  1.76      +5 -1      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- WHATSNEW	2001/02/13 12:31:46	1.75
  +++ WHATSNEW	2001/02/18 13:44:39	1.76
  @@ -1,4 +1,4 @@
  -Changes from Ant 1.2 to Ant 1.3 Beta 1
  +Changes from Ant 1.2 to Ant 1.3 Beta 2
   ===========================================
   
   Changes that could break older environments:
  @@ -71,6 +71,10 @@
     may be controlled.
   
   * wlrun, wlstop and ejbjar now support Weblogic 6.0
  +
  +* The MPasre task has been updated to work with MParse 2.0
  +
  +* The documentation has been significantly updated.
   
   
   Fixed bugs:
  
  
  
  1.134     +2 -1      jakarta-ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/build.xml,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- build.xml	2001/02/15 13:39:58	1.133
  +++ build.xml	2001/02/18 13:44:39	1.134
  @@ -298,7 +298,8 @@
   
       <copy todir="${dist.lib}" file="${lib.dir}/optional/README"/>
       
  -    <copy todir="${dist.docs}">
  +    <copy todir="${dist.docs}"
  +          filtering="on">
         <fileset dir="${docs.dir}"/>
       </copy>
   
  
  
  
  1.3       +2 -1      jakarta-ant/docs/manual/credits.html
  
  Index: credits.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/credits.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- credits.html	2001/02/13 12:31:48	1.2
  +++ credits.html	2001/02/18 13:44:39	1.3
  @@ -30,11 +30,12 @@
     <li>Jon S. Stevens (<a href="mailto:jon@latchkey.com">jon@latchkey.com</a>)</li>
     <li>Roger Vaughn (<a href="mailto:rvaughn@seaconinc.com">rvaughn@seaconinc.com</a>)</li>
     <li>Dave Walend (<a href="mailto:dwalend@cs.tufts.edu">dwalend@cs.tufts.edu</a>)</li>
  +  <li>Phillip Wells (<a href="mailto:philwells@rocketmail.com">philwells@rocketmail.com</a>)</li>
   </ul>
   
   <center>
   <p>Version: @VERSION@<br>
  -$Id: credits.html,v 1.2 2001/02/13 12:31:48 conor Exp $</p>
  +$Id: credits.html,v 1.3 2001/02/18 13:44:39 conor Exp $</p>
   </center>
   <hr>
   <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  
  
  
  1.3       +2 -0      jakarta-ant/docs/manual/optionaltasklist.html
  
  Index: optionaltasklist.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/optionaltasklist.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- optionaltasklist.html	2001/02/13 12:31:49	1.2
  +++ optionaltasklist.html	2001/02/18 13:44:39	1.3
  @@ -33,7 +33,9 @@
   <a href="OptionalTasks/stylebook.html">Stylebook</a><br>
   <a href="OptionalTasks/test.html">Test</a><br>
   <a href="OptionalTasks/telnet.html">Telnet</a><br>
  +<a href="Integration/VAJAntTool.html#tasks">Visual Age for Java Tasks</a><br>
   <a href="OptionalTasks/vssget.html">VssGet</a><br>
  +<a href="OptionalTasks/vsslabel.html">VssLabel</a><br>
   
   </body>
   </html>
  
  
  
  1.3       +1 -1      jakarta-ant/docs/manual/toc.html
  
  Index: toc.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/toc.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- toc.html	2001/02/13 12:31:49	1.2
  +++ toc.html	2001/02/18 13:44:39	1.3
  @@ -17,7 +17,7 @@
   <a href="ide.html" target="navFrame">IDE Integration</a><br>
   <a href="develop.html">Developing with Ant</a><br>
   <a href="resources.html">Ant Resources</a><br>
  -<a href="License">LICENSE</a><br>
  +<a href="LICENSE">License</a><br>
   <a href="feedback.html">Feedback</a><br><br>
   <a href="credits.html">Authors</a><br>
   
  
  
  
  1.3       +2 -2      jakarta-ant/docs/manual/CoreTasks/filter.html
  
  Index: filter.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/filter.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- filter.html	2001/02/13 12:31:51	1.2
  +++ filter.html	2001/02/18 13:44:40	1.3
  @@ -15,7 +15,7 @@
   through the Project commodity methods.</p>
   <p>Note 1: the token string must not contain the separators chars (@).<br>
   Note 2: Either token and value attributes must be provided, or only the
  -filterfile attribute.</p>
  +filtersfile attribute.</p>
   
   <h3>Parameters</h3>
   <table border="1" cellpadding="2" cellspacing="0">
  @@ -50,7 +50,7 @@
   <p>will copy recursively all the files from the <i>src.dir</i> directory into
   the <i>dest.dir</i> directory replacing all the occurences of the string <i>@year@</i>
   with <i>2000.</i></p>
  -<pre>  &lt;filter filterfile=&quot;deploy_env.properties&quot;/&gt;</pre>
  +<pre>  &lt;filter filtersfile=&quot;deploy_env.properties&quot;/&gt;</pre>
   will read all property entries from the <i>deploy_env.properties</i> file
   and set these as filters.
   
  
  
  
  1.4       +1 -1      jakarta-ant/docs/manual/CoreTasks/javac.html
  
  Index: javac.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/javac.html,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- javac.html	2001/02/14 10:58:24	1.3
  +++ javac.html	2001/02/18 13:44:40	1.4
  @@ -157,7 +157,7 @@
     <tr>
       <td valign="top">includeAntRuntime</td> 
       <td valign="top">whether to include the Ant run-time libraries;
  -      defaults to <code>no</code>.</td>
  +      defaults to <code>yes</code>.</td>
       <td align="center" valign="top">No</td>
     </tr>
     <tr>
  
  
  
  1.3       +23 -13    jakarta-ant/docs/manual/CoreTasks/tar.html
  
  Index: tar.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/tar.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tar.html	2001/02/13 12:31:52	1.2
  +++ tar.html	2001/02/18 13:44:40	1.3
  @@ -22,16 +22,24 @@
   to be applied to the tar entries. This is useful, for example, when preparing archives for 
   Unix systems where some files need to have execute permission.</p>
   
  -<p>The POSIX tar standard does not support path lengths greater than 100 characters. The
  -behaviour of the tar task when it encounters such paths is controlled by the <i>longfile</i>
  -attribute. If this attribute is not present, the tar task will throw an exception upon encountering 
  -a long path. If the longfile attribute is set to <code>truncate</code>, any long paths will be 
  -truncated to the 100 character maximum length prior to adding to the archive. This ensures that 
  -the file will be in the archive and that the archive can be untarred by any compliant version of 
  -tar. If the loss of path information is not acceptable, and it rarely is, longfile may be set to 
  -the value <code>gnu</code>. The tar task will then produce a GNU tar file which can have 
  -arbitrary length paths. Note however, that the resulting archive will only be able to be untarred 
  -with GNU tar.</p>
  +<p>Early versions of tar did not support path lengths greater than 100 
  +characters. Modern versions of tar do so, but in incompatible ways.
  +The behaviour of the tar task when it encounters such paths is 
  +controlled by the <i>longfile</i> attribute. 
  +If the longfile attribute is set to <code>fail</code>, any long paths will 
  +cause the tar task to fail.  If the longfile attribute is set to 
  +<code>truncate</code>, any long paths will be truncated to the 100 character 
  +maximum length prior to adding to the archive. If the value of the longfile 
  +attribute is set to <code>omit</code> then files containing long paths will be 
  +omitted from the archive.  Either option ensures that the archive can be 
  +untarred by any compliant version of tar. If the loss of path or file 
  +information is not acceptable, and it rarely is, longfile may be set to the 
  +value <code>gnu</code>. The tar task will then produce a GNU tar file which 
  +can have arbitrary length paths. Note however, that the resulting archive will 
  +only be able to be untarred with GNU tar.  The default for the longfile 
  +attribute is <code>warn</code> which behaves just like the gnu option except 
  +that it produces a warning for each file path encountered that does not match 
  +the limit.</p>
   
   <p>Note that this task does not perform compression. You might want to use the 
   <a href="gzip.html">GZip</a> task to prepare a .tar.gz package.</p>
  @@ -55,9 +63,11 @@
     </tr>
     <tr>
       <td valign="top">longfile</td>
  -    <td valign="top">Controls how long paths are handled. Allowable 
  -                     values are &quot;gnu&quot; and &quot;truncate&quot;</td>
  -    <td align="center" valign="top">No</td>
  +    <td valign="top">Determines how long files (&gt;100 chars) are to be 
  +       handled.  Allowable values are &quot;truncate&quot;, &quot;fail&quot;, 
  +       &quot;warn&quot;, &quot;omil&quot; and &quot;gnu&quot;.  Default is 
  +       &quot;warn&quot;.
  +    <td valign="top" align="center">No</td>
     </tr>
     <tr>
       <td valign="top">includes</td>
  
  
  
  1.3       +552 -97   jakarta-ant/docs/manual/Integration/VAJAntTool.html
  
  Index: VAJAntTool.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/Integration/VAJAntTool.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- VAJAntTool.html	2001/02/13 12:31:54	1.2
  +++ VAJAntTool.html	2001/02/18 13:44:40	1.3
  @@ -3,133 +3,588 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <meta http-equiv="Content-Language" content="en-us">
  -  <title>Ant VisualAge for Java Tool Integration</title>
  +  <title>Visual Age for Java Tasks and Plugin User Manual</title>
   </head>
   <body>
  -<h1>Ant PlugIn for VisualAge for Java</h1>
  -<a name="authors"></a>by
  -<ul>
  -  <li>Wolf Siberski (<a href="mailto:wolf.siberski@tui.de">
  -    wolf.siberski@tui.de</a>)</li>
  -  <li>Christoph Wilhelms (<a href="mailto:christoph.wilhelms@tui.de">
  -    christoph.wilhelms@tui.de</a>)</li>
  +
  +<h1>Visual Age for Java Tasks and Plugin User Manual</h1>
  + <a name="authors"></a>by
<ul>
  +  <li>Wolf Siberski
  +      (<a href="mailto:wolf.siberski@tui.de"> wolf.siberski@tui.de</a> )</li>
  +  <li>Christoph Wilhelms
  +      (<a href="mailto:christoph.wilhelms@tui.de"> christoph.wilhelms@tui.de</a>)</li>
   </ul>
  -Version 1.0 - 2000/11/09<br>
  +Version 1.1 - 2001/02/14<br>
   <hr>
   <h2>Table of Contents</h2>
   <ul>
     <li><a href="#introduction">Introduction</a></li>
  -  <li><a href="#installation">Installation</a></li>
  -  <li><a href="#usage">Usage</a></li>
  +  <li><a href="#tasks">The Tasks</a><a href="#introduction"></a></li>
  +  <ul>
  +    <li><a href="#vajload">VAJLoad</a></li>
  +    <li><a href="#vajexport">VAJExport</a></li>
  +    <li><a href="#vajimport">VAJImport</a></li>
  +  </ul>
  +  <li><a href="#sample_buildfile">A sample build file</a><br></li>
  +  <li><a href="#plugin">The Plugin</a></li>
  +  <ul>
  +    <li><a href="#installation">Installation</a></li>
  +    <li><a href="#usage">Usage</a></li>
  +  </ul>
     <li><a href="#faq">Frequently Asked Questions</a></li>
     <li><a href="#va_versions">Visual Age Versions</a></li>
  +  <li><a href="#history">History</a><a href="#history"></a></li>
   </ul>
  +
   <hr>
   <h2><a name="introduction"></a>Introduction</h2>
  -Visual Age for Java is a great Java IDE, but it lacks decent build support
  -for creating deliveries. On the other hand, Ant supports the build process
  -very good, but is (at least at the moment) command line based. So we decided
  -to write a small visual Ant frontend to make running Ant from VAJ possible.
  -We use the Tool API to integrate Ant in VisualAge for Java. In combination
  -with the VAJ targets (vajload, vajexport, vajimport) you can load defined
  -defined versions of projects into your workspace, export the source code,
  -compile it with an external compiler and build a jar without leaving the
  -IDE. Of course compile messages are viewed in a logging window. Concluding:
  -This tool provides a comfortable deployment VAJ has not (out of the box)!<br>
  +Visual Age for Java is a great Java IDE, but it lacks decent
  +build support; for creating deliveries. On the other hand,
  +Ant supports the build process very good, but is
  +(at least at the moment) command line based. So we decided
  +to write some tasks to access the VAJ repository and
  +a small visual Ant frontend to make running Ant from VAJ possible.
  +We use the Tool API to integrate Ant in VisualAge for Java.
  +In combination  with the VAJ tasks (vajload, vajexport, vajimport)
  +you can load defined defined  versions of projects into your workspace,
  +export the source code, compile it with an external compiler
  +and build a jar without leaving the IDE. Of course compile
  +messages are viewed in a logging window. Concluding: This
  +tool provides decent deployment support VAJ has not (out of the box).<br>
  +
  +<h2><a name="tasks"></a>The Tasks</h2>
  +At the moment there are three tasks which help integrating the VAJ repository
contents into an external build process:
  +
  +<table cellpadding="2" cellspacing="2" border="0" width="500">
  +   <tbody>
  +     <tr valign="Top">
  +       <td valign="Top"><a href="#vajload">VAJLoad</a><br>
  +       </td>
  +       <td valign="Top"> loads specified versions into the workspace<br>
  +       </td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top"><a href="#vajexport">VAJExport</a><br>
  +       </td>
  +       <td valign="Top"> exports specified packages into the file system<br>
  +       </td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top"><a href="#vajimport">VAJImport</a><br>
  +       </td>
  +       <td valign="Top"> imports specified files into the workspace<br>
  +       </td>
  +     </tr>
  +  </tbody>
  +</table>
  +These tasks are described in detail below.
  +
  +<hr>
  +<h2><a name="vajload"></a>VAJLoad</h2>
  +<h3>Description:</h3>
  +<p>Loads a specified VAJ project version into the workspace.</p>
  +
  +<h3>Parameters</h3>
  +<p>none</p>
  +
  +<h3>Parameters specified as nested elements</h3>
  +<h4>vajproject</h4>
  +<table border="1" cellpadding="2" cellspacing="0">
  +   <tbody>
  +     <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 VAJ project to load into the workspace</td>
       <td valign="Top" align="Center">yes</td>
  +     </tr>
  +     <tr>
  +       <td valign="Top">version</td>
  +       <td valign="Top">name of the requested version</td>
  +       <td valign="Top" align="Center">yes</td>
  +     </tr>
  +
  +  </tbody>
  +</table>
  +
  +<h3>Example</h3>
  +<pre>
  +&lt;vajload&gt;
  +    &lt;vajproject name="My Testcases" version="1.7beta" /&gt;
  +    &lt;vajproject name="JUnit" version="3.2" /&gt;
  +&lt;/vajload&gt;
  +</pre>
  +
  +<hr>
  +<h2><a name="vajexport"></a>VAJExport</h2>
  +
  +<h3>Description:</h3>
  +<p>Exports Java source files, class files and/or resources from the workspace
  +to the file system. Exports can be specified by giving the VAJ project
name and package name(s). This works very similar to <a href="index.html#fileset">
  +FileSets</a>. </p>
  +
  +<h3>Parameters</h3>
  +<table border="1" cellpadding="2" cellspacing="0">
  +   <tbody>
  +     <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">destdir</td>
  +       <td valign="Top">location to store the exported files</td>
  +       <td valign="Top" align="Center">yes</td>
  +     </tr>
  +     <tr>
  +       <td valign="Top">exportSources</td>
  +       <td valign="Top">export source files (default: "yes")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">exportResources</td>
  +       <td valign="Top">export resource files (default: "yes")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">exportClasses</td>
  +       <td valign="Top">export class files (default: "no")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">exportDebugInfo</td>
  +       <td valign="Top">include debug info in exported
  +       class files (default: "no")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">defaultexcludes       </td>
  +       <td valign="Top">use default excludes when exporting (default: "yes")
       <td valign="Top" align="Center">no</td>
  +     </tr>
  +  </tbody>
  +</table>
  +
  +<h3>Parameters specified as nested elements</h3>
  +
  +<h4>include</h4>
  +specifies the packages to include into the export
  +
  +<table border="1" cellpadding="2" cellspacing="0">
  +   <tbody>
  +     <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 VAJ project and package to export.<br>
  +              The first element of the name must be the project name, <br>
  +              then the package name elements separated by '/'.</td>
  +       <td valign="Top">yes</td>
  +     </tr>
  +  </tbody>
  +</table>
  +
  +<h4>exclude</h4>
  +specifies the packages to exclude from the export<br>
  +
  +<table border="1" cellpadding="2" cellspacing="0">
  +   <tbody>
  +     <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 VAJ project/package not to export</td>
  +       <td valign="Top" align="Center">yes</td>
  +     </tr>
  +  </tbody>
  +</table>
  +
  +<h3>Example</h3>
  +<pre>
  +&lt;vajexport destdir="${src.dir}" exportResources="no"&gt;
  +    &lt;include name="MyProject/**"/&gt;
  +    &lt;exclude name="MyProject/test/**"/&gt;
  +&lt;/vajexport&gt;
  +</pre>
  +This example exports all packages in the VAJ project 'MyProject', except
  +packages starting with 'test'.
  +<hr>
  +<h2><a name="vajimport"></a>VAJImport</h2>
  +
  +<h3>Description:</h3>
  +<p>Imports Java source files, class files and/or resources from the file
  +system into VAJ. These imports can be specified with a fileset. </p>
  +<h3>Parameters</h3>
  +<table border="1" cellpadding="2" cellspacing="0">
  +   <tbody>
  +     <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">vajProject</td>
  +       <td valign="Top">imported files are added to this VAJ project</td>
  +       <td valign="Top" align="Center">yes</td>
  +     </tr>
  +     <tr>
  +       <td valign="Top">importSources</td>
  +       <td valign="Top">export source files (default: "yes")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">importResources</td>
  +       <td valign="Top">export resource files (default: "yes")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">importClasses</td>
  +       <td valign="Top">export class files (default: "no")</td>
  +       <td valign="Top" align="Center">no</td>
  +     </tr>
  +  </tbody>
  +</table>
  +
  +<h3>Parameters specified as nested elements</h3>
  +
  +<h4>fileset</h4>
  +A <a href="index.html#fileset">FileSet</a> specifies the files to import.
  +
<h3>Example</h3>
  +<pre>
  +&lt;vajimport project="Test" importClasses="true"&gt;
  +    &lt;fileset dir="${import.dir}"&gt;
  +        &lt;include name="com/sample/**/*.class"/&gt;
  +        &lt;exclude name="com/sample/test/**"/&gt
  +    &lt;/fileset&gt;
  +&lt;/vajimport&gt;
  +</pre>
  +This example imports all class files in the directory ${import.dir}/com/sample
  +excluding those in the subdirectory test<br>
  +
   <hr>
  +<h2><a name="sample_buildfile"></a>A sample build file</h2>
  +This is a sample build file which builds a zip file useful for distribution
  +of the VAJ plugin. The build file exports a specific version of Ant, compiles
  +it, extracts necessary helper classes and zips everything together. This
  +is useful as complete example as well as to deploy Ant in a team where all
  +developers use VAJ. The resulting zip file must be unzipped in
  +<tt>&lt;VAJInstallDir&gt;\ide\tools\org-apache-tools-ant</tt>.
  +For more information see the <a href="#installation">installation</a> section.<br>
  +<br>
  +<pre>
  +&lt;?xml version="1.0"?&gt;
  +&lt;!-- ======================================================================= --&gt;
  +&lt;!-- Builds a binary distribution of the VAJ Ant Plugin                      --&gt;
  +&lt;!-- ======================================================================= --&gt;
  +&lt;project name="anttool" default="buildall" basedir="c:\temp\anttool"&gt;
  +
  +  &lt;property name="src.dir" value="${basedir}/src"/&gt;
  +  &lt;property name="zip.dir" value="${basedir}/dist"/&gt;
  +  &lt;property name="build.classes" value="${basedir}/classes"/&gt;
  +
  +  &lt;!-- location of the unzipped Ant source distribution  --&gt;
  +  &lt;property name="antdistribution.dir" value="u:\ant-1.3beta1"/&gt;
  +
  +  &lt;!-- VAJ install dir --&gt;
  +  &lt;property name="vaj.dir" value="C:\IBMVJava2"/&gt;
  +
  +  &lt;path id="classpath"&gt;
  +      &lt;pathelement location="${src.dir}"/&gt;
  +      &lt;pathelement location="${vaj.dir}\IDE\project_resources\IBM IDE Utility class libraries" /&gt;
  +      &lt;pathelement location="${build.classes}"/&gt;
  +  &lt;/path&gt;
  +
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Load Projects into Workspace                                        --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="load" description="load projects"&gt;
  +    &lt;vajload&gt;
  +      &lt;project name="Ant" version="1.3"/&gt;
  +      &lt;project name="Apache Oro RegExp" version="2.0.1"/&gt;
  +    &lt;/vajload&gt;
  +  &lt;/target&gt;
  +
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Creates the build dirs                                              --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="preparedirs"&gt;
  +    &lt;mkdir dir="${basedir}"/&gt;
  +    &lt;mkdir dir="${src.dir}"/&gt;
  +    &lt;mkdir dir="${zip.dir}"/&gt;
  +    &lt;mkdir dir="${build.classes}"/&gt;
  +  &lt;/target&gt;
  +
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Export from VA                                                      --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="export" depends="preparedirs" description="export projects"&gt;
  +    &lt;mkdir dir="${src.dir}"/&gt;
  +    &lt;!-- Export all Ant sources except optional tasks and the Oro sources --&gt;
  +    &lt;vajexport destdir="${src.dir}"&gt;
  +      &lt;include name="Ant/**"/&gt;
  +      &lt;exclude name="Ant/**/optional/**"/&gt;
  +      &lt;exclude name="Ant/org/apache/tools/ant/gui/**"/&gt;
  +      &lt;include name="Apache Oro*/**"/&gt;
  +    &lt;/vajexport&gt;
  +    &lt;!-- Export selected optional tasks --&gt;
  +    &lt;vajexport destdir="${src.dir}"&gt;
  +      &lt;include name="Ant/org/apache/tools/ant/taskdefs/optional/ide/**"/&gt;
  +    &lt;/vajexport&gt;
  +  &lt;/target&gt;
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Unzip necessary libraries                                           --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="expand"&gt;
  +    &lt;mkdir dir="${build.classes}"/&gt;
  +    &lt;unzip src="${antdistribution.dir}\lib\parser.jar"
  +           dest="${build.classes}"
  +    /&gt;
  +    &lt;unzip src="${antdistribution.dir}\lib\jaxp.jar"
  +           dest="${build.classes}"
  +    /&gt;
  +    &lt;delete dir="${build.classes}\META-INF" /&gt;
  +  &lt;/target&gt;
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Compile the source code                                            --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="compile" depends="expand" description="compile java sources"&gt;
  +    &lt;mkdir dir="${build.classes}"/&gt;
  +    &lt;javac srcdir="${src.dir}"
  +           destdir="${build.classes}"
  +           debug="on"
  +           deprecation="off"
  +           optimize="on" &gt;
  +      &lt;classpath refid="classpath" /&gt;
  +      &lt;include name="org/apache/**"/&gt;
  +      &lt;exclude name="**/JakartaRegexpMatcher.java"/&gt;
  +    &lt;/javac&gt;
  +  &lt;/target&gt;
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Copy resources and zip everything together                           --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="zip" depends="compile" description="creates zip distribution"&gt;
  +    &lt;copy todir="${build.classes}"&gt;
  +      &lt;fileset dir="${src.dir}"&gt;
  +          &lt;include name="org/apache/**"/&gt;
  +          &lt;exclude name="**/*.java"/&gt;
  +      &lt;/fileset&gt;
  +    &lt;/copy&gt;
  +    &lt;mkdir dir="${build.classes}/doc"/&gt;
  +    &lt;copy todir="${build.classes}/doc" overwrite="yes"&gt;
  +      &lt;fileset dir="${antdistribution.dir}/docs"&gt;
  +          &lt;include name="VAJAnttool.html, toolmenu.gif, anttool1.gif"/&gt;
  +      &lt;/fileset&gt;
  +    &lt;/copy&gt;
  +    &lt;copy file="${antdistribution.dir}/src/main/org/apache/tools/ant/taskdefs/optional/ide/default.ini" todir="${build.classes}" overwrite="yes"/&gt;
  +    &lt;mkdir dir="${zip.dir}"/&gt;
  +    &lt;zip basedir="${build.classes}" zipfile="${zip.dir}/anttool.zip" /&gt;
  +  &lt;/target&gt;
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Cleans source and class dirs                                        --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="clean" depends="preparedirs" description="removes all files from src and build tree"&gt;
  +    &lt;delete&gt;
  +      &lt;fileset dir="${src.dir}"/&gt;
  +    &lt;/delete&gt;
  +    &lt;delete&gt;
  +      &lt;fileset dir="${build.classes}"/&gt;
  +    &lt;/delete&gt;
  +    &lt;delete&gt;
  +      &lt;fileset dir="${zip.dir}"/&gt;
  +    &lt;/delete&gt;
  +  &lt;/target&gt;
  +
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;!-- Cleans the build dir, loads required project versions, exports,     --&gt;
  +  &lt;!-- compiles and zips the Plugin                                        --&gt;
  +  &lt;!-- =================================================================== --&gt;
  +  &lt;target name="buildall" depends="clean, load, export, zip" description="build all"&gt;
  +  &lt;/target&gt;
  +&lt;/project&gt;
  +</pre>
  +
  +<hr>
  +<h2><a name="plugin"></a>The Plugin</h2>
  +The tasks are usable within VAJ by running the
  +org.apache.tools.ant.Main class, but this is
  +quite inconvenient. Therefore a small GUI is
  +provided which allows selecting a build file
  +and executing its targets. This Plugin is accessible
  +from the VAJ Tools menu (see <a href="#usage">Usage</a>).
  +
  +<hr>
   <h2><a name="installation"></a>Installation</h2>
  -At the moment the installation has it's rough edges. If something described
  -below doesn't work for You, it's probably not Your fault but incomplete/wrong
  -instructions. In this case, please contact one of the <a href="#authors">
  -authors</a>.<br>
  -We assume <font face="Courier">C:\IBMVJava</font> as VAJ install directory.
  -If you have installed it elsewhere, adapt the paths below. Execute following
  -steps to get the PlugIn up and running:
  +At the moment the installation has it's rough edges. If something
  +described below doesn't work for You, it's probably not Your fault
  +but incomplete/wrong instructions. In this case, please contact one
  +of the <a href="#authors">authors</a>.
  +We assume <font face="Courier">C:\IBMVJava</font> as VAJ install
directory. If You have installed it elsewhere, adapt the pathes below.
  +Execute following steps to get the PlugIn up and running:
   <ul>
  -  <li>import the Ant sources into VAJ.</li>
  +  <li>install the Visual Age IDE Tools (via File-&gt;Quick Start-&gt;
  +      Add feature-&gt;'IBM IDE Utility class libraries'
  +  </li>
     <li>import an appropriate XML parser to VAJ (we use Xerces 1.2.0 and are
  -    happy with it). Unfortunately the XML parser delivered with VAJ (in the
  -    project 'IBM XML Parser for Java') doesn't work with Ant. You have to
  -    remove that project (temporarily) from the workspace before importing
  -    another XML implementation.</li>
  +      happy with it). Unfortunately the XML parser delivered with VAJ (in
  +      the project 'IBM XML Parser for Java') doesn't work with Ant. You have to
  +      remove that project (temporarily) from the workspace before importing another
  +      XML implementation.
  +  </li>
  +
  +  <li>import the Ant sources into VAJ.</li>
     <li>Create the directory <font face="Courier">
  -    C:\IBMVJava\ide\tools\org-apache-tools-ant</font>.</li>
  -  <li>export the Ant and XML parser class files into this directory. Be sure
  -    to select class files and resources. Sources don't have to be exported.
  -    Some optional tasks have errors and can't be exported when You don't have
  -    the necessary packages in Your workspace (e.g. junit task, ejbc task).
  -    If You need this tasks either import these packages into VAJ, too,
  -    or copy the .class files directly from the binary distribution</li>
  -  <li>copy <font face="Courier">default.ini</font> (in
  -    <font face="Courier">jakarta-ant\src\...\taskdefs\optional\ide</font>)
  -    to <font face="Courier">
  -    C:\IBMVJava\ide\tools\org-apache-tools-ant\default.ini</font>.</li>
  -  <li>if&nbsp; you want to access this help from the Workbench, create the
  -    directory <font face="Courier">
  -    C:\IBMVJava\ide\tools\org-apache-tools-ant\doc</font> and copy the files
  -    <font face="Courier">VAJAntTool.html</font>,
  -    <font face="Courier">toolmenu.gif</font> and
  -    <font face="Courier">anttool1.gif</font> to it.</li>
  +      C:\IBMVJava\ide\tools\org-apache-tools-ant</font>.
  +  </li>
  +  <li>export the Ant and XML parser class files into this directory. Be sure
      to select class files and resources. Sources don't have to be exported.
      Some optional tasks have errors and can't be exported when You
      don't have the necessary packages in Your workspace (e.g. junit
      task, ejbc task). If You need this tasks either import these packages
      into VAJ, too, or copy the .class files directly from the binary
      distribution.
  +  </li>
  +  <li>copy <font face="Courier">default.ini</font> (in <font face="Courier">
  +      jakarta-ant\src\...\taskdefs\optional\ide</font>)     to <font face="Courier">
  +      C:\IBMVJava\ide\tools\org-apache-tools-ant\default.ini</font>.
  +  </li>
  +  <li>if you want to access this help from the Workbench, create the
      directory <font face="Courier"> C:\IBMVJava\ide\tools\org-apache-tools-ant\doc</font>
  +      and copy the files     <font face="Courier">VAJAntTool.html</font>,
  +      <font face="Courier">toolmenu.gif</font> and     <font face="Courier">
  +      anttool1.gif</font> to it.
  +  </li>
     <li>VAJ has to be restarted to recognize the new tool.</li>
  -  <li>Now if You open the context menu of a project, You should see the entry
  -    'Ant Build' in the Tools submenu (see <a href="#usage">Usage</a>).</li>
  -  <li>Make sure the tool works as expected. Now You can remove Ant and the
  -    imported XML parser from Your workspace (and optionally add the IBM parser
  -    again).</li>
  +  <li>Now if You open the context menu of a project, You should see the entry
     'Ant Build' in the Tools submenu (see <a href="#usage">Usage</a>).
  +  </li>
  +  <li>Make sure the tool works as expected. Now You can remove Ant and the
      imported XML parser from Your workspace (and optionally add the
  +      IBM parser again).
  +  </li>
   </ul>
  +
   <hr>
   <h2><a name="usage"></a>Usage</h2>
  -Being sure the tool is installed correctly and your Ant build file is
  -configured, it is really easy to use.<br>
  -Go to your Workbench, select the project you want to deploy and open
  -its context menu. In the submenu <i>Tools</i> you should find the new
  -entry <i>Ant Build</i>. Click it to start the tool!
  -<center><p><img src="toolmenu.gif" border="0" height="246" width="393">
  -</p></center>
  -After a short time this frame should pop up:
  -<center><p><img src="anttool1.gif" border="0" height="222" width="389">
  -</p></center>
  -This frame contains the following:
  +Beeing sure the tool is installed correctly and your Ant build
file is configured, it is really easy to use.<br>
  +Go to your Workbench, select the project you want to deploy and
  +open its context menu. In the submenu <i>Tools</i> you should find
  +the new entry <i>Ant Build</i>. Klick it to start the tool!

<center><img src="toolmenu.gif" border="0" height="246" width="393"></center>
  +           After a short time this frame should pop up:
  +<center><img src="anttool1.gif" border="0" height="222" width="389"></center>
  +           This frame contains the following elements:
   <ul>
     <li>A menubar with some options described later</li>
     <li>The name of your selected VAJ project</li>
  -  <li>An entry field for the Ant XML buildfile with a browse [...] button. The
  -    full qualified filename, including the directory is needed here.</li>
  -  <li>A list with tasks specified in the buildfile. Until your first save of
  -    the build info (described later), this list will be empty. When loading a
  -    build file by the <i>Reload Project</i> button, this list is filled with
  -    all tasks which have a description attribute. The task you select in this
  -    list will be executed when pressing the <i>Execute Task</i> button.</li>
  +  <li>An entry field for the Ant XML buildfile with a browse [...] button.
      The full qualified filename, including the directory is needed here.
  +  </li>
  +  <li>A list with tasks specified in the buildfile. Until your first save
      of the build info (described later), this list will be empty. When
  +      loading a build file by the <i>Reload Project</i> button, this list
  +      is filled with all tasks which have a description attribute. The
  +      task you select in this list will be executed when pressing the
  +      <i> Execute Task</i> button.
  +  </li>
     <li>A pulldown box for specifying the log level.</li>
  -  <li>Three buttons. Two of them I have already described and the third one
  -    is just the <i>Close </i>button to exit our small tool!</li>
  +  <li>Three buttons. Two of them I have already described and the third one
      is just the <i>Close </i>button to exit our small tool!
  +  </li>
   </ul>
  -After you have set up your buildprocess you might find it useful to save
  -the data you've just entered, so we implemented an option to save it to
  -the repository into your selected project. Make sure that you have an open
  -edition of your project before selecting <i>Save BuildInfo To Repository</i>
  -from the <i>File</i> menu. Now your information is saved to this edition
  -of your project and will be loaded automatically the next time you start
  -<i>Ant Build</i>.<br>
  -If you have closed the log window accidentally, it can be reopened with
  -the <i>Log</i> item in the <i>File</i> menu, and if you want to know who
  -developed this, just select <i>About</i> in the <i>Help</i> menu.
  -<br>
  +After you have set up your buildprocess you might find it useful
to save the data you've just entered, so we implemented an option to
save it to the  repository into your selected project. Make sure that you
have an open edition of your project before selecting
  +<i>Save BuildInfo To Repository</i> from  the <i>File</i> menu.
  +Now your information is saved to this edition of your  project and will
  +be loaded automatically the next time you start <i>Ant Build</i>.<br>
  +If you have closed the log window accidentally, it can be reopened
with the <i>Log</i> item in the <i>File</i> menu, and if you want to
know who developed this, just select <i>About</i> in the <i>Help</i> menu.
   <hr>
   <h2><a name="faq"></a>Frequently Asked Questions</h2>
  -<p>F: I want to load, export and build more then one Visual Age project to
  -one jar! How to?<br>
  -A: The VA tasks are able to load and export several Projects all at
  -once. You can choose whatever project you like for storing the tool
  -information, it doesn't really matter.</p>
  +
  +<p><b>Q: I want to load, export and build more then one Visual Age project
  +to one jar! How to?</b><br>
  +A: The VA tasks are able to load and export several Projects all
at once. You can choose whatever project you like for storing the tool
  +information, it doesn't really matter
  +</p>
  +<p><b>Q: When I load my build file, the list of targets is empty. Why?</b><br>
  +A: You need to add the optional "description" parameter to the targets You
  +want to come up in the list. Then reload the build file in the "ant build"
  +tool. We chose to display only targets with description to allow the build
  +file developer to distinguish between targets for end users and helper targets.
  +</p>
  +<p><b>Q: Is there a sample build file available? </b><br>
  +A: Now You can find an <a href="#sample_buildfile">example</a> in this manual
  +</p>
  +
  +<p><b>Q: Why does it export my entire workspace when I've already implicitly
  +selected a project when starting the Tool?</b><br>
  +A: This selection does not carry into the buildfile you are using. Set the
  +Project name at the beginning of the "includes" parameter.
  +</p>
  +<p><b>Q: When I import Ant into my Workspace, I get Problems reported. Can I
  +ignore them?</b><br>
  +A: It depends on the problems reported, and what you want to do with Ant.
  +Problems you can't ignore:
  +<ul>
  +  <li>Classes from javax.xml.parser missing - install a compatible parser
  +      (see <a href="#installation">installation</a>)
  +  </li>
  +  <li>Classes from com.ibm.ivj.util missing - install the Visual Age IDE
  +      Utility feature  (see <a href="#installation">installation</a>).
  +  </li>
  +</ul>
  +</p>
  +
  +<p><b>Q: Why is the task name vajload when the class is called VAJLoadProjects?</b><br>
  +A: At the moment this task can load only project versions. This is reflected
  +by the class name. It may be extended to load package and class versions,
  +too, and we didn't want to let these extensions affect the build files. Therefore
  +we chose the more general name vajload as task name.
  +</p>
  +<p><b>Q: I want to use the same buildfile both within Visual Age and from the
  +command line using my regular Ant environment. What do I need to be aware
  +of?</b><br>
  +A: The three Visual Age Tasks won't work when executing Ant from the command
  +line.
  +</p>
  +<p><b>Q: How do I control the import/export of sourcefiles, compiled files and
  +project resources explicity?</b><br>
  +A: Via the Boolean values exportClasses (default false) exportSources (default
  +true) and exportResources (default true). In some situations, Resources are
  +not exported correctly without this being explicity set.
  +</p>
   <hr>
  +<h2><a name="known_problems"></a>Known Problems</h2>
  +<ul>
  +  <li>Exporting a package containing just resources doesn't work. This is
  +      a VAJ Tool API bug. Workaround: create a dummy class and set 'exportSources'
  +      to false.
  +  </li>
  +</ul>
  +<hr>
  +
   <h2><a name="va_versions"></a>VisualAge for Java Versions</h2>
  -This tool integration has been tested with versions 3.02 and 3.5 of VisualAge
  -for Java. It should run with the 2.x Versions, too, but we didn't try.
  -The graphical user interface is build with AWT so it is JDK independent
  -by now!<br>
  +This tool integration has been tested with versions 3.02 and 3.5
of VisualAge for Java. It should run with the 2.x Versions, too, but
we didn't try. The graphical user interface is build with AWT so it is
JDK independent by now.
  +<hr>
  +
  +<h2><a name="history"></a>History</h2>
  +<table cellpadding="2" cellspacing="2" border="1" width="400">
  +   <tbody>
  +     <tr valign="Top">
  +       <td valign="Top">1.0</td>
  +       <td valign="Top">2000/09/11</td>
  +       <td valign="Top">Initial Version</td>
  +     </tr>
  +     <tr valign="Top">
  +       <td valign="Top">1.1</td>
  +       <td valign="Top">2001/02/14</td>
  +       <td valign="Top">Added Task documentation and more FAQs (thanks to
  +                        Richard Bourke for the FAQ additions)
  +       </td>
  +     </tr>
  +  </tbody>
  +</table>
   <hr>
  -<center><p>Copyright &copy; 2000 Apache Software Foundation.
  -All rights Reserved.</p></center>
  +<center>Copyright &copy; 2001 Apache Software Foundation. All rights Reserved.</center>
   </body>
   </html>
  +
  
  
  
  1.3       +52 -18    jakarta-ant/docs/manual/OptionalTasks/mparse.html
  
  Index: mparse.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/mparse.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mparse.html	2001/02/13 12:31:56	1.2
  +++ mparse.html	2001/02/18 13:44:40	1.3
  @@ -1,16 +1,20 @@
  +<!-- saved from url=(0022)http://internet.e-mail -->
   <html>
   
   <head>
   <meta http-equiv="Content-Language" content="en-us">
  -<title>JavaCC Task</title>
  +<title>MParse Task</title>
   </head>
   
   <body>
   
  -<h2><a name="javacc">MParse</a></h2>
  +<h2><a name="mparse">MParse</a></h2>
  +<p>by</p>
  +<ul>
  +  <li>Stephane Bailliez (<a href="mailto:sbailliez@imediation.com">sbailliez@imediation.com</a>)</li>
  +</ul>
   <h3>Requirements</h3>
  -<p>This task requires Metamata Development environment 1.1. It does not work as
  -is with the latest 2.0 version freely available at <a href="http://www.metamata.com">Metamata</a>.</p>
  +<p>This task requires Metamata Development environment 2.0 freely available at <a href="http://www.metamata.com">Metamata</a>.</p>
   <h3>Description</h3> 
   <p>
     Invokes the Metamata <a HREF="http://www.metamata.com/parse.html">MParse</a> compiler 
  @@ -51,32 +55,62 @@
       <td valign="top" align="center">Yes</td>
     </tr>
     <tr>
  -    <td valign="top">workingdir</td>
  +    <td valign="top">verbose</td>
       <td valign="top">
  -      The temporary directory used by MParse.
  +      Enable all messages
       </td>
  -    <td valign="top" align="center">Yes</td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">debugparser</td>
  +    <td valign="top">
  +      Enables parser debugging
  +    </td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">debugscanner</td>
  +    <td valign="top">
  +      Enables scanner debugging
  +    </td>
  +    <td valign="top" align="center">No</td>
     </tr>
     <tr>
  -    <td valign="top">cleanuphack</td>
  -    <td valign="top">Remove the stale file as well as the intermediate Sun
  +    <td valign="top">cleanup</td>
  +    <td valign="top">Remove the intermediate Sun
         JavaCC file created during the transformation of the grammar file.</td>
  -    <td valign="top" align="center">No. Default to false.</td>
  +    <td valign="top" align="center">No. Default to false</td>
     </tr>
  +  <tr>
  +    <td valign="top">maxmemory</td>
  +    <td valign="top">Set the maximum memory for the JVM. this is a convenient
  +      way to set the -mx or -Xmx argument.</td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
   </table>
   <h3>Nested elements</h3>
  -<h4>userclasspath</h4>
  -<p>&nbsp;The <tt>userclasspath</tt> element is required and represents a <a href="index.html#path">PATH like
  +<h4>jvmarg</h4>
  +<p>Additional parameters may be passed to the VM via nested <code>&lt;jvmarg&gt;</code>
  +attributes. <code>&lt;jvmarg&gt;</code> allows all attributes described in <a href="index.html#arg">Command
  +line arguments</a>.</p>
  +<h4>classpath</h4>
  +<p>Sets class path (also source path unless one explicitly set). Overrides
  +METAPATH/CLASSPATH environment variables. &nbsp;The <tt>classpath</tt> element represents a <a href="index.html#path">PATH like
  +structure</a>.</p>
  +<h4>sourcepath</h4>
  +<p>Sets source path. Overrides the SOURCEPATH environment variable.&nbsp;The <tt>sourcepath</tt> element represents a <a href="index.html#path">PATH like
   structure</a>.</p>
   <h3>Example</h3>
  -<pre>  &lt;mparse target=&quot;src/Parser.jj&quot; metamatahome=&quot;c:/metamata&quot; workingdir=&quot;c:/tmp&quot;&gt;
  -    &lt;userclasspath&gt;
  -      &lt;pathelement location=&quot;./lib/dependency.jar&quot;/&gt;
  -    &lt;/userclasspath&gt;
  +<pre>  &lt;mparse target=&quot;c:/metamata/examples/parseexamples/javagrammars/singlefile/JavaParser.jj&quot;
  +          metamatahome=&quot;c:/metamata&quot; cleanup=&quot;true&quot;&gt;
  +    &lt;classpath&gt;
  +      &lt;pathelement location=&quot;c:/metamata/examples/&quot;/&gt;
  +    &lt;/classpath&gt;
     &lt;/mparse&gt;</pre>
   <p>
  -  This invokes Metamata MParse installed in <tt>c:/metamata</tt> on a grammar file <tt>src/Parser.jj</tt>
  -with a working directory in <tt>c:/tmp</tt> and a specific classpath
  +  This invokes Metamata MParse installed in <tt>c:/metamata</tt> on one of the grammar file
  +example <tt>(JavaParser.jj)</tt>
  + and cleans up the intermediate Sun JavaCC file.
   </p>
   <hr>
   
  
  
  
  1.2       +78 -0     jakarta-ant/docs/manual/OptionalTasks/vsslabel.html
  
  
  
  
  1.2       +3 -0      jakarta-ant/src/etc/testcases/core/include/basic/include.inc
  
  
  
  
  1.2       +9 -0      jakarta-ant/src/etc/testcases/core/include/basic/include.xml
  
  
  
  
  1.2       +9 -0      jakarta-ant/src/etc/testcases/core/include/basic/relative.xml
  
  
  
  
  1.2       +3 -0      jakarta-ant/src/etc/testcases/core/include/frag#ment/include.inc
  
  
  
  
  1.2       +9 -0      jakarta-ant/src/etc/testcases/core/include/frag#ment/include.xml
  
  
  
  
  1.2       +9 -0      jakarta-ant/src/etc/testcases/core/include/frag#ment/relative.xml
  
  
  
  
  1.2       +6 -0      jakarta-ant/src/etc/testcases/core/include/frag#ment/simple.xml
  
  
  
  
  1.2       +8 -0      jakarta-ant/src/etc/testcases/taskdefs/property.xml
  
  
  
  
  1.15      +19 -0     jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java
  
  Index: AntClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/AntClassLoader.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AntClassLoader.java	2001/02/04 02:34:28	1.14
  +++ AntClassLoader.java	2001/02/18 13:44:41	1.15
  @@ -103,6 +103,12 @@
        */
       private Vector loaderPackages = new Vector();
       
  +    /**
  +     * This flag indicates that the classloader will ignore the base
  +     * classloader if it can;t find a class.
  +     */
  +    private boolean ignoreBase = false;
  +    
       private static Method getProtectionDomain = null;
       private static Method defineClassProtectionDomain = null;
       static {
  @@ -143,7 +149,17 @@
           this(project, classpath);
           this.systemFirst = systemFirst;
       }
  +
  +    /**
  +     * Set this classloader to run in isolated mode. In isolated mode, classes not
  +     * found on the given classpath will not be referred to the base class loader
  +     * but will cause a classNotFoundException.
  +     */
  +    public void setIsolated(boolean isolated) {
  +        ignoreBase = isolated;
  +    }
       
  +    
       /**
        * Add a package root to the list of packages which must be loaded on the 
        * system loader.
  @@ -354,6 +370,9 @@
                       project.log("Class " + classname + " loaded from ant loader", Project.MSG_DEBUG);
                   }
                   catch (ClassNotFoundException cnfe) {
  +                    if (ignoreBase) {
  +                        throw cnfe;
  +                    }
                       theClass = findBaseClass(classname);
                       project.log("Class " + classname + " loaded from system loader", Project.MSG_DEBUG);
                   }
  
  
  
  1.48      +27 -4     jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- ProjectHelper.java	2001/01/18 02:50:32	1.47
  +++ ProjectHelper.java	2001/02/18 13:44:41	1.48
  @@ -99,13 +99,17 @@
        */
       private void parse() throws BuildException {
           FileInputStream inputStream = null;
  +        InputSource inputSource = null;
           
           try {
               SAXParser saxParser = getParserFactory().newSAXParser();
               parser = saxParser.getParser();
               
  -            inputStream = new FileInputStream(buildFile);
  -            saxParser.parse(inputStream, new RootHandler());
  +            String uri = "file:" + buildFile.getAbsolutePath().replace('\\', '/');
  +            for (int index = uri.indexOf('#'); index != -1; index = uri.indexOf('#')) {
  +                uri = uri.substring(0, index) + "%23" + uri.substring(index+1);
  +            }
  +            saxParser.parse(uri, new RootHandler());
           }
           catch(ParserConfigurationException exc) {
               throw new BuildException("Parser has not been configured correctly", exc);
  @@ -208,16 +212,35 @@
            */
           public InputSource resolveEntity(String publicId,
                                            String systemId) {
  -
  +        
               if (systemId.startsWith("file:")) {
                   String path = systemId.substring(5);
  +                int index = path.indexOf("file:");
  +                
  +                // we only have to handle these for backward compatibility
  +                // since they are in the FAQ.
  +                while (index != -1) {
  +                    path = path.substring(0, index) + path.substring(index + 5);
  +                    index = path.indexOf("file:");
  +                }
  +                
  +                String entitySystemId = path;
  +                index = path.indexOf("%23");
  +                // convert these to #
  +                while (index != -1) {
  +                    path = path.substring(0, index) + "#" + path.substring(index + 3);
  +                    index = path.indexOf("%23");
  +                }
  +
                   File file = new File(path);
                   if (!file.isAbsolute()) {
                       file = new File(buildFileParent, path);
                   }
                   
                   try {
  -                    return new InputSource(new FileInputStream(file));
  +                    InputSource inputSource = new InputSource(new FileInputStream(file));
  +                    inputSource.setSystemId("file:" + entitySystemId);
  +                    return inputSource;
                   } catch (FileNotFoundException fne) {
                       project.log(file.getAbsolutePath()+" could not be found", 
                                   Project.MSG_WARN);
  
  
  
  1.14      +19 -10    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Execute.java	2001/02/13 12:31:58	1.13
  +++ Execute.java	2001/02/18 13:44:42	1.14
  @@ -428,8 +428,10 @@
            */
           public Process exec(Project project, String[] cmd, String[] env) throws IOException
           {
  -            project.log("Execute:CommandLauncher: " +
  -                        Commandline.toString(cmd), Project.MSG_DEBUG);
  +            if (project != null) {
  +                project.log("Execute:CommandLauncher: " +
  +                            Commandline.toString(cmd), Project.MSG_DEBUG);
  +            }                            
               return Runtime.getRuntime().exec(cmd, env);
           }
   
  @@ -471,8 +473,10 @@
               for ( int i = 0; i < cmd.length; i++ ) {
                   newcmd[i] = Commandline.quoteArgument(cmd[i]);
               }
  -            project.log("Execute:Java11CommandLauncher: " +
  -                        Commandline.toString(newcmd), Project.MSG_DEBUG);
  +            if (project != null) {
  +                project.log("Execute:Java11CommandLauncher: " +
  +                            Commandline.toString(newcmd), Project.MSG_DEBUG);
  +            }                            
               return Runtime.getRuntime().exec(newcmd, env);
           }
       }
  @@ -497,8 +501,10 @@
               throws IOException
           {
               try {
  -                project.log("Execute:Java13CommandLauncher: " +
  -                            Commandline.toString(cmd), Project.MSG_DEBUG);
  +                if (project != null) {
  +                    project.log("Execute:Java13CommandLauncher: " +
  +                                Commandline.toString(cmd), Project.MSG_DEBUG);
  +                }                                
                   Object[] arguments = { cmd, env, workingDir };
                   return (Process)_execWithCWD.invoke(Runtime.getRuntime(), arguments);
               } 
  @@ -571,13 +577,16 @@
   
               // Use cmd.exe to change to the specified directory before running
               // the command
  -            String[] newcmd = new String[cmd.length+5];
  +            final int preCmdLength = 6;
  +            String[] newcmd = new String[cmd.length + preCmdLength];
               newcmd[0] = "cmd";
               newcmd[1] = "/c";
               newcmd[2] = "cd";
  -            newcmd[3] = workingDir.getAbsolutePath();
  -            newcmd[4] = "&&";
  -            System.arraycopy(cmd, 0, newcmd, 5, cmd.length);
  +            newcmd[3] = "/d";
  +            newcmd[4] = workingDir.getAbsolutePath();
  +            newcmd[5] = "&&";
  +            System.arraycopy(cmd, 0, newcmd, preCmdLength, cmd.length);
  +
               return exec(project, newcmd, env);
           }
       }
  
  
  
  1.8       +2 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java
  
  Index: ExecuteJava.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteJava.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ExecuteJava.java	2001/01/03 14:18:30	1.7
  +++ ExecuteJava.java	2001/02/18 13:44:42	1.8
  @@ -119,7 +119,8 @@
               if (classpath == null) {
                   target = Class.forName(classname);
               } else {
  -                AntClassLoader loader = new AntClassLoader(project, classpath);
  +                AntClassLoader loader = new AntClassLoader(project, classpath, false);
  +                loader.setIsolated(true);
                   target = loader.forceLoadClass(classname);
               }
               final Method main = target.getMethod("main", param);
  
  
  
  1.62      +1 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties
  
  Index: defaults.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- defaults.properties	2001/02/02 17:03:54	1.61
  +++ defaults.properties	2001/02/18 13:44:42	1.62
  @@ -88,6 +88,7 @@
   ccuncheckout=org.apache.tools.ant.taskdefs.optional.clearcase.CCUnCheckout
   sound=org.apache.tools.ant.taskdefs.optional.sound.SoundTask
   junitreport=org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator
  +vsslabel=org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL
   
   # deprecated ant tasks (kept for back compatibility)
   javadoc2=org.apache.tools.ant.taskdefs.Javadoc
  
  
  
  1.6       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
  
  Index: DescriptorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DescriptorHandler.java	2001/01/25 14:39:15	1.5
  +++ DescriptorHandler.java	2001/02/18 13:44:42	1.6
  @@ -243,7 +243,7 @@
               
               // Get the filename into a String object
               File classFile = null;
  -            String className = currentText;
  +            String className = currentText.trim();
   
               // If it's a primitive wrapper then we shouldn't try and put
               // it into the jar, so ignore it.
  
  
  
  1.18      +6 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  
  Index: WeblogicDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- WeblogicDeploymentTool.java	2001/02/13 12:31:59	1.17
  +++ WeblogicDeploymentTool.java	2001/02/18 13:44:42	1.18
  @@ -521,9 +521,12 @@
                               }
                               else
                               {
  -                                //File other then class changed   rebuild
  -                                log("Non class file " + genericEntry.getName() + " has changed",Project.MSG_VERBOSE);
  -                                rebuild = true;
  +                                // is it the manifest. If so ignore it
  +                                if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) {
  +                                    //File other then class changed   rebuild
  +                                    log("Non class file " + genericEntry.getName() + " has changed",Project.MSG_VERBOSE);
  +                                    rebuild = true;
  +                                }
                                   break;
                               }
                           }
  
  
  
  1.6       +2 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java
  
  Index: VAJImport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- VAJImport.java	2001/01/03 14:18:41	1.5
  +++ VAJImport.java	2001/02/18 13:44:43	1.6
  @@ -95,7 +95,7 @@
    *   <td align="center" valign="top"><b>Required</b></td>
    * </tr>
    * <tr>
  - *   <td valign="top">project</td>
  + *   <td valign="top">vajproject</td>
    *   <td valign="top">the name of the Project to import to</td>
    *   <td align="center" valign="top">Yes</td>
    * </tr>
  @@ -130,7 +130,7 @@
       /**
        * The VisualAge for Java Project name to import into.
        */
  -    public void setProject(String projectName) {
  +    public void setVajproject(String projectName) {
           this.importProject = projectName;
       }
   
  
  
  
  1.4       +245 -83   jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
  
  Index: MParse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MParse.java	2001/01/03 14:18:45	1.3
  +++ MParse.java	2001/02/18 13:44:43	1.4
  @@ -62,128 +62,290 @@
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
   
  -import java.io.File;
  -import java.io.IOException;
  +import java.io.*;
  +import java.util.*;
   
  -/*
  +/**
  + * Simple Metamata MParse task based on the original written by
  + * <a href="mailto:thomas.haas@softwired-inc.com">Thomas Haas</a>
  + * 
  + * This version was written for Metamata 2.0 available at
  + * <a href="http://www.metamata.com">http://www.metamata.com</a>
    *
  - * @author thomas.haas@softwired-inc.com
  + * @author <a href="mailto:sbailliez@imediation.com">Stephane Bailliez</a>
    */
   public class MParse extends Task {
   
  -    private Path userclasspath = null;
  +    private Path classpath = null;
  +    private Path sourcepath = null;
       private File metahome = null;
  -    private File metaworkingdir = null;
       private File target = null;
  -    private boolean cleanupHack = false;
  +    private boolean verbose = false;
  +    private boolean debugparser = false;
  +    private boolean debugscanner = false;    
  +    private boolean cleanup = false;
       private CommandlineJava cmdl = new CommandlineJava();
  +    private File optionsFile = null;
   
  -
  +    /** location of metamata dev environment */
       public void setMetamatahome(File metamatahome) {
           this.metahome = metamatahome;
       }
  -
  -    public void setWorkingdir(File workingdir) {
  -        this.metaworkingdir = workingdir;
  -    }
   
  +    /** the .jj file to process */
       public void setTarget(File target) {
           this.target = target;
       }
   
  -    public Path createUserclasspath() {
  -        if (userclasspath == null) {
  -            userclasspath = new Path(project);
  -        }
  -        
  -        return userclasspath;
  +    /** create a classpath entry */
  +    public Path createClasspath() {
  +        if (classpath == null) {
  +            classpath = new Path(project);
  +        }        
  +        return classpath;
  +    }
  +
  +    /** creates a sourcepath entry */
  +    public Path createSourcepath() {
  +        if (sourcepath == null) {
  +            sourcepath = new Path(project);
  +        }        
  +        return sourcepath;
       }
   
  +    /** set verbose mode */
  +    public void setVerbose(boolean flag){
  +        verbose = flag;
  +    }
  +
  +    /** set scanner debug mode */
  +    public void setDebugscanner(boolean flag){
  +        debugscanner = flag;
  +    }
  +
  +    /** set parser debug mode */
  +    public void setDebugparser(boolean flag){
  +        debugparser = flag;
  +    }
  +
  +    /** set the hack to cleanup the temp file */
  +    public void setCleanup(boolean value) {
  +        cleanup = value;
  +    }
   
  -    public void setCleanupHack(boolean value) {
  -        cleanupHack = value;
  +    /** Creates a nested jvmarg element. */
  +    public Commandline.Argument createJvmarg() {
  +        return cmdl.createVmArgument();
       }
   
  +    /**  -mx or -Xmx depending on VM version */
  +    public void setMaxmemory(String max){
  +        if (Project.getJavaVersion().startsWith("1.1")) {
  +            createJvmarg().setValue("-mx" + max);
  +        } else {
  +            createJvmarg().setValue("-Xmx" + max);
  +        }
  +    }
  +
       public MParse() {
           cmdl.setVm("java");
           cmdl.setClassname("com.metamata.jj.MParse");
       }
  -
   
  +   
  +    /** execute the command line */
       public void execute() throws BuildException {
  -
  -        if (target == null || !target.isFile()) {
  -            throw new BuildException("Invalid target: " + target);
  +        try {
  +            setUp();
  +            ExecuteStreamHandler handler = createStreamHandler();
  +            _execute(handler);
  +        } finally {
  +            cleanUp();
           }
  -        final File javaFile = new File(target.toString().substring(0,
  -                                                                   target.toString().indexOf(".jj")) + ".java");
  +    }
  +    
  +    /** return the default stream handler for this task */
  +    protected ExecuteStreamHandler createStreamHandler(){
  +        return new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_INFO);
  +    }
  +    
  +    /**
  +     * check the options and build the command line
  +     */
  +    protected void setUp() throws BuildException {
  +        checkOptions();
  +
  +        // set the classpath as the jar files
  +        File[] jars = getMetamataLibs();
  +        final Path classPath = cmdl.createClasspath(project);
  +        for (int i = 0; i < jars.length; i++){
  +            classPath.createPathElement().setLocation(jars[i]);
  +        }
  +
  +        // set the metamata.home property
  +        final Commandline.Argument vmArgs = cmdl.createVmArgument();
  +        vmArgs.setValue("-Dmetamata.home=" + metahome.getAbsolutePath() );
  +
  +
  +        // write all the options to a temp file and use it ro run the process
  +        String[] options = getOptions();
  +        optionsFile = createTmpFile();
  +        generateOptionsFile(optionsFile, options);
  +        Commandline.Argument args = cmdl.createArgument();
  +        args.setLine("-arguments " + optionsFile.getAbsolutePath());
  +    }    
  +
  +    
  +    /** execute the process with a specific handler */
  +    protected void _execute(ExecuteStreamHandler handler) throws BuildException {
  +        // target has been checked as a .jj, see if there is a matching
  +        // java file and if it is needed to run to process the grammar
  +        String pathname = target.getAbsolutePath();
  +        int pos = pathname.length() - ".jj".length();
  +        pathname = pathname.substring(0, pos) + ".java";
  +        File javaFile = new File(pathname);
           if (javaFile.exists() && target.lastModified() < javaFile.lastModified()) {
               project.log("Target is already build - skipping (" + target + ")");
               return;
  -        }
  -        cmdl.createArgument().setValue(target.getAbsolutePath());
  -
  -        if (metahome == null || !metahome.isDirectory()) {
  -            throw new BuildException("Metamatahome not valid.");
           }
  -        if (metaworkingdir == null || !metaworkingdir.isDirectory()) {
  -            throw new BuildException("Workingdir not set.");
  -        }
  -        if (userclasspath == null) {
  -            throw new BuildException("Userclasspath not set.");
  -        }
  -
  -        final Path classpath = cmdl.createClasspath(project);
  -        classpath.createPathElement().setLocation(new File(metahome.getAbsolutePath() + "/lib/metamatadebug.jar"));
  -        classpath.createPathElement().setLocation(new File(metahome.getAbsolutePath() + "/lib/metamata.jar"));
  -        classpath.createPathElement().setLocation(new File(metahome.getAbsolutePath() + "/lib/JavaCC.zip"));
  -
  -        final Commandline.Argument arg = cmdl.createVmArgument();
  -        arg.setValue("-mx140M");
  -        arg.setValue("-Dmwp=" + metaworkingdir.getAbsolutePath());
  -        arg.setValue("-Dmetamata.home=" + metahome.getAbsolutePath());
  -        arg.setValue("-Dmetamata.java=java");
  -        arg.setValue("-Dmetamata.java.options=-mx140M");
  -        arg.setValue("-Dmetamata.java.options.classpath=-classpath");
  -        arg.setValue("-Dmetamata.java.compiler=javac");
  -        arg.setValue("-Dmetamata.java.compiler.options.0=-J-mx64M");
  -        arg.setValue("-Dmetamata.java.compiler.options.classpath=-classpath");
  -        arg.setValue("-Dmetamata.language=en");
  -        arg.setValue("-Dmetamata.country=US");
  -        arg.setValue("-Dmetamata.classpath=" + userclasspath);
  -
  -        final Execute process = new Execute(new LogStreamHandler(this,
  -                                                                 Project.MSG_INFO,
  -                                                                 Project.MSG_INFO), null);
  +        
  +        final Execute process = new Execute(handler);
           log(cmdl.toString(), Project.MSG_VERBOSE);
           process.setCommandline(cmdl.getCommandline());
  -
           try {
  -            try {
  -                if (process.execute() != 0) {
  -                    throw new BuildException("MParse failed.");
  -                }
  -            } finally {
  -                if (cleanupHack) {
  -                    final File oo393 = new File(javaFile.getParent(),
  -                                                "OO393.class");
  -                    if (oo393.exists()) {
  -                        project.log("Removing stale file: " + oo393.getName());
  -                        oo393.delete();
  -                    }
  -                    final File sunjj = new File(javaFile.getParent(),
  -                                                "__jj" + javaFile.getName().substring(0,
  -                                                                                      javaFile.getName().indexOf(".java")) + ".sunjj");
  -                    if (sunjj.exists()) {
  -                        project.log("Removing stale file: " + sunjj.getName());
  -                        sunjj.delete();
  -                    }
  -                }
  +            if (process.execute() != 0) {
  +                throw new BuildException("Metamata task failed.");
               }
  +        } catch (IOException e){
  +            throw new BuildException("Failed to launch Metamata task: " + e);
  +        }
  +    }    
  +    
  +    /** clean up all the mess that we did with temporary objects */
  +    protected void cleanUp(){
  +        if (optionsFile != null){
  +            optionsFile.delete();
  +            optionsFile = null;
  +        }
  +        if (cleanup) {
  +            String name = target.getName();
  +            int pos = name.length() - ".jj".length();
  +            name = "__jj" + name.substring(0, pos) + ".sunjj";
  +            final File sunjj = new File(target.getParent(), name);
  +            if (sunjj.exists()) {
  +                project.log("Removing stale file: " + sunjj.getName());
  +                sunjj.delete();
  +            }
  +        }
  +    }
  +    
  +    /**
  +     * return an array of files containing the path to the needed
  +     * libraries to run metamata. The file are not checked for
  +     * existence. You should do this yourself if needed or simply let the
  +     * forked process do it for you.
  +     * @return array of jars/zips needed to run metamata.
  +     */
  +    protected File[] getMetamataLibs(){
  +        Vector files = new Vector();
  +        files.addElement( new File(metahome, "lib/metamata.jar") );
  +        files.addElement( new File(metahome, "bin/lib/JavaCC.zip") );
  +        
  +        File[] array = new File[ files.size() ];
  +        files.copyInto(array);
  +        return array;
  +    }
  +    
  +    
  +    /**
  +     * validate options set and resolve files and paths
  +     * @throws BuildException thrown if an option has an incorrect state.
  +     */
  +    protected void checkOptions() throws BuildException {       
  +        // check that the home is ok.
  +        if (metahome == null || !metahome.exists()){
  +            throw new BuildException("'metamatahome' must point to Metamata home directory.");
  +        }
  +        metahome = project.resolveFile(metahome.getPath());
  +        
  +        // check that the needed jar exists.
  +        File[] jars = getMetamataLibs();
  +        for (int i = 0; i < jars.length; i++){
  +            if (!jars[i].exists()){
  +                throw new BuildException( jars[i] + " does not exist. Check your metamata installation.");
  +            }           
  +        }
  +        
  +        // check that the target is ok and resolve it.
  +        if (target == null || !target.isFile() || !target.getName().endsWith(".jj") ) {
  +            throw new BuildException("Invalid target: " + target);
  +        }
  +        target = project.resolveFile(target.getPath());
  +    }    
  +    
  +    /**
  +     * return all options of the command line as string elements
  +     * @param an array of options corresponding to the setted options.
  +     */
  +    protected String[] getOptions(){
  +        Vector options = new Vector();
  +        if (verbose){
  +            options.addElement("-verbose");
  +        }
  +        if (debugscanner){
  +            options.addElement("-ds");
           }
  -        catch (IOException e) {
  -            throw new BuildException("Failed to launch MParse: " + e);
  +        if (debugparser){
  +            options.addElement("-dp");
           }
  +        if (classpath != null){
  +            options.addElement("-classpath");
  +            options.addElement(classpath.toString());
  +        }
  +        if (sourcepath != null){
  +            options.addElement("-sourcepath");
  +            options.addElement(sourcepath.toString());
  +        }
  +        options.addElement(target.getAbsolutePath());
  +        
  +        String[] array = new String[options.size()];
  +        options.copyInto(array);
  +        return array;
  +    }
  +    
  +    /**
  +     * write all options to a file with one option / line
  +     * @param tofile the file to write the options to.
  +     * @param options the array of options element to write to the file.
  +     * @throws BuildException thrown if there is a problem while writing
  +     * to the file.
  +     */
  +    protected void generateOptionsFile(File tofile, String[] options) throws BuildException {
  +        FileWriter fw = null;
  +        try {
  +            fw = new FileWriter(tofile);
  +            PrintWriter pw = new PrintWriter(fw);
  +            for (int i = 0; i < options.length; i++){
  +                pw.println( options[i] );
  +            }
  +            pw.flush();
  +        } catch (IOException e){
  +            throw new BuildException("Error while writing options file " + tofile, e);
  +        } finally {
  +            if (fw != null){
  +                try {
  +                    fw.close();
  +                } catch (IOException ignored){}
  +            }
  +        }
  +    }
  +    
  +    /** create a temporary file in the current directory */
  +    protected final static File createTmpFile(){
  +        // must be compatible with JDK 1.1 !!!!
  +        final long rand = (new Random(System.currentTimeMillis())).nextLong();
  +        File file = new File("metamata" + rand + ".tmp");
  +        return file;
       }
   
   }
  
  
  
  1.2       +20 -18    jakarta-ant/src/script/antRun.bat
  
  Index: antRun.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/script/antRun.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- antRun.bat	2001/01/23 05:10:39	1.1
  +++ antRun.bat	2001/02/18 13:44:43	1.2
  @@ -1,18 +1,20 @@
  -@echo off
  -
  -cd %1
  -set ANT_RUN_CMD=%2
  -shift
  -shift
  -
  -set PARAMS=
  -:loop
  -if ""%1 == "" goto runCommand
  -set PARAMS=%PARAMS% %1
  -shift
  -goto loop
  -
  -:runCommand
  -rem echo %ANT_RUN_CMD% %PARAMS%
  -%ANT_RUN_CMD% %PARAMS%
  -
  +@echo off
  +
  +# Change drive and directory to %1 (Win9X only for NT/2K use "cd /d")
  +cd %1
  +%1\
  +set ANT_RUN_CMD=%2
  +shift
  +shift
  +
  +set PARAMS=
  +:loop
  +if ""%1 == "" goto runCommand
  +set PARAMS=%PARAMS% %1
  +shift
  +goto loop
  +
  +:runCommand
  +rem echo %ANT_RUN_CMD% %PARAMS%
  +%ANT_RUN_CMD% %PARAMS%
  +
  
  
  
  1.2       +94 -0     jakarta-ant/src/testcases/org/apache/tools/ant/IncludeTest.java
  
  
  
  
  1.4       +34 -9     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/TaskdefsTest.java
  
  Index: TaskdefsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/TaskdefsTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TaskdefsTest.java	2001/01/03 14:18:49	1.3
  +++ TaskdefsTest.java	2001/02/18 13:44:43	1.4
  @@ -67,6 +67,7 @@
       
       private StringBuffer logBuffer;
       private StringBuffer outBuffer;
  +    private StringBuffer errBuffer;
       private BuildException buildException;
       
       public TaskdefsTest(String name) {
  @@ -92,36 +93,54 @@
           assertEquals(output, realOutput);
       }
   
  +    protected void expectOutputAndError(String taskname, String output, String error) { 
  +        executeTarget(taskname);
  +        String realOutput = getOutput();
  +        assertEquals(output, realOutput);
  +        String realError = getError();
  +        assertEquals(error, realError);
  +    }
  +
       protected void expectLog(String taskname, String log) { 
           executeTarget(taskname);
           String realLog = getLog();
           assertEquals(log, realLog);
       }
   
  -    protected String getOutput() { 
  -        StringBuffer cleanOut = new StringBuffer();
  +    
  +    protected String getOutput() {
  +        return cleanBuffer(outBuffer);
  +    }
  +     
  +    protected String getError() {
  +        return cleanBuffer(errBuffer);
  +    }
  +        
  +    private String cleanBuffer(StringBuffer buffer) {
  +        StringBuffer cleanedBuffer = new StringBuffer();
           boolean cr = false;
  -        for (int i = 0; i < outBuffer.length(); i++) { 
  -            char ch = outBuffer.charAt(i);
  +        for (int i = 0; i < buffer.length(); i++) { 
  +            char ch = buffer.charAt(i);
               if (ch == '\r') {
                   cr = true;
                   continue;
               }
   
               if (!cr) { 
  -                cleanOut.append(ch);
  +                cleanedBuffer.append(ch);
               } else { 
                   if (ch == '\n') {
  -                    cleanOut.append(ch);
  +                    cleanedBuffer.append(ch);
                   } else {
  -                    cleanOut.append('\r').append(ch);
  +                    cleanedBuffer.append('\r').append(ch);
                   }
               }
           }
  -        return cleanOut.toString();
  +        return cleanedBuffer.toString();
       }
       
       protected void configureProject(String filename) { 
  +        logBuffer = new StringBuffer();
           project = new Project();
           project.init();
           project.setUserProperty( "ant.file" , new File(filename).getAbsolutePath() );
  @@ -131,16 +150,22 @@
       
       protected void executeTarget(String targetName) { 
           PrintStream sysOut = System.out;
  +        PrintStream sysErr = System.err;
           try { 
  -            outBuffer = new StringBuffer();
               sysOut.flush();
  +            sysErr.flush();
  +            outBuffer = new StringBuffer();
               PrintStream out = new PrintStream(new AntOutputStream());
               System.setOut(out);
  +            errBuffer = new StringBuffer();
  +            PrintStream err = new PrintStream(new AntOutputStream());
  +            System.setErr(err);
               logBuffer = new StringBuffer();
               buildException = null;
               project.executeTarget(targetName);
           } finally { 
               System.setOut(sysOut);
  +            System.setErr(sysErr);
           }
           
       }
  
  
  
  1.2       +74 -0     jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/PropertyTest.java
  
  
  
  
  1.3       +1 -1      jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java
  
  Index: ANTLRTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/ANTLRTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ANTLRTest.java	2001/01/03 14:18:50	1.2
  +++ ANTLRTest.java	2001/02/18 13:44:44	1.3
  @@ -87,7 +87,7 @@
       }
   
       public void test4() {
  -        expectBuildException("test4", "ANTLR exited with an error code of 1 ( try forking )");
  +        executeTarget("test4");
       }
   
       public void test5() {
  
  
  

Mime
View raw message