ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Ant question

Post new topic  Reply to topic
 Ant question « View previous topic :: View next topic » 
Author Message
jefflowrey
PostPosted: Mon Apr 04, 2005 2:38 pm    Post subject: Ant question Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I need to run an external process from Ant.

I'm having some difficulties. I'm by no means an expert at writing Ant tasks - I figured this one would be simple.

The difficulty I'm having is that I need to specify an argument like "-file=" and then specify the file name.

But I need to do a loop over a directory, and run this task against certain files.

So I tried a varient of the apply/Exec on task, (from the docs for 1.6.x)
Code:
<apply executable="somecommand" parallel="false">
  <arg value="-file="/>
  <srcfile/>
...
</apply>


But that put a space before the value of <srcfile/>.

I've started writing a custom Ant task that will run my external program for a specific input file and output file. But there's got to be a simpler way.

Any Ant experts out there?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 06, 2005 9:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Anyone?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
malammik
PostPosted: Wed Apr 06, 2005 10:39 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

Not sure if this helps at all.
<executable keep="true" failure="abort" stage="install" type="jar"
targetfile="$INSTALL_PATH/bin/ant-launcher.jar">
<args>
<arg value="-buildfile" />
<arg value="$INSTALL_PATH/bin/build.xml" />
<arg value="-propertyfile" />
<arg value="$INSTALL_PATH/bin/build.properties" />
<!-- Log ant install details here -->
<arg value="-logfile" />
<arg value="$INSTALL_PATH/bin/logs/apache-ant-1.6.2-bin.log" />

<!-- Ant task that we want to call -->
<arg value="apache-ant-1.6.2-bin" />
</args>
</executable>
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
jefflowrey
PostPosted: Wed Apr 06, 2005 10:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I'm not sure if that helps either.

It looks like that will build arguments like "-buildfile $INSTALL_PATH/bin/build.xml", with a space between "-buildfile" and the next argument.

I need to have no spaces between "-file=" and the value of the source file. So, for instance, "-file=/tmp/myfile", not "-file= /tmp/myfile".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Ratan
PostPosted: Wed Apr 06, 2005 12:12 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

I never wrote Ant scripts, so just a thought :


Cant you just do

<apply executable="somecommand.bat" parallel="false">
<srcfile/>
...
</apply>

somecommand.bat is a script containing the command

somecommand -file=$1
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Apr 06, 2005 12:23 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Ratan wrote:
somecommand.bat is a script containing the command


Well...

Yeah.

It's a good idea. It will certainly solve the problem.

But there should be a way to do this *in* Ant. It would be really bothersome if there isn't.

I guess I'll go do some research...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Ant question
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.