ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Vaughn <rvau...@seaconinc.com>
Subject Re: help! Can't I set a <property> more than once in a build file?
Date Thu, 20 Jul 2000 20:05:20 GMT
Um, it strikes me that with the 1.1 release, Ant is becoming as cryptic and
difficult to use as Make.  This is not a Good Thing.  Hopefully, the idea is to
simplify builds, not simple make them as difficult to create as Makefiles, but
in a different syntax.  If this is the case, we might as well stick with Make -
it is after all *much* more flexible as it allows you to script *any* commands
without the effort of writing Java code to handle them.

In some of my projects, I have created targets similar to Kenneth's - targets
which are now broken in 1.1.  I'm not fond of the proposed workaround, as it is
painfully reminiscent of the recursive makes I have had to use for years.  Nor
am I fond of the idea of using XSL to transform all of my build files (along
with the extra time and effort to do so).  Sounds amazingly similar to Imake,
no?

The goal of Ant should be to reduce the amount of work we have to do to
accomplish and maintain builds.  With this single stroke, that maintenance has
been vastly complicated.

Roger Vaughn


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" <ant-dev@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


Mime
View raw message