ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: environment variable
Date Fri, 05 Sep 2003 15:56:28 GMT
Another solution would be to use the experimental task
<presetdef/> in the nightly build.

(Note: I do not have windows so I do not know if 
   <exec  executable="test.bat" .../> works, I assumed
   that one needs to do
       <exec executable="cmd.exe" ..>
          <arg value="/c"/>
          <arg value="call"/>
          <arg value="test.bat"/>
          <...>
      </exec>
)

<presetdef name="my.env.exec">
  <exec executable="test.bat" newenvironment="false">
     <env key="PNG_HOME" value="${PNG_HOME}"/>
     <env key="ORACLE_HOME" value="${ORACLE_HOME}"/>
     <env key="ORACLE_SID" value="${ORACLE_SID}"/>
     <env key="SCHEMA" value="${SCHEMA}"/>
     <env key="PASSWD" value="${PASSWD}"/>
     <env key="NLS_LANG" value="${NLS_LANG}"/>
     <env key="NG_PORT" value="${NG_PORT}"/>
     <env key="MAX_USERS" value="${MAX_USERS}"/>
     <env key="TRACE" value="${TRACE}"/>
     <env key="COBOLREP" value="${COBOLREP}"/>
     <env key="COBOLREPBIS" value="${COBOLREPBIS}"/>
     <env key="JAVA_HOME" value="${JAVA_HOME}"/>
     <env key="ANT_HOME" value="${ANT_HOME}"/>
  </exec>
</presetdef>

Then one could do:

<my.env.exec executable="test.bat"/>
<my.env.exec executable="test2.bat"/>

Peter

On Friday 05 September 2003 16:31, Jan.Materne@rzf.fin-nrw.de wrote:
> 1) copy that <env>-part  :-)
> 2) define that part outside in a file and include that on both places with
> xml-includes
> 3) I donĀ“t know whether <include> can help here ...
>
>
> Mmm, <java> supports <syspropertyset>s. I think a <envpropertyset>
would be
> useful
> for <exec> and <java> also ...
>
>
> Jan
>
> > -----Original Message-----
> > From: Blanchet Samuel [mailto:sblanchet@sopragroup.com]
> > Sent: Friday, September 05, 2003 4:10 PM
> > To: user@ant.apache.org
> > Subject: environment variable
> >
> >
> > Hi,
> >
> > I've a prob with the environment variables.
> >
> > I would like to set a lot of environment variables to use
> > them in different process.
> >
> > My script is below.
> >
> > the pb is that I'm not able to use the differents environment
> > variables (PNG_HOME, ORACLE_HOME,...) in the second  prog : TEST2.BAT.
> >
> >
> > <exec executable="test.bat" newenvironment="false">
> >  <env key="PNG_HOME" value="${PNG_HOME}"/>
> >  <env key="ORACLE_HOME" value="${ORACLE_HOME}"/>
> >  <env key="ORACLE_SID" value="${ORACLE_SID}"/>
> >  <env key="SCHEMA" value="${SCHEMA}"/>
> >  <env key="PASSWD" value="${PASSWD}"/>
> >  <env key="NLS_LANG" value="${NLS_LANG}"/>
> >  <env key="NG_PORT" value="${NG_PORT}"/>
> >  <env key="MAX_USERS" value="${MAX_USERS}"/>
> >  <env key="TRACE" value="${TRACE}"/>
> >  <env key="COBOLREP" value="${COBOLREP}"/>
> >  <env key="COBOLREPBIS" value="${COBOLREPBIS}"/>
> >  <env key="JAVA_HOME" value="${JAVA_HOME}"/>
> >  <env key="ANT_HOME" value="${ANT_HOME}"/>
> > </exec>
> >
> > <exec executable="test2.bat"/>
> >
> > Could you help me ?
> >
> > thx
> >
> >  Sam


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


Mime
View raw message