Ticket #43 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Top-level (no target) IfTask doesn't work correctly

Reported by: hans Assigned to: hans
Priority: major Milestone: 2.2.0
Component: Version: 2.2.0RC1
Keywords: Cc:

Description

The IfTask is prematurely configured when it is not contained within a target.

Simple reproduction:

<project name="test" default="main" basedir=".">

  <available file="./build.properties" property="globalBuildPopertiesExists"/>
  
  <if> 
  	<and>
  		<isset property="globalBuildPopertiesExists"/>
  	</and>
  	<then>
  		<echo>Yeah, the property was set!</echo>
	</then>	
  </if>
  
  <target name="main">
  	<echo>In main...</echo>
  </target>
  
</project>

The above will always echo "Yeah, the property was set!" regardless of whether the property was actually set.

Attachments

Change History

05/23/06 14:25:20 changed by hans

Thanks to Matthias for solution here. Fixed in trunk in changeset:75

05/23/06 14:25:36 changed by hans

  • status changed from new to closed.
  • resolution set to fixed.

Merged into branch in changeset:76


Add/Change #43 (Top-level (no target) IfTask doesn't work correctly)




Action