You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Steve Cohen <st...@comcast.net> on 2005/05/23 03:28:30 UTC

Can Ant know ANT_HOME?

I am trying to write a simple build.xml for debugging Ant setups.  One 
of the things I would like to know is what ANT_HOME was defined as when 
Ant launched.  But this does not seem to be a predefined ant property.  
I naively thought that I could do
    <property environment="env"/>
    <echo>ANT_HOME=${env.ANT_HOME}</echo>
this will not work unless ANT_HOME is predefined in the environment.  
The typical ant launch scripts will define ANT_HOME but not export it 
into the environment.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Steve Cohen <sc...@javactivity.org>.
Stefan Bodewig wrote:
> On Mon, 23 May 2005, Antoine Levy-Lambert <an...@gmx.de> wrote:
> 
> 
>>we should add a line about in in the table explainning the different
>>system properties used by Ant.
> 
> 
> Keep in mind that it is our wrapper script that sets the property.  If
> you launch ant any other way (IDE, script of your own, embedded),
> there is no guarantee that it will be defined.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 
> 
But that's precisely my use case.  In an environment where there is more 
than one way to launch ant, I sometimes get unexpected results.  In my 
case I've got a JPackage install, plus various trees of various versions 
of ant in various stages of development.  When something hasn't worked 
they way I want, I need to go see what ANT_HOME was defined as at the 
moment Ant launched.  I don't want to do anything with it, I just want 
to see how it was defined, without reading a lot of shell scripts trying 
to understand which path got me where I am.  In fact, knowing what 
ANT_HOME was eventually chosen makes it easier to follow the shell 
scripts.  If ANT_HOME is not defined, that also is worth knowing.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 26 May 2005, Peter Reilly <pe...@apache.org> wrote:

>> Stefan Bodewig wrote re. ${ant.home}:
>>
>>> Keep in mind that it is our wrapper script that sets the property.
>>
> <picky_mode>
>   It is actually set by Laucher.java as well if not already set.
> </picky_mode>

Thanks

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Peter Reilly <pe...@apache.org>.
Jesse Glick wrote:

> Stefan Bodewig wrote re. ${ant.home}:
>
>> Keep in mind that it is our wrapper script that sets the property.
>
<picky_mode>
  It is actually set by Laucher.java as well if not already set.
</picky_mode>

Peter

>> If you launch ant any other way (IDE, script of your own, embedded), 
>> there is no guarantee that it will be defined.
>
>
> As an example, the NetBeans IDE does define it as of version 3.6 
> (previously it did not). But other environments could well choose not 
> to use the distribution layout at all. Since I have noticed that a 
> common use for it is to find ant.jar (e.g. to compile new tasks, 
> without making assumptions about the JVM startup classpath), I filed 
> RFE #21856. But that would not help in Steve Cohen's case.
>
> -J.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Jesse Glick <je...@sun.com>.
Stefan Bodewig wrote re. ${ant.home}:
> Keep in mind that it is our wrapper script that sets the property.
> If you launch ant any other way (IDE, script of your own, embedded), 
> there is no guarantee that it will be defined.

As an example, the NetBeans IDE does define it as of version 3.6 
(previously it did not). But other environments could well choose not to 
use the distribution layout at all. Since I have noticed that a common 
use for it is to find ant.jar (e.g. to compile new tasks, without making 
assumptions about the JVM startup classpath), I filed RFE #21856. But 
that would not help in Steve Cohen's case.

-J.

-- 
jesse.glick@sun.com   x22801   netbeans.org   ant.apache.org
if I had known it was harmless I would have killed it myself


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 23 May 2005, Antoine Levy-Lambert <an...@gmx.de> wrote:

> we should add a line about in in the table explainning the different
> system properties used by Ant.

Keep in mind that it is our wrapper script that sets the property.  If
you launch ant any other way (IDE, script of your own, embedded),
there is no guarantee that it will be defined.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Steve Loughran <st...@apache.org>.
Antoine Levy-Lambert wrote:
> Steve Cohen wrote:
> 
>> Alexey Solofnenko wrote:
>>
>>> Please use ${ant.home} property.
>>>
>>> - Alexey.
>>>
>>> On 5/22/05, Steve Cohen <st...@comcast.net> wrote:
>>>
>>>> I am trying to write a simple build.xml for debugging Ant setups. One
>>>> of the things I would like to know is what ANT_HOME was defined as when
>>>> Ant launched. But this does not seem to be a predefined ant property.
>>>>
> Hello Steve,
> 
>> Yes, I found that.  It's not documented, however.
>>
> 
> The property ant.home is not documented, but is explained in the manual 
> page "running.html". http://ant.apache.org/manual/running.html#sysprops
> 
> we should add a line about in in the table explainning the different 
> system properties used by Ant.
> 

I've come across ant.home being undefined in some IDEs...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Steve Cohen wrote:

> Alexey Solofnenko wrote:
>
>> Please use ${ant.home} property.
>>
>> - Alexey.
>>
>> On 5/22/05, Steve Cohen <st...@comcast.net> wrote:
>>
>>> I am trying to write a simple build.xml for debugging Ant setups. One
>>> of the things I would like to know is what ANT_HOME was defined as when
>>> Ant launched. But this does not seem to be a predefined ant property.
>>>
Hello Steve,

> Yes, I found that.  It's not documented, however.
>

The property ant.home is not documented, but is explained in the manual 
page "running.html". http://ant.apache.org/manual/running.html#sysprops

we should add a line about in in the table explainning the different 
system properties used by Ant.

Cheers,

Antoine


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Steve Cohen <sc...@javactivity.org>.
Alexey Solofnenko wrote:
> Please use ${ant.home} property.
> 
> - Alexey.
> 
> On 5/22/05, Steve Cohen <st...@comcast.net> wrote:
> 
>>I am trying to write a simple build.xml for debugging Ant setups. One
>>of the things I would like to know is what ANT_HOME was defined as when
>>Ant launched. But this does not seem to be a predefined ant property.
>>I naively thought that I could do
>><property environment="env"/>
>><echo>ANT_HOME=${env.ANT_HOME}</echo>
>>this will not work unless ANT_HOME is predefined in the environment.
>>The typical ant launch scripts will define ANT_HOME but not export it
>>into the environment.
>>
Yes, I found that.  It's not documented, however.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Can Ant know ANT_HOME?

Posted by Alexey Solofnenko <tr...@gmail.com>.
Please use ${ant.home} property.

- Alexey.

On 5/22/05, Steve Cohen <st...@comcast.net> wrote:
> 
> I am trying to write a simple build.xml for debugging Ant setups. One
> of the things I would like to know is what ANT_HOME was defined as when
> Ant launched. But this does not seem to be a predefined ant property.
> I naively thought that I could do
> <property environment="env"/>
> <echo>ANT_HOME=${env.ANT_HOME}</echo>
> this will not work unless ANT_HOME is predefined in the environment.
> The typical ant launch scripts will define ANT_HOME but not export it
> into the environment.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 
> 


-- 
Alexey N. Solofnenko trelony at gmail.com <http://gmail.com>
home: http://trelony.cjb.net/
Pleasant Hill, CA (GMT-8 hours usually)