You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by gl...@ca.ibm.com on 2000/07/20 13:13:27 UTC

[PATCH] Ant task documentation update (was Re: help! Can't I set a more than once in a build file?)





The docs are suffering from the usual lag behind the actual code.  The
commiters have been putting a lot of very useful features into Ant, and not
surprisingly are focusing on the code.  I usually do. :-)

Here's a patch to update the docs.

Index: docs/index.html
===================================================================
RCS file: /home/cvspublic/jakarta-ant/docs/index.html,v
retrieving revision 1.51
diff -u -r1.51 index.html
--- docs/index.html        2000/07/20 07:35:56        1.51
+++ docs/index.html        2000/07/20 11:11:18
@@ -591,7 +591,9 @@
 used.</p>
 <p>The properties of the current project will be available in the new
project.
 These properties will override the properties that are set in the new
project.
-(See also the <a href="#property">properties task</a>).</p>
+(See also the <a href="#property">properties task</a>).  You can set
properties
+in the new project from the old project by using nested property tags.
This
+allows you to parameterize your subprojects.</p>
 <h3>Parameters:</h3>
 <table border="1" cellpadding="2" cellspacing="0">
   <tr>
@@ -606,8 +608,9 @@
   </tr>
   <tr>
     <td valign="top">dir</td>
-    <td valign="top">the directory to use as a basedir for the new Ant
project.</td>
-    <td valign="top" align="center">Yes</td>
+    <td valign="top">the directory to use as a basedir for the new Ant
project. Defaults
+    to the current directory.</td>
+    <td valign="top" align="center">No</td>
   </tr>
   <tr>
     <td valign="top">target</td>
@@ -622,11 +625,16 @@
   </tr>
 </table>
 <h3>Examples</h3>
-<blockquote>
-  <p><code>&lt;ant antfile=&quot;subproject/subbuild.xml&quot;
dir=&quot;subproject&quot;
-  target=&quot;compile&quot; /&gt;</code></p>
-  <p><code>&lt;ant dir=&quot;subproject&quot; /&gt;</code></p>
-</blockquote>
+<pre>
+  &lt;ant antfile=&quot;subproject/subbuild.xml&quot;
dir=&quot;subproject&quot; target=&quot;compile&quot; /&gt;
+
+  &lt;ant dir=&quot;subproject&quot; /&gt;
+
+  &lt;ant antfile=&quot;subproject/property_based_subbuild.xml&quot;&gt;
+    &lt;property name=&quot;param1&quot; value=&quot;version 1.x&quot;
/&gt;
+    &lt;property file=&quot;config/subproject/default.properties&quot;
/&gt;
+  &lt;/ant&gt;
+</pre>
 <hr>
 <h2><a name="available">Available</a></h2>
 <h3>Description</h3>

Glenn McAllister
TID - Software Developer - VisualAge for Java
IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey


Please respond to ant-dev@jakarta.apache.org

To:        ant-dev@jakarta.apache.org
cc:
Subject:        Re: help! Can't I set a <property> more than once in a
build file?



[IMAGE]
I don't think this feature, ie. the ability to set properties specific to
an
ant task, is documented. Is this possible with all ANT tasks or just the
ant
ANT task?
Vijay


glennm@ca.ibm.com wrote:

> Being able to set properties once is considered a feature. :-)  This is a
> fairly significant departure from the 1.0.8 release.  The way around it
for
> you is
>
> <ant antfile="${include.dir}/ejb-build.xml" dir="."
> target="ejb.descriptor">
>   <property name="ejb.basedir" value="com\auctionlogic\auction"/>
>   <property name="ejb.basename" value="AuctionManager"/>
> <ant>
>
> <ant antfile="${include.dir}/ejb-build.xml" dir="."
target="ejb.container">
>   <property name="ejb.basedir" value="com\auctionlogic\auction"/>
>   <property name="ejb.basename" value="AuctionManager"/>
> <ant>
>
> Just make sure you don't set these properties _before_ the ant task.
>
> Glenn McAllister
> TID - Software Developer - VisualAge for Java
> IBM Toronto Lab, (416) 448-3805
> "An approximate answer to the right question is better than the
> right answer to the wrong question." - John W. Tukey
>
> Please respond to ant-dev@jakarta.apache.org
>
> To:        "ant-dev" <an...@jakarta.apache.org>
> cc:
> Subject:        help!  Can't I set a <property> more than once in a build
> file?
>
> Help!
>
> My build file doesn't work properly with the latest Ant release.  It
worked
> fine with the "1.0.8" version.
>
> I've determined that once I set a <property>, I can't override it by
> setting
> it again.  This worked in the previous release.
>
> The reason I need to do this is that I have all my ejbs set up so that I
> set
> some properties and then run an <ant> subproject to execute the tasks for
> that ejb.
> So, in the following example the value of "ejb.basename" in the
> "Customer.build" target turns out to be "AuctionManager", not "Customer"
as
> I would expect.
>
> <!-- AuctionManager target -->
> <target name="AuctionManager.build"
depends="init,AuctionManager.compile">
>        <property name="ejb.basedir" value="com\auctionlogic\auction"/>
>        <property name="ejb.basename" value="AuctionManager"/>
>        <ant antfile="${include.dir}/ejb-build.xml" dir="."
> target="ejb.descriptor"/>
>        <ant antfile="${include.dir}/ejb-build.xml" dir="."
> target="ejb.container"/>
> </target>
> <!-- Customer target -->
> <target name="Customer.build" depends="init,Customer.compile">
>        <property name="ejb.basedir" value="com\auctionlogic\customer"/>
>        <property name="ejb.basename" value="Customer"/>
>        <ant antfile="${include.dir}/ejb-build.xml" dir="."
> target="ejb.descriptor"/>
>        <ant antfile="${include.dir}/ejb-build.xml" dir="."
> target="ejb.container"/>
> </target>
>
> Is there any way to work around this?  Is this the proper expected
> behavior?
>
> Kenneth Liu
> AuctionLogic, Inc.
> 3799 Route 46 East, Suite 310
> (973)257-2751  (973)331-8062 FAX
> http://www.auctionlogic.com
> AuctionLogic - Empowered Web Auction Management

[IMAGE]


(Embedded image moved to file: pic17150.pcx)
(See attached file: C.gif)
(See attached file: smime.p7s)