You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Zafarano, Marcus" <Ma...@LC.CA.GOV> on 2004/11/04 01:50:41 UTC

immutable property

As stated in the ANT doc:

Properties are immutable: whoever sets a property first freezes it for the
rest of the build; they are most definately not variable. 

There are six ways to set properties:

*	By supplying both the name and value attribute...."

I am setting in prepare, but when I call another target it does not have the
info:

            <target name="prepare">

         <!-- Create all the time & date stamps for the build and for the
directories
-->

                        <tstamp/>

 

                        <property name="FTSTAMP"
value="${DSTAMP}-${TSTAMP}"/>

 

                        <!-- Make all the directories after getting the
label from StarTeam
-->

                        <mkdir
dir="${drive}\${buildir}\${label}-${FTSTAMP}"/>

                        

                        <mkdir
dir="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>

                        <property name="local.dist"
value="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>

 

 

            <target name="CopyBRBuildArtifacts">

                        <description>

                                    Target: This target copies the BR images
to the build directory.

                        </description>

                        

                        

                        <echo message="CopyBRBuildArtifacts local.dist:
${local.dist}"/>

                        <echo message="CopyBRBuildArtifacts FTSTAMP:
${FTSTAMP}"/>

 

As per ANT output:

 

CopyBRBuildArtifacts:

     [echo] CopyBRBuildArtifacts local.dist: ${local.dist}

     [echo] CopyBRBuildArtifacts FTSTAMP: ${FTSTAMP}

 

 

prepare:

    [mkdir] Created dir: D:\br_builds\testlabel-20041103-1612

    [mkdir] Created dir:
D:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612

     [echo] Prepare local.dist:
d:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612

     [echo] Prepare: 20041103-1612

 

I must be missing something, or is this a 1.6.2 problem, or has anyone seen
this issue?

 

I did this in 1.5.2, and it worked, but????

 

Does any one have an idea?

 

Thanks in advance!

Z


Re: immutable property

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
It is incorrect. Properties exist only within a scope of the current 
project (<ant>, <antcall>, and others create new subprojects).

- Alexey.

Kris Read wrote:

>Properties only exist within the scope of the parent tag (in this case
>in the target you declared it in).  You have to explicitly pass it to
>a new target.
>
>  
>

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


Re: immutable property

Posted by Wascally Wabbit <wa...@earthling.net>.
This is not quite correct. If you make the "CopyBRBuildArtifacts" target
depend on the "prepare" target, then the *project-wide* properties, once
created by prepare, would be still available to CopyBRBuildArtifacts.

Do like: <target name="CopyBRBuildArtifacts" depends="prepare">
The ordering of your target execution seems wrong.

At 08:53 PM 11/3/2004, you wrote:
>Properties only exist within the scope of the parent tag (in this case
>in the target you declared it in).  You have to explicitly pass it to
>a new target.
>
>
>On Wed, 03 Nov 2004 16:50:41 -0800, Zafarano, Marcus
><ma...@lc.ca.gov> wrote:
> > As stated in the ANT doc:
> >
> > Properties are immutable: whoever sets a property first freezes it for the
> > rest of the build; they are most definately not variable.
> >
> > There are six ways to set properties:
> >
> > *       By supplying both the name and value attribute...."
> >
> > I am setting in prepare, but when I call another target it does not 
> have the
> > info:
> >
> >             <target name="prepare">
> >
> >          <!-- Create all the time & date stamps for the build and for the
> > directories
> > -->
> >
> >                         <tstamp/>
> >
> >                         <property name="FTSTAMP"
> > value="${DSTAMP}-${TSTAMP}"/>
> >
> >                         <!-- Make all the directories after getting the
> > label from StarTeam
> > -->
> >
> >                         <mkdir
> > dir="${drive}\${buildir}\${label}-${FTSTAMP}"/>
> >
> >                         <mkdir
> > dir="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>
> >
> >                         <property name="local.dist"
> > value="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>
> >
> >             <target name="CopyBRBuildArtifacts">
> >
> >                         <description>
> >
> >                                     Target: This target copies the BR 
> images
> > to the build directory.
> >
> >                         </description>
> >
> >                         <echo message="CopyBRBuildArtifacts local.dist:
> > ${local.dist}"/>
> >
> >                         <echo message="CopyBRBuildArtifacts FTSTAMP:
> > ${FTSTAMP}"/>
> >
> > As per ANT output:
> >
> > CopyBRBuildArtifacts:
> >
> >      [echo] CopyBRBuildArtifacts local.dist: ${local.dist}
> >
> >      [echo] CopyBRBuildArtifacts FTSTAMP: ${FTSTAMP}
> >
> > prepare:
> >
> >     [mkdir] Created dir: D:\br_builds\testlabel-20041103-1612
> >
> >     [mkdir] Created dir:
> > D:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612
> >
> >      [echo] Prepare local.dist:
> > d:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612
> >
> >      [echo] Prepare: 20041103-1612
> >
> > I must be missing something, or is this a 1.6.2 problem, or has anyone seen
> > this issue?
> >
> > I did this in 1.5.2, and it worked, but????
> >
> > Does any one have an idea?
> >
> > Thanks in advance!
> >
> > Z
> >
> >
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org

