ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <bi...@progress.com>
Subject Re: <exec> task on NT/2000
Date Sun, 28 Jan 2001 02:44:33 GMT
Hello,

"Preston L. Bannister" wrote:
> 
> > David.Bailey@lawson.com wrote:
> > > We've moved from a makefile system (GNUmake on UNIX, NMAKE on
> > > Windows) to ant, and on the whole we're happy with it.
> > > However, we have discovered an irritating
> > > feature of the <exec> task.
> > >
> > > If I call
> > >
> > >      <exec executable="perl">
> > >           <arg value="foo.pl" />
> > >      </exec>
> > >
> > > then (I believe) ant passes "perl foo.pl" to the command line,
> > > and Windows knows what to do with it.  Even though I passed
> > > "perl" and not "perl.exe", it still launches foo.pl correctly.
> 
> From: Bill Burton [mailto:billb@progress.com]
> > Evidently perl.exe is in your path.  The automatic handling of .exe's
> > could quite possibly be built into the Windows CreateProcess function.
> >
> > If you had the .pl suffix mapped to the path of your perl.exe so Windows
> > knows how to deal with .pl files when it gets the "Open" action, you could
> > probably run the script directly:
> >     <exec executable="foo.pl"/>
> 
> I don't believe this works, as the JVM would need to call
> the Win32 ShellExecute() API (the Windows "shell" understands
> file extension associations).  I believe the JVM calls the
> Win32 CreateProcess() API instead.
> 
> OTOH - I can't say I've re-tested this on Java 1.3 ...

You're right.  It doesn't work on either 1.2.2 or 1.3.  This must be
specific to .bat files and not generic to all file types using
ShellExecute().

-Bill Burton

Mime
View raw message