You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ro...@elastica.com on 2000/11/01 00:54:25 UTC
make -D in ant?
Can I parse in parameters from the command line?
Why can't I do this
<project name="plymedia" basedir="${rootDir}">
and
ant -DrootDir=C:\plymediadev
I want to hide all references to absolute paths outside of the build file.
when I do this it doesn't evaluate $rootDir as I would expect.
Re: make -D in ant?
Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "r" == robert <ro...@elastica.com> writes:
r> Can I parse in parameters from the command line? Why can't I do
r> this
r> <project name="plymedia" basedir="${rootDir}">
r> and
r> ant -DrootDir=C:\plymediadev
Because Ant doesn't evaluate ${} constructs in attributes of project
and target. At least not in Ant 1.2.
The simple workaround, don't specify a basedir in you build file at
all:
<project name="plymedia">
and
ant -Dbasedir=C:\plymediadev
Stefan
RE: make -D in ant?
Posted by ro...@elastica.com.
What can we expect? It would definately be nice to be able to pass in
properties from the command line especially for baseDir or for that
matter anything else. I don't want to keep these references in the
.xml file.
On Wed, 1 Nov 2000, Samuel R Listopad II wrote:
> > <project name="plymedia" basedir="${rootDir}">
> >
> > and
> >
> > ant -DrootDir=C:\plymediadev
> >
> > I want to hide all references to absolute paths outside of
> > the build file.
> >
> > when I do this it doesn't evaluate $rootDir as I would expect.
>
> Ok this is what I was getting at with my last post (albeit poorly). Ant 1.2
> only seems
> to evaluate properties at creation time. However I would propose a more
> dynamic system
> where properties were recursively evaluated whenever used.
>
> i.e. in this case when ${basedir} used it would lookup basedir in the hash,
> get the value
> of ${rootDir}, and the try to extract rootDir from the hashmap and find
> C:\plymediadev.
>
> Its a simple change, I was just wondering if it had already been thought of
> and done/shot down
> for some glaring reason I could not see.
>
> Sam
>
RE: make -D in ant?
Posted by Samuel R Listopad II <sl...@intercapsystems.com>.
> <project name="plymedia" basedir="${rootDir}">
>
> and
>
> ant -DrootDir=C:\plymediadev
>
> I want to hide all references to absolute paths outside of
> the build file.
>
> when I do this it doesn't evaluate $rootDir as I would expect.
Ok this is what I was getting at with my last post (albeit poorly). Ant 1.2
only seems
to evaluate properties at creation time. However I would propose a more
dynamic system
where properties were recursively evaluated whenever used.
i.e. in this case when ${basedir} used it would lookup basedir in the hash,
get the value
of ${rootDir}, and the try to extract rootDir from the hashmap and find
C:\plymediadev.
Its a simple change, I was just wondering if it had already been thought of
and done/shot down
for some glaring reason I could not see.
Sam