I've delved a little further into this, and this is what appears to be happening (and 
which I didn't mention in my earlier post):  

Script A is making REPEATED calls to different targets in Script B.  Script B defines
${sportsbean.vers} as a project-level property (and many other ${xxx.vers} properties 
as well).
It appears that the problem is that when calls are repeatedly made from one ant script 
to another,
the values of these project-level properties is being forgotten.  That is, the 
project-level properties are not properly evaluated on each trip through.

I am still puzzled as to why this happens only for me and not my colleague.  We are 
running the same version of ant, from the same vanilla build script that came with 
ant, and all the jars that ant uses are the same, coming from the ant/lib directory 
and there is no interference from the external classpath.



-----Original Message-----
From: Steve Cohen 
Sent: Monday, August 12, 2002 8:11 PM
To: Ant Users List
Cc: David Adams; David Chelimsky
Subject: Too wierd - Property "forgetting"


Heck of a thing to find first day back from vacation:

A colleague and I are both running the same version of ant, version 1.5Beta3.

We are running ant over the same scripts.

Script A makes an <ant> call to script B.  

Script A calls the following target: (located in script B):

    <target name="sportsbean">
        <antcall target="checkout">
            <param name="projectroot" value="${root}/sportsbean"/>
            <param name="ST.proj" value = "SportsBean" />
            <param name="ST.view" value = "${sportsbean.vers}" />
            <param name="ST.folder" value = "/sportsbean" />
            <param name="ST.label" value = "${sportsbean.lbl}" />

        </antcall>
...
    </target>

Previously defined in script B are these properties:
    <property name="sportsbean.vers" value="Version 5.1"/>
    <property name="sportsbean.lbl" value=""/>

The definition of the "checkout" target (located in script B) is as follows:

    <target name="checkout">
        <mkdir dir="${projectroot}"/>
        <delete dir="${projectroot}"/>
        <echo message="Checking out from:"/>
        <echo message="  Project: ${ST.proj}"/>
        <echo message="  View: ${ST.view}"/>
        <echo message="  Folder: ${ST.folder}"/>
        <echo message="  Label: ${ST.label}"/>
        <stcheckout servername="${ST.server}"
            serverport="${ST.port}"
            projectname="${ST.proj}"
            viewname="${ST.view}"
            username="${ST.user}"
            password="${ST.pswd}"
            rootstarteamfolder="${ST.folder}"
            rootlocalfolder="${projectroot}"
            excludes="*.war"
            forced="yes"
            label="${ST.label}"
      />
    </target>

Never mind the optional <stcheckout> task which is probably unfamiliar.  The problem I 
am grappling with is far more troubling and puzzling because it is merely a question 
of property definition:

Notice the five echo calls.

In my colleague's run of this script, the following output is produced by these calls. 
 This is the output I would expect.

Checking out from:   
  Project: SportsBean
  View: Version 5.1  
  Folder: /sportsbean
  Label:             

In my run of the same script, this is the output of the same script, run with the same 
parameters.

Checking out from:
  Project: SportsBean
  View: 
  Folder: /sportsbean
  Label: 

The key difference is the blank content of the ${ST.view} parameter.
Again, to reiterate: there is no difference between the way my colleague is running 
this script and the way I am.  Nothing in either script, the command line, or any 
property file defines the the ${sportsbean.vers} property (which feeds the ${ST.view} 
param) other than the single line in script B where it is defined.

I am completely at a loss to explain these results.  It seems as though my run of the 
scripts is
causing the ${sportsbean.vers} property to be "forgotten" across the <antcall> in my 
case but not in my colleague's case.

Does anyone know of any bugs in ant version 1.5Beta3 that could account for these 
results, or can anyone think of something that I am overlooking, which could cause 
them?

-----------------------------------------------------------------
Steve Cohen
Sr. Software Engineer
Ignite Sports, Inc.
[EMAIL PROTECTED]








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to