ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avlesh Singh <avl...@gmail.com>
Subject Re: Help needed regarding Java task
Date Thu, 27 Aug 2009 03:55:21 GMT
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 <malakaherath@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.
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message