Bug 64078

Summary: [PATCH] targets produce confusing verbose messages when using if/unless attributes
Product: Ant Reporter: Artem Bisyarin <artsus4>
Component: CoreAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: minor    
Priority: P2    
Version: nightly   
Target Milestone: ---   
Hardware: PC   
OS:    
Attachments: the build-file, and patch

Description Artem Bisyarin 2020-01-15 22:14:33 UTC
Created attachment 36966 [details]
the build-file, and patch

For example, I use a target with 'if' attribute, which value expands to a boolean:
<property name="run_test-if" value="no" />
<target name="test-if" if="${run_test-if}" />

In this case in verbose messages I expected to see some information on skipping the target because of a falsy value after property expansion. Instead I saw this: "Skipped because property 'no' no set".

Please, see the attachment containing a build-file, and my humble patch with a possible solution.

Run the build-file as:
ant -v test-if
ant -v test-unless
ant -v test-if-non-boolean-expansion
ant -v test-unless-non-boolean-expansion
(the last two targets are more for testing the patch)