You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Shackelford, John-Mason" <jo...@pearson.com> on 2004/10/28 21:51:48 UTC

ant contrib broken in ant 1.6.2 ?

I am using ant-contrib-1.0b1 and ant 1.6.2. The if task appears to no longer
work.

If I run the statement from the example page:

<!-- - - - - - - - - - - - - - - - - - -->
<!-- target: init-typedef              -->
<!-- - - - - - - - - - - - - - - - - - --> <target name="init-typedef"
depends="basic.xml.init-typedef">
	<typedef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement
location="${esbe.ant-tasks.path}/ant-contrib-1.0b1.jar" />
		</classpath>
	</typedef>
	<if>
		<equals arg1="${foo}" arg2="bar" />
		<then>
			<echo message="The value of property foo is bar" />
		</then>
		<else>
			<echo message="The value of property foo is not bar"
/>
		</else>
	</if>
</target>

The build completes successfully with no output from this target.

bootstrap:

basic.xml.init-typedef:

init-typedef:

BUILD SUCCESSFUL
Total time: 0 seconds


Is this a known issue? 


John-Mason Shackelford

Software Developer
Pearson Educational Measurement 

2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
john-mason.shackelford@pearson.com
http://pearsonedmeasurement.com

**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

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


Re: ant contrib broken in ant 1.6.2 ?

Posted by Kris Read <kr...@gmail.com>.
I'm not sure about your specific example, but I do use Ant 1.6.2 with
many <if> instances on our build and it still works.




On Thu, 28 Oct 2004 14:51:48 -0500, Shackelford, John-Mason
<jo...@pearson.com> wrote:
> 
> I am using ant-contrib-1.0b1 and ant 1.6.2. The if task appears to no longer
> work.
> 
> If I run the statement from the example page:
> 
> <!-- - - - - - - - - - - - - - - - - - -->
> <!-- target: init-typedef              -->
> <!-- - - - - - - - - - - - - - - - - - --> <target name="init-typedef"
> depends="basic.xml.init-typedef">
>         <typedef resource="net/sf/antcontrib/antcontrib.properties">
>                 <classpath>
>                         <pathelement
> location="${esbe.ant-tasks.path}/ant-contrib-1.0b1.jar" />
>                 </classpath>
>         </typedef>
>         <if>
>                 <equals arg1="${foo}" arg2="bar" />
>                 <then>
>                         <echo message="The value of property foo is bar" />
>                 </then>
>                 <else>
>                         <echo message="The value of property foo is not bar"
> />
>                 </else>
>         </if>
> </target>
> 
> The build completes successfully with no output from this target.
> 
> bootstrap:
> 
> basic.xml.init-typedef:
> 
> init-typedef:
> 
> BUILD SUCCESSFUL
> Total time: 0 seconds
> 
> Is this a known issue?
> 
> John-Mason Shackelford
> 
> Software Developer
> Pearson Educational Measurement
> 
> 2510 North Dodge St.
> Iowa City, IA 52245
> ph. 319-354-9200x6214
> john-mason.shackelford@pearson.com
> http://pearsonedmeasurement.com
> 
> ****************************************************************************
> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
> ****************************************************************************
> 
> ---------------------------------------------------------------------
> 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


Re: ant contrib broken in ant 1.6.2 ?

Posted by Peter Reilly <pe...@apache.org>.
Ok, I see the problem:

You (and I) used:
<typedef resource="net/sf/antcontrib/antcontrib.properties"/>
and not
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

The <if> task does  not extend Task so it needs to
use a TaskAdaptor to make it a class. This is done by
using <taskdef/> which is done in the antlib.xml.

So you can use:
<typedef resource="net/sf/antcontrib/antlib.xml"/>

Peter

Peter Reilly wrote:

