ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: ant "run" target
Date Tue, 23 Jul 2002 18:33:45 GMT

----- Original Message -----
From: "Mike Charters" <mcharter@umich.edu>
To: <ant-user@jakarta.apache.org>
Sent: Tuesday, July 23, 2002 5:58 AM
Subject: ant "run" target


> hi,
>
> i am new to ant and developing in java in general.
>
> i was curious if it is typical to have an ant "run" target, just for
> running your program?  or is there another way that you java guys do it?

no, we run from ant all the time. I prefer to set fork=true and the same for
failonerror

  <target name="import-wsdl" depends="fetch-wsdl">
    <java
      classname="org.apache.axis.wsdl.WSDL2Java"
      fork="true"
      failonerror="true"
      classpathref="axis.classpath"
      >
      <arg file="${local.wsdl}"/>
      <arg value="--output"/>
      <arg file="${generated.dir}"/>
      <arg value="--verbose"/>
      <arg value="--package"/>
      <arg value="soapapi"/>
      <arg value="--testCase"/>
   </java>
  </target>

This is a 3rd party app, but I almost always run my own code from inside ant
as it guarantees the build first, and has good argument processing.

We even use as the boot launcher for our overnight load tests, making full
use of the <sleep> task.

> i noticed the book i have (ant: the definitive guide) did not say much
> about using the <java> command in the ant buildfiles much ... and i
> wondered if there is a reason (like maybe there is a different way to do
> it?)?

The reason is the book is somewhat limited in its scope :(  But there will
be a better one out in two weeks, and there is always the online
documentation, that I use so much it is my home page.

>when you do a distrib and run your program ... how do you run your
>distribution version?  do you use something like:

>java -jar somefile.jar

you can set a jar in the <java> task; this means that you have to point to
the entry point in your manifest, which means using the <manifest> task,
perhaps inside <jar>.

The other thing to run inside ant is your unit tests; look at junit.org to
discover about junit.

-Steve


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


Mime
View raw message