Hi Aviesh Thanks a lot for the reply again. What I mean was sometime my programe output the message
"MiniJava program parsed successfully." Sometime it output the message " Encountered errors during parse." How can declare a variable to count the number of times MiniJava program parsed succesfully. Mind you there are number of Java tasks define in the build file. www.nadunh.blogspot.com ________________________________ From: Avlesh Singh <avl...@gmail.com> To: Ant Users List <user@ant.apache.org> Sent: Thursday, August 27, 2009 9:46:54 AM Subject: Re: Help needed regarding Java task As such, the JAVA programme cannot "return" something. You can always write the counter value in a file. Both your java program and ant can read from the same file. Cheers Avlesh On Thu, Aug 27, 2009 at 9:42 AM, Nadun Herath <malakaher...@yahoo.com>wrote: > Hi Aviesh > > Thanks a lot for the reply. I want a declare variable and increment it's > value according the output of the java programe. > Is there a way to achieve that. Will I have to include a script in the > build file to achive that. > > www.nadunh.blogspot.com > > > > > ________________________________ > From: Avlesh Singh <avl...@gmail.com> > To: Ant Users List <user@ant.apache.org> > Sent: Thursday, August 27, 2009 9:25:21 AM > Subject: Re: Help needed regarding Java task > > See, if this usage helps: > > <target name="search"> > <java classname="com.me.searcher.DefaultSearcher" fork="true"> > <arg value="${keyword}"/> > <classpath refid="classpath" /> > </java> > </target> > > <path id="classpath"> > <fileset dir="${build.dir}" includes="*.jar" /> > <fileset dir="${lib.dir}" includes="*.jar" /> > <fileset dir="${conf.dir}" includes="*.properties" /> > <pathelement path="${build.dir}" /> > </path> > > This is being used in the following manner - "ant search -Dkeyword=obama > > Cheers > Avlesh > > On Thu, Aug 27, 2009 at 8:20 AM, Nadun Herath <malakaher...@yahoo.com > >wrote: > > > I am new to apache Ant. > > > > Some part of my build.xml is like this. > > > > <java fork="true" classname="MiniJavaParser" output="result.txt" > > append="true"> > > <classpath> > > <path location="."/> > > </classpath> > > <arg file="ArrayLengthTest.java"/> > > </java> > > > > <!-- 2 --> > > <java fork="true" classname="MiniJavaParser"> > > <classpath> > > <path location="."/> > > </classpath> > > <arg file="ArrayRefTest.java"/> > > </java> > > > > I have to run a Java program Called MiniJavaParser using different > file > > names as arguements several > > times using Java Task. When it runs it gives the message > > > > "MiniJava program parsed successfully" or Encountered errors during > > parse. > > > > I want to declare a variable as a counter and increment it's value when > it > > gives the message "MiniJava Program parsed successfully". > > > > What is the approach I should take. > > > > Thank you very much. > > > > > > > > > >