> You are correct!
> I see the same problem:
>
> <project default="not-works" xmlns:ac="antlib:net.sf.antcontrib">
>  <target name="not-works" depends="works">
>    <typedef resource="net/sf/antcontrib/antcontrib.properties"/>
>    <if>
>      <equals arg1="bar" arg2="bar" />
>      <then>
>        <echo message="The value of property foo is bar" />
>      </then>
>    </if>
>  </target>
>  <target name="works">
>    <ac:if>
>      <equals arg1="bar" arg2="bar" />
>      <then>
>        <echo message="The value of property foo is bar" />
>      </then>
>    </ac:if>
>  </target>
> </project>
>
> outputs:
> works:
>     [echo] The value of property foo is bar
>
> not-works:
>
> BUILD SUCCESSFUL
>
> I will look into it!
> Peter
>
> Shackelford, John-Mason wrote:
>
>> I am using ant-contrib-1.0b1 and ant 1.6.2. The if task appears to no 
>> longer
>> work.
>>
>> If I run the statement from the example page:
>>
>> <!-- - - - - - - - - - - - - - - - - - -->
>> <!-- target: init-typedef              -->
>> <!-- - - - - - - - - - - - - - - - - - --> <target name="init-typedef"
>> depends="basic.xml.init-typedef">
>>     <typedef resource="net/sf/antcontrib/antcontrib.properties">
>>         <classpath>
>>             <pathelement
>> location="${esbe.ant-tasks.path}/ant-contrib-1.0b1.jar" />
>>         </classpath>
>>     </typedef>
>>     <if>
>>         <equals arg1="${foo}" arg2="bar" />
>>         <then>
>>             <echo message="The value of property foo is bar" />
>>         </then>
>>         <else>
>>             <echo message="The value of property foo is not bar"
>> />
>>         </else>
>>     </if>
>> </target>
>>
>> The build completes successfully with no output from this target.
>>
>> bootstrap:
>>
>> basic.xml.init-typedef:
>>
>> init-typedef:
>>
>> BUILD SUCCESSFUL
>> Total time: 0 seconds
>>
>>
>> Is this a known issue?
>>
>> John-Mason Shackelford
>>
>> Software Developer
>> Pearson Educational Measurement
>> 2510 North Dodge St.
>> Iowa City, IA 52245
>> ph. 319-354-9200x6214
>> john-mason.shackelford@pearson.com
>> http://pearsonedmeasurement.com
>>
>> **************************************************************************** 
>> This email may contain confidential material. If you were not an 
>> intended recipient, Please notify the sender and delete all copies. 
>> We may monitor email to and from our network. 
>> **************************************************************************** 
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>


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


Re: ant contrib broken in ant 1.6.2 ?

Posted by Peter Reilly <pe...@apache.org>.
You are correct!
I see the same problem:

<project default="not-works" xmlns:ac="antlib:net.sf.antcontrib">
  <target name="not-works" depends="works">
    <typedef resource="net/sf/antcontrib/antcontrib.properties"/>
    <if>
      <equals arg1="bar" arg2="bar" />
      <then>
        <echo message="The value of property foo is bar" />
      </then>
    </if>
  </target>
  <target name="works">
    <ac:if>
      <equals arg1="bar" arg2="bar" />
      <then>
        <echo message="The value of property foo is bar" />
      </then>
    </ac:if>
  </target>
</project>

outputs:
works:
     [echo] The value of property foo is bar

not-works:

BUILD SUCCESSFUL

I will look into it!
Peter

Shackelford, John-Mason wrote:

>I am using ant-contrib-1.0b1 and ant 1.6.2. The if task appears to no longer
>work.
>
>If I run the statement from the example page:
>
><!-- - - - - - - - - - - - - - - - - - -->
><!-- target: init-typedef              -->
><!-- - - - - - - - - - - - - - - - - - --> <target name="init-typedef"
>depends="basic.xml.init-typedef">
>	<typedef resource="net/sf/antcontrib/antcontrib.properties">
>		<classpath>
>			<pathelement
>location="${esbe.ant-tasks.path}/ant-contrib-1.0b1.jar" />
>		</classpath>
>	</typedef>
>	<if>
>		<equals arg1="${foo}" arg2="bar" />
>		<then>
>			<echo message="The value of property foo is bar" />
>		</then>
>		<else>
>			<echo message="The value of property foo is not bar"
>/>
>		</else>
>	</if>
></target>
>
>The build completes successfully with no output from this target.
>
>bootstrap:
>
>basic.xml.init-typedef:
>
>init-typedef:
>
>BUILD SUCCESSFUL
>Total time: 0 seconds
>
>
>Is this a known issue? 
>
>
>John-Mason Shackelford
>
>Software Developer
>Pearson Educational Measurement 
>
>2510 North Dodge St.
>Iowa City, IA 52245
>ph. 319-354-9200x6214
>john-mason.shackelford@pearson.com
>http://pearsonedmeasurement.com
>
>**************************************************************************** 
>This email may contain confidential material. 
>If you were not an intended recipient, 
>Please notify the sender and delete all copies. 
>We may monitor email to and from our network. 
>****************************************************************************
>
>---------------------------------------------------------------------
>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