Modify

Ticket #43 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

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

Reported by: hans Owned by: 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

comment:1 Changed 6 years ago by hans

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

comment:2 Changed 6 years ago by hans

  • Status changed from new to closed
  • Resolution set to fixed

Merged into branch in changeset:76

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.