The Wabbit 



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


Re: immutable property

Posted by Kris Read <kr...@gmail.com>.
Properties only exist within the scope of the parent tag (in this case
in the target you declared it in).  You have to explicitly pass it to
a new target.


On Wed, 03 Nov 2004 16:50:41 -0800, Zafarano, Marcus
<ma...@lc.ca.gov> wrote:
> As stated in the ANT doc:
> 
> Properties are immutable: whoever sets a property first freezes it for the
> rest of the build; they are most definately not variable.
> 
> There are six ways to set properties:
> 
> *       By supplying both the name and value attribute...."
> 
> I am setting in prepare, but when I call another target it does not have the
> info:
> 
>             <target name="prepare">
> 
>          <!-- Create all the time & date stamps for the build and for the
> directories
> -->
> 
>                         <tstamp/>
> 
>                         <property name="FTSTAMP"
> value="${DSTAMP}-${TSTAMP}"/>
> 
>                         <!-- Make all the directories after getting the
> label from StarTeam
> -->
> 
>                         <mkdir
> dir="${drive}\${buildir}\${label}-${FTSTAMP}"/>
> 
>                         <mkdir
> dir="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>
> 
>                         <property name="local.dist"
> value="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>
> 
>             <target name="CopyBRBuildArtifacts">
> 
>                         <description>
> 
>                                     Target: This target copies the BR images
> to the build directory.
> 
>                         </description>
> 
>                         <echo message="CopyBRBuildArtifacts local.dist:
> ${local.dist}"/>
> 
>                         <echo message="CopyBRBuildArtifacts FTSTAMP:
> ${FTSTAMP}"/>
> 
> As per ANT output:
> 
> CopyBRBuildArtifacts:
> 
>      [echo] CopyBRBuildArtifacts local.dist: ${local.dist}
> 
>      [echo] CopyBRBuildArtifacts FTSTAMP: ${FTSTAMP}
> 
> prepare:
> 
>     [mkdir] Created dir: D:\br_builds\testlabel-20041103-1612
> 
>     [mkdir] Created dir:
> D:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612
> 
>      [echo] Prepare local.dist:
> d:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612
> 
>      [echo] Prepare: 20041103-1612
> 
> I must be missing something, or is this a 1.6.2 problem, or has anyone seen
> this issue?
> 
> I did this in 1.5.2, and it worked, but????
> 
> Does any one have an idea?
> 
> Thanks in advance!
> 
> Z
> 
>

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


Re: immutable property

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
I think you execute the targets in the opposite order. Please add 
dependency on "prepare" in CopyBRBuildArtifacts target.

- Alexey.


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


RE: immutable property

Posted by Bill Rich <br...@webmethods.com>.
>From the output shown it looks to me like CopyBRBuildArtifacts ran before
prepare. Try making CopyBRBuildArtifacts depend on prepare.

HTH

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716
bill@wilandra.com
http://www.wilandra.com

-----Original Message-----
From: Zafarano, Marcus [mailto:Marcus.Zafarano@LC.CA.GOV] 
Sent: Wednesday, November 03, 2004 4:51 PM
To: Ant Users List
Subject: immutable property

As stated in the ANT doc:

Properties are immutable: whoever sets a property first freezes it for the
rest of the build; they are most definately not variable. 

There are six ways to set properties:

*	By supplying both the name and value attribute...."

I am setting in prepare, but when I call another target it does not have the
info:

            <target name="prepare">

         <!-- Create all the time & date stamps for the build and for the
directories
-->

                        <tstamp/>

 

                        <property name="FTSTAMP"
value="${DSTAMP}-${TSTAMP}"/>

 

                        <!-- Make all the directories after getting the
label from StarTeam
-->

                        <mkdir
dir="${drive}\${buildir}\${label}-${FTSTAMP}"/>

                        

                        <mkdir
dir="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>

                        <property name="local.dist"
value="${drive}\${buildir}\${label}-${FTSTAMP}\${brlabel}-${FTSTAMP}"/>

 

 

            <target name="CopyBRBuildArtifacts">

                        <description>

                                    Target: This target copies the BR images
to the build directory.

                        </description>

                        

                        

                        <echo message="CopyBRBuildArtifacts local.dist:
${local.dist}"/>

                        <echo message="CopyBRBuildArtifacts FTSTAMP:
${FTSTAMP}"/>

 

As per ANT output:

 

CopyBRBuildArtifacts:

     [echo] CopyBRBuildArtifacts local.dist: ${local.dist}

     [echo] CopyBRBuildArtifacts FTSTAMP: ${FTSTAMP}

 

 

prepare:

    [mkdir] Created dir: D:\br_builds\testlabel-20041103-1612

    [mkdir] Created dir:
D:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612

     [echo] Prepare local.dist:
d:\br_builds\testlabel-20041103-1612\brtestlabel-20041103-1612

     [echo] Prepare: 20041103-1612

 

I must be missing something, or is this a 1.6.2 problem, or has anyone seen
this issue?

 

I did this in 1.5.2, and it worked, but????

 

Does any one have an idea?

 

Thanks in advance!

Z




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