ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Genter <rick.gen...@gmail.com>
Subject Re: Target Execution Sequence
Date Sun, 30 Oct 2011 04:17:22 GMT
Meanwhile a few things to remember:

- if you want targets to execute in a specific order, you have to set up their dependencies
appropriately. Targets that are not directly dependent upon each other are not guaranteed
to execute in any particular order.
- properties are immutable. Once set, you can't change them.

Good luck.

On Oct 29, 2011, at 8:54 PM, Rhino wrote:

> 
> I was afraid you were going to say that. It'll take a while to obfuscate the parts that
I don't want to make public. I'll send it along tomorrow.
> 
> --
> Rhino
> 
> On 2011-10-29 22:11, Vimil Saju wrote:
>> It would be helpful if you could attach the build file along with the mail.
>> 
>> 
>> ________________________________
>> From: Rhino<rhino1@sympatico.ca>
>> To: ant-user<user@ant.apache.org>
>> Sent: Saturday, October 29, 2011 5:47 PM
>> Subject: Target Execution Sequence
>> 
>> 
>> I'm having a perplexing problem and I'm hoping someone here can help me understand
whatever I'm missing. I was moderately fluent with Ant at one point but I've been away from
it a  while and have probably just forgotten some fundamental that I need to know.
>> 
>> Here's the deal. I have an Ant script that is displaying an AntForm. The AntForm
contains some checkboxes that are supposed to make me keep or omit three particular paragraphs
in a document I am writing later in the script. Basically, I use the AntForm to set specific
booleans, one for each of the three paragraphs, in a Java source file to true or false. Then,
I generate the document with a program that I've written and that program either writes the
specified paragraphs or omits them based on the values of the booleans. At least, that's what's
SUPPOSED to happen.
>> 
>> In reality, the booleans are being seen by the program that generates the document
as true regardless of what has been done with the AntForm. Therefore, all three special paragraphs
always appear in the document even when I've asked for some or all of them to be omitted.
>> 
>> This baffles me because I actually display the contents of the Java source file to
myself in the Ant script before and after the execution of the program that generates the
document and the values of the three booleans and they have the correct values. For instance,
I can set the three booleans to false, true and false respectively via the AntForm and that's
exactly how they appear in the Java source file just before I generate the document.  (Then
I reset the values to their defaults (all three true) then display them to myself and they
are all true.) However, when I write the values of the booleans within the program that is
generating the document, they are invariably all true, even if they have been set to different
values.
>> 
>> I don't understand why I'm getting this misbehaviour.
>> 
>> My working theory is that Ant is NOT executing the tasks within the script in the
expected order. When I add the -verbose and -debug parameters to the Ant Build, I see something
that the task that displays the AntForm is done in its proper sequence, namely first within
the script. However, the tasks that are to be executed to change the values of the booleans
are NOT executed immediately after the AntForm is displayed but after the compile of the Java
code. The script is displaying the AntForm and letting me check the checkboxes as I like,
then compiling the code and ONLY THEN actually editing the source file to set some of the
booleans to false. I think this explains why the switches are always seen as true by the document-generating
program: the generator is simply not getting the edited version of the source file.
>> 
>> Can anyone confirm that my theory makes sense? Or, if it doesn't, suggest a better
explanation? If I'm on the right track, what is it that I'm not understanding about the execution
sequences of tasks within targets? I had assumed that each task within a target would be executed
before tasks in other targets were started....
>> 
>> --
>> Rhino
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

--
Rick Genter
rick.genter@gmail.com


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


Mime
View raw message