I haven't looked at this issue in a while, so perhaps things have changed,
but another possibility is: If this target is being called via an <ant>
task from another build file, then the value of ${buildstamp} doesn't
'propagate up'.  Same goes when calling the target from <antcall> within
the current build file.  Specifically:

      - When you <ant> or <antcall> a target, then the 'child' target
receives all the values of properties set in the 'parent' target
            (unless you explicitly set 'inheritAll' to 'false'), but
      - When the 'child' target has completed and control returns to the
'parent' target, the 'parent' DOES NOT receive the values
            of any properties which were newly set in the 'child'.

--dave



                                                                                       
                                           
                      "Maurer, Justin"                                                 
                                           
                      <[EMAIL PROTECTED]        To:       <[EMAIL PROTECTED]>          
                                          
                      .com>                    cc:       (bcc: David Bailey/Lawson)    
                                           
                                               Subject:  Difficulty with "unless" 
attribute                                       
                      06/12/2003 10:40                                                 
                                           
                      AM                                                               
                                           
                      Please respond to                                                
                                           
                      "Ant Users List"                                                 
                                           
                                                                                       
                                           
                                                                                       
                                           




Greetings,

             Much FAQ-reading and Google searching has led me here. I'm
having some difficulty with the "unless" attribute of the <target> task. I
have a target, currently named init, with the sole purpose of setting a
property to be used as a buildstamp. Presently, it looks like this:

<target name="init" unless="buildstamp>
             <tstamp>
                         <format property="buildstamp"
pattern="yyyyMMdd-HHmm"/>
             </tstamp>
             <property name="buildstamp" value="blah"/>
</target>

(the <property name...> doesn't affect the results - i put it in just to be
sure the property was being set...). I can refer to ${buildstamp} later in
the file, once this target has been executed, but this target _keeps_
getting run, and buildstamp keeps getting changed (the lowest-level module
we have depends on init, other resources depend on this module..).

Thanks for any assistance, my sincerest apologies if I've asked a silly
question (I checked the FAQs!)!


Justin Maurer
Software Configuration Engineer
Defywire, Inc.
Direct:
Mobile:
Fax:

Email: [EMAIL PROTECTED]

"Enabling the Enterprise"


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







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

Reply via email to