ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Cryder" <christi...@granitepeaks.com>
Subject RE: Accessing system variables
Date Thu, 24 Oct 2002 23:37:49 GMT
Thanks guys!

That did the trick! I appreciate it greatly...

Christian
----------------------------------------------
Christian Cryder [christianc@atmreports.com]
Internet Architect, ATMReports.com
Barracuda - http://barracuda.enhydra.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"


> -----Original Message-----
> From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> Sent: Tuesday, October 22, 2002 9:49 PM
> To: Ant Users List
> Subject: Re: Accessing system variables
>
>
> <property environment="env"/> will give you ${env.ANT_HOME}, but you'd
> be better off using ${ant.home}.
>
> Follow it with:
>
>      <property name="env.COMPUTERNAME" value="${env.HOSTNAME}"/>
>
> And you'll get the computer name on both Windows and *nix platforms.
>
> Two caveats to the above that I know of:
>
> - IDEA IntelliJ does not set ${ant.home} (at least not in my version) so
> I have a fall back setting of it in my build files.
>
> - Mac OS X does not have HOSTNAME set, although I just this very minute
> realized that there is a HOST environment variable!  Maybe that will
> solve my problems by adding another property setting statement or
> something like that.
>
> 	Erik
>
>
> Christian Cryder wrote:
> > Is there anyway to access system variables within Ant? For instance, I'd
> > like to do this:
> >
> >     <echo message="ANT_HOME defined as ${env.ANT_HOME}" />
> >
> > I'd also like to know if there is anyway to retrieve the
> host/computer name
> > from within Ant?
> >
> > Thanks,
> > Christian
> > ----------------------------------------------
> > Christian Cryder [christianc@atmreports.com]
> > Internet Architect, ATMReports.com
> > Barracuda - http://barracuda.enhydra.org
> > ----------------------------------------------
> > "Coffee? I could quit anytime, just not today"
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
>
>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message