<for > -Build Failed:problem 2004-08-02 - By Inger, Matthew
I have tried this, and i'm not seeing the problem. However, if you use the .xml file in ant 1.5, you will get the the "taskdef class cannot be found" message.
If you use the properties file, everything works fine.
<target name="do.echo"> <echo message="loop.var=${loop.var}" /> </target>
<target name="test.loop"> <antcall target="do.echo" /> </target>
<target name="test"> <foreach list="a,b,c,d" target="test.loop" param="loop.var" /> </target>
I also tried removing the antcall, and putting depends="do.echo" on the test.loop target, and everything still worked just fine.
can you send me an project with an isolated instance of the problem you're having?
Also, please send me the results of running: ant -version
-----Original Message----- From: Inger, Matthew [mailto:Inger@(protected)] Sent: Monday, August 02, 2004 11:07 AM To: 'Ant Users List' Subject: RE: <for> -Build Failed:problem
What i would do is this, inside of the target you're calling from the <foreach> task, set a property with the value you want to propogate:
<target name="loop.target"> <property name="visibile.to.targets" value="${loop.parameter}" /> <antcall ... /> </target>
It may have something to do with the way that antcall works. I will take a look at it and see if i can reproduce your problem, but in the meantime, the above solution should work for you.
-----Original Message----- From: Angeshwar Deepak [mailto:angeshwar@(protected)] Sent: Monday, August 02, 2004 11:04 AM To: Ant Users List Subject: RE: <for> -Build Failed:problem
Ya, checked it and added it. But it sets to true by default I guess, but still added it but still the same problem. The value of the property is visible only inside 1 ant call.
bye, with regards, Deepak.
--- "Inger, Matthew" <Inger@(protected)> wrote:
> have you tried setting inheritall to true on your > other <antcall> > instances? > > -----Original Message----- > From: Angeshwar Deepak [mailto:angeshwar@(protected)] > Sent: Monday, August 02, 2004 10:48 AM > To: Ant Users List > Subject: RE: <for> -Build Failed:problem > > > Hi, > > I tried with the XML file as well. > > BUILD FAILED > D:\deepak\buildProcess_2\_lib\build\apache-forrest-0.5.1-bin\forrest.build.x > ml:38: > taskdef class cannot be found > > Total time: 1 second > > D:\deepak\buildProcess_2\logging>ant -version > Apache Ant version 1.6.2 compiled on July 16 2004 > > The Ant version is also the latest, where could the > problem be??? > > Any way I left the for and decided to use > <for-each>, > but I have 1 problem here. I have already posted the > problem anyway lets hop I am more clear this time > > I am using <for-each> task to set the properties > and I want them to be global. i.e. I want the value > of the property in any ant target I call. > > > <project default="site" basedir="." name="forrest"> > .... > .... > <taskdef > resource="net/sf/antcontrib/antcontrib.properties"/> > <target name="init-props"> > <foreach list="logging,app,add" param="archive" > target="base" > inheritall="true" inheritrefs="true"> > </foreach> > .... > .... > <antcall target="a" /> > </target> > > <target name="a" depends="init-props"> > .... > <antcall target="b" /> > </target> > > <target name="b" depends="init-props"> > </target> > > <target name="base"> > <echo>****${archive}****</echo> > <property name="current.archive" value="${archive}" > /> > <echo>****${current.archive}****</echo> > </target> > > > The problem is I am not able to use the > ${current.archive} or ${archive} in other > ant tasks. Inside the 'base' ant task, they work > fine, but in other ant task its not visible. > How can I make them global? > > Any help reg this will be great. > > bye, > with regards, > Deepak. > > > > bye, > with regards, > Deepak. > --- "Inger, Matthew" <Inger@(protected)> wrote: > > > taskdef takes several different types of > parameters. > > > > Prior to ant 1.6, you could either specify a > > classname, or a > > resource name. The resource name indicated the > name > > of a properties > > file which could specify tasks. The property name > > was the task name, > > and the value was the class which defined the > task. > > > > Ant 1.6 added the ability to load an xml file with > > the task > > definitions as well. This is the preferred way to > > load multiple > > tasks in Ant 1.6, though the .properties file is > > still supported, > > and individual task definitions are still > supported > > as well. > > > > <taskdef resource="net/sf/antcontrib/antlib.xml" > /> > > > > > > -----Original Message----- > > From: Angeshwar Deepak > [mailto:angeshwar@(protected)] > > Sent: Monday, August 02, 2004 10:28 AM > > To: Ant Users List > > Subject: RE: <for> -Build Failed:problem > > > > > > Hi, > > > > I searched for the xml file u mentioned to. Its > > available onliny in ant-contrib-1.0b1 (the latest > > version). In the previous versions there is no > such > > xml file. > > > > Also the taskdef task takes only a classfile as > > attribute. I cannot understand how it takes a xml > > file. Could u please give me an example of how u > > used > > it. > > > > bye, > > with regards, > > Deepak. > > > > > > --- "Khehra, Sukh" <Sukh.Khehra@(protected)> wrote: > > > > > properties file is needed in ant 1.5 versions i > > > think. try it with the xml file. i have it > running > > > quite well. > > > > > > > > > -----Original Message----- > > > From: Angeshwar Deepak > > [mailto:angeshwar@(protected)] > > > Sent: Monday, August 02, 2004 10:00 AM > > > To: Ant Users List > > > Subject: RE: <for> -Build Failed:problem > > > > > > > > > Hi, > > > > > > In the site > > > > > > http://ant-contrib.sourceforge.net/ > > > > > > Under installation its mentioned to include the > > line > > > > > > <taskdef > > > > > > resource="net/sf/antcontrib/antcontrib.properties"/> > > > > > > If u want to use ant-contrib tasks. > > > kindly correct me if I am wrong. > > > > > > > > > bye, > > > with regards, > > > Deepak. > > > > > > > > > --- "Khehra, Sukh" <Sukh.Khehra@(protected)> wrote: > > > > > > > shouldn't you say <taskdef > > > > resource="net/sf/antcontrib/antlib.xml"> ? > > > > > > > > -----Original Message----- > > > > From: Angeshwar Deepak > > > [mailto:angeshwar@(protected)] > > > > Sent: Monday, August 02, 2004 6:14 AM > > > > To: Ant Users List > > > > Subject: RE: <for> -Build Failed:problem > > > > > > > > > > > > Hi, > > > > > > > > I tried that too, but still it does'nt work. > But > > > > for-each task works, the problem is only with > > for > > > > task. > === message truncated ===
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|