ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: Problem to set property with refid
Date Fri, 21 May 2004 17:19:15 GMT
Thirdparty tasks/types do not get defined automatically if the
corresponding jar file in in the path:
One can use a <taskdef resource="x.xml"/> or use the
new XMLNS naming convention.

<project>
   <taskdef resource="net/sf/antcontrib/antlib.xml"/>
   <for param="letter" list="a,b,c">
      <sequential>
         <echo>letter is @{letter}</echo>
     </sequential>
  </for>

</project>

or
<project xmlns:ac="antlib:net.sf.antcontrib">
   <ac:for param="letter" list="a,b,c">
      <ac:sequential>
         <echo>letter is @{letter}</echo>
     </ac:sequential>
  </ac:for>
</project>

Also, one should not use the classpath to
set this up.

One should drop the antcontrib(x).jar into $ANT_HOME/lib
and just use the ant batch/script file to set the classpaths
correctly.

Peter
Srikrishna.Partha@wellsfargo.com wrote:

>What you have in the classpath ...echo it ..In a real situation , you have
>shouldn't have anything in the system classpath...your batch or setenv
>should set them.... unset your classpath  variable if you set them in the
>classpath ...
>
>Hope my suggestion helps
>
>-----Original Message-----
>From: vinod.nayak@iflexsolutions.com [mailto:vinod.nayak@iflexsolutions.com]
>
>Sent: Friday, May 21, 2004 9:20 AM
>To: user@ant.apache.org
>Subject: RE: Problem to set property with refid
>
>Hi Bill(Gates!?)
>
>I downloaded the ant-contrib-1.0b1.jar and placed in the ant classpath as
>below..
>Still it is giving the same message.
>
>Any idea why its happening?
>
>ANT_CLASSPATH=$ANT_HOME/lib/ant.jar:$ANT_HOME/lib/ant-launcher.jar:$ANT_HOME
>/lib/xercesImpl.jar:$ANT_HOME/lib/xml-apis.jar:$WLS_HOME/lib/ant-contrib-1.0
>b1.jar:$JAVA_HOME/lib/tools.jar
>
>(All the paths 100% exists)
>
>Thanks in advance,
>Vinod.
>
>-----Original Message-----
>From: Bill Rich [mailto:billrich@attglobal.net]
>Sent: Friday, May 21, 2004 9:14 PM
>To: 'Ant Users List'
>Subject: RE: Problem to set property with refid
>
>
>The For task is in the Ant-contrib package. 
>
>-----Original Message-----
>From: vinod.nayak@iflexsolutions.com [mailto:vinod.nayak@iflexsolutions.com]
>
>Sent: Friday, May 21, 2004 7:52 AM
>To: user@ant.apache.org
>Subject: RE: Problem to set property with refid
>
>Hi Neta,
>
>Is 'for' task is not part of Ant 1.6.1 distribution?
>I got this error when included the task in build.xml
>
>BUILD FAILED
>/products/proj/pisars/dist/build.xml:508: Could not create task or type of
>type: for.
>
>Ant could not find the task or a class this task relies upon.
>
>Rgds,
>Vinod.
>
>-----Original Message-----
>From: Neta Bar Tal [mailto:NETAB@Amdocs.com]
>Sent: Tuesday, May 18, 2004 10:04 PM
>To: Ant Users List
>Subject: RE: Problem to set property with refid
>
>
>
>Hi Jan
>You are right I fixed it that way so now it works for <for> task...:-)
>
><for list="${dynamics}" delimiter=" " param="dir">
>		  <sequential>
>			<path id="sources.path.@{dir}">
>		      		<fileset dir="${env.CCWSCA}/@{dir}">
>		      			 <include name="*.java" />
>		      		</fileset>
>		     	</path>
>		    	<property name="sources.@{dir}"
>refid="sources.path.@{dir}"/>
>		    	<echo>the sources are ${sources.@{dir}}</echo>    
>
>		  
>
>		  	<echo>compiling package:@{dir}</echo>
>		   	<javac debug="${env.JAVA_DEBUG}"
>destdir="${env.CCWPA}/classes" failonerror="false" includeantruntime="false"
>listfiles="no" optimize="on" srcdir="${env.CCWSCA}">
>	                   <include name="@{dir}/*.java" />
>	            	  <classpath path="${classpath}"/>
>			</javac>
>		  </sequential>
>		</for>
>
>
>
>Neta Bar-Tal
>
>* 972-9-7960521
>
>*netab@amdocs.com
>
>
>-----Original Message-----
>From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
>
>Sent: Tuesday: May 18: 2004 7:27 PM
>To: user@ant.apache.org
>Subject: RE: Problem to set property with refid
>
>You canĀ“t use <property> inside a <for>, because properties are immutable.
>If you use <foreach> it could be work...
>
>Jan
>
>  
>
>>-----Original Message-----
>>From: Neta Bar Tal [mailto:NETAB@Amdocs.com]
>>Sent: Tuesday, May 18, 2004 6:21 PM
>>To: Ant Users List
>>Subject: Problem to set property with refid
>>
>>    
>>
>
>  
>
>
>  
>
>
>  
>
>>Hi all,
>>I'm trying to do the following:
>>
>>    
>>
>
>  
>
>
>  
>
>><for list="${dynamics}" delimiter=" " param="dir">
>>    <sequential>
>>   <path id="sources.path">
>>          <fileset dir="${env.CCWSCA}/@{dir}">
>>            <include name="*.java" />
>>          </fileset>
>>        </path>
>>       <property name="sources" refid="sources.path"/>
>>       <echo>the sources are ${sources}</echo>   
>>    
>>
>
>  
>
>
>  
>
>>   
>>    
>>
>
>  
>
>
>  
>
>>     <echo>compiling package:@{dir}</echo>
>>      <javac debug="${env.JAVA_DEBUG}" destdir="${env.CCWPA}/classes"
>>failonerror="false" includeantruntime="false" listfiles="no"
>>optimize="on" srcdir="${env.CCWSCA}">
>>                    <include name="@{dir}/*.java" />
>>                <classpath path="${classpath}"/>
>>   </javac>
>>    </sequential>
>>  </for>
>>
>>    
>>
>
>  
>
>
>  
>
>
>  
>
>
>  
>
>>I'll explain - i'm iteraring over all my packages and run the <javac>
>>    
>>
>
>  
>
>>command for each package.
>>I want to set the property ${sources} to see if there are java files
>>    
>>
>
>  
>
>>in it and run it only if there are files.
>>the output is:
>>
>>    
>>
>
>  
>
>
>  
>
>>compile_packages_job:
>>   [depend] Deleted 325 out of date files in 19 seconds
>>     [echo] the sources are
>>     [echo] compiling package:amdocs
>>Overriding previous definition of reference to sources.path
>>     [echo] the sources are
>>     [echo] compiling package:amdocs/csm3g Overriding previous
>>    
>>
>
>  
>
>>definition of reference to sources.path
>>     [echo] the sources are
>>     [echo] compiling package:amdocs/csm3g/sessions
>>
>>    
>>
>
>  
>
>
>  
>
>
>  
>
>>can you please help me with this issue?
>>netaB
>>
>>    
>>
>
>  
>
>
>  
>
>
>  
>
>
>  
>
>
>  
>
>
>  
>
>
>  
>
>>The information contained in this message is proprietary of Amdocs,
>>    
>>
>
>  
>
>>protected from disclosure, and may be privileged.
>>The information is intended to be conveyed only to the designated
>>    
>>
>
>  
>
>>recipient(s) of the message. If the reader of this message is not the
>>    
>>
>
>  
>
>>intended recipient, you are hereby notified that any dissemination,
>>    
>>
>
>  
>
>>use, distribution or copying of
>>
>>    
>>
>
>  
>
>>this communication is strictly prohibited and may be unlawful.
>>
>>    
>>
>
>  
>
>>If you have received this communication in error, please notify us
>>    
>>
>
>  
>
>>immediately by replying to the message and deleting it from your
>>    
>>
>
>  
>
>>computer.
>>Thank you.
>>
>>    
>>
>
>
>
>The information contained in this message is proprietary of Amdocs,
>protected from disclosure, and may be privileged.
>The information is intended to be conveyed only to the designated
>recipient(s) of the message. If the reader of this message is not the
>intended recipient, you are hereby notified that any dissemination, use,
>distribution or copying of
>
>this communication is strictly prohibited and may be unlawful.
>
>If you have received this communication in error, please notify us
>immediately by replying to the message and deleting it from your computer.
>Thank you.
>
>---------------------------------------------------------------------
>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
>
>
>---------------------------------------------------------------------
>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


Mime
View raw message