Bugs item #1503499, was opened at 2006-06-09 14:53
Message generated for change (Comment added) made by drieseng
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1503499&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tasks
Group: 0.85
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Karl Palsson (kpalsson)
>Assigned to: Gert Driesen (drieseng)
Summary: asminfo attributes parse values regardless of if/unless

Initial Comment:

This is with nant 0.85 rc4


>From the documentation on 

"If true then the task will be executed; otherwise,
skipped. The default is true."
"Opposite of if. If false then the task will be
executed; otherwise, skipped. The default is false."

I read that to mean that in the below two lines, if
CCNetLabel is defined, the description will go to
"Cruise control automated build of projectXYZ", and if
it's not, it will say "Release image of project XYZ"

The property does NOT exist, I'm running nant from the
command line, not from ccnet, so I expect that the
first line will get killed, as the "if"
test fails, and the second line will get taken.  I was
certainly not expecting that the value="" portion of
the first line would still get evaluated, and throw
errors if it failed.


<attribute type="AssemblyDescriptionAttribute"
if="${property::exists('CCNetLabel')}"
value="CruiseControl automated build of
${CCNetProject}" /> <attribute
type="AssemblyDescriptionAttribute"
unless="${property::exists('CCNetLabel')}"
value="Release Image of ${project::get-name()}" /> 



---- from gary ---
There are still some NAnt elements that parse their
arguments before checking the if/unless attributes.  To
work around this problem, use the <if> block (which,
unlike <ifnot>, is not deprecated).

Also, please a) make sure you're running against the
latest release candidate; b) if the bug is still there,
please search the bug database to see if it has been
reported; and c) if it hasn't been reported, please
enter a bug report for it.

a) yes, rc4
b) seems to be, yes :)
c) can't find anything with asminfo anywhere in the
summary, filed this bug

----------------------------------------------------------------------

>Comment By: Gert Driesen (drieseng)
Date: 2006-07-23 12:33

Message:
Logged In: YES 
user_id=707851

Karl, this is by design. Attributes and child elements of 
a task are always initialized regardless of the if/unless 
attributes.

Possible workarounds for your particular issue are:

1. nest the <asminfo> task in an <if> task
2. combine the two seperate <attribute> elements into one 
using the inline if function:

<attribute type="AssemblyDescriptionAttribute" value="${if
(property::exists('CCNetLabel'), 'CruiseControl automated 
build of ' + CCNetProject, 'Release Image of ' + 
project::get-name())}" />

Hope this helps!

Gert

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1503499&group_id=31650

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to