Simon, Daine, James, Chris, Aarti and all:
This is what I figured out.
1. As Chris pointed out, consider the following build.xml file, which
references a bat file
<project name="Employee" default="init" basedir=".">
<!--Execute the bat file that sets the environment -->
<target name="init">
<echo message="Beginning execution of the bat file"/>
<exec executable="c:\bea\env.bat">
</exec>
</target>
<target name="compile" depends="init">
<javac srcdir="${sourceDir}" destdir="${outputDir}"/>
</target>
</project>
If I keep the default target as init as done in above, the target "compile"
does not execute.
However, I changed the default to compile and had a depends attribute to
init, everything ran fine. I am not clearly able to get this behavior, but
if it is a workaround it is fine.
2. As Aarti and Simon pointed out, changes caused by the execution of the
bat file live only till the ant process is alive
3. Problem with properties files is that still you have to declare the
classpath in the build.xml file. The reason I was going with the bat file is
that I do not have to specify the classpath in build.xml file at all.
Thanks
----- Original Message -----
From: Diane Holt <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 27, 2001 4:19 PM
Subject: Re: Execute another bat file.
> --- J2EE User <[EMAIL PROTECTED]> wrote:
> > Hi James:
> > I am relatively new to Ant. How and where do u set the global.properties
> > file.
>
> Properties files can be called any name you choose (by convention, they
> tend to be called something.properties) and can live anywhere you want
> them to. They have the following (standard Java properties file) format:
>
> #This is a comment
> prop1=value1
> prop2=value2
> ...
>
> They're a way of setting properties in Ant without having to use an
> individual <property> task for each property. You read a properties file
> in using the "file" attribute of the <property> task:
>
> <property file="path-to-file"/>
>
> "Path-to-file" can be the simple file name (if it lives in the base
> directory), a relative path, or a full path -- for example:
>
> <property file="ant.properties"/>
> <property file="../ant.properties"/>
> <property file="/usr/local/ant/lib/properties/ant.properties"/>
> <property file="${propfiles.dir}/ant.properties"/>
>
> Diane
>
> =====
> ([EMAIL PROTECTED])
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>