ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oisin Kim" <oisin....@aurium.net>
Subject RE: Run time commands - a Solution
Date Wed, 17 Apr 2002 15:35:23 GMT
Hi All,

Ok thanks, that's much clearer now, my only apology is that I didn't
make myself clearer from the first email, I was clearly asking the wrong
question!

Just for the benefit of anyone who will need to do something like this
again. 
Here's a sample target which will allow user input from System.in or the
running Java application:

<target name="run-with-user-input" depends="build-classes">
<!--build-classes will simply build the classes used by this task-->
    <java classname="org.apache.SomeClassName" >      
      <classpath refid="some.classpath"/> <!--the classpath-->
      <arg value="some.properties"/> 	<!--a paramter, a properties
file-->
      <arg value="somefilename.txt"/>	<!--a paramter, some file
name-->
      <arg value="-mnop"/>			<!--a paramter, passing
options in-->
    </java>
</target>

Since this java command no longer uses the option "fork=true" you can't
define a Path to run java from, everything is run relative to the folder
the Ant build script is contained (if you run Ant from the command line)
in or if you're using something like netbeans, relative to the netbeans
bin directory, although this may be just a config issue! (sorry for the
OT ness of that!)

Hope this helps someone!

Much thanks go to Stefan and Kevin!

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


--
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