I did not mention it but I actually added a fileset feature to the property
taskdef so that I can read in arbitrary prop files without specifying them
directly.  This way we can add a new project w/o changing any code in the
build.xml file.

<property2 srcdir="${basedir}" includes="*/version.prop" />

Since one project may reference another project, it is necessary to specify
names of jar files specific to a project.  So in a project property file we
would have the following as the classpath

------ ../<project>/build.prop
jars.includes=common-${common.label}.jar
------

The common.label is defined in the common project's version.prop that has
been loaded by the earlier call of property2.

Basically we want to allow our developers to create new projects that have
only a version.prop to name the jar files and create labels in clearcase and
the build.prop file that has compiles, resources, runnable targets,
classpath jars properties.

Pete  

-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 11:39 AM
To: [EMAIL PROTECTED]
Subject: Re: nested property references


Peter Hayes <[EMAIL PROTECTED]> wrote:

> I wrote a Property2 file that handles this because we need to use it
> in order to have only a single general build.xml file to build /
> package an arbitrary number of projects.

But your patch will only change the behavior for <property>'s value
attribute, all other property references wouldn't be affected.  I
think this is less than what has been asked for - but I don't think we
really have a technical problem here anyway.

> Here is an example of how we use it.  The label of a project jar is
> specified in a property file such as
> 
> -------- ../proj1/version.prop
> proj1.label=proj1-2.0.5_DEV
> --------
> 
> We invoke then invoke ant to build this project by
> 
> --------
> ant -Dproject.name=proj1
> --------
> 
> And our build.xml file uses the passed in property to get the
> correct label
> 
> -------- ../build.xml
>    <property2 name="jarFile" value="${${project.name}.label}.jar" />
> --------

If you do this, you are going to read ./${project.name}/version.prop
anyway, why can't you define jarFile in a project specific property
file as well?  What is the benefit of putting the definition of
jarFile into build.xml?

I'm really trying to understand this, so please help me 8-)

Stefan

Reply via email to