ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David McTavish <>
Subject RE: trying to write custom task wrapping Exec
Date Thu, 06 Feb 2003 21:17:35 GMT
I had the impression that the ant-contrib was C++ only? 
Thanks for the info. I've run into the PATH vs. path before, and use the
fully qualified path throughout. It's most likely a case thing. (VB6.EXE vs.
VB6.exe potentially). Perhaps I'll just force the user to add the
executables to their local path before execution...


-----Original Message-----
From: Dominique Devienne []
Sent: Thursday, February 06, 2003 4:12 PM
To: 'Ant Users List'
Subject: RE: trying to write custom task wrapping Exec

If bin.vb contains only the compiler's short name (without path), even if
you rewrite the system path using a nested <env>, can lead to error=2 on
Windows. That's what I have learned.

It works for some people on some machine (all Windoze machines), but not on
some others, for a reason I've never elucidated. Only solution for the few
machine it didn't work was to put the full path name to the executable run
(specified in user/machine-specific properties file).

Also note that we seen weird things happen when not using exactly the same
case for the Windoze Path (or path or PATH) variable, in some cases. The
case is irrelevant at the cmd.exe command line, but <exec>'ing Visual
Studion from Ant, when not using the right case, caused VS to not find some
of it's own build tools (it was forking), when all the necessary directories
where in the path (and VS started correctly).

In one custom task I wrote that uses <exec> to fork a process, I first look
for the existing path (recording it's case), and then prepend to it,
stuffing the result in a nested <env key="Path using whatever current case
is used" path="myPath.toString()" />

I hope this helps. --DD

PS: Doesn't Ant-Contrib's <cc> have a VB compiler/linker?

-----Original Message-----
From: David McTavish [] 
Sent: Thursday, February 06, 2003 2:44 PM
To: 'Ant Users List'
Subject: trying to write custom task wrapping Exec

Just wondering how I can update the path for the ExecTask. I've borrowed
code from the optional Cab task, but I wish to update the path used by the
Execute object. Here is what I currently have:

            ExecTask exec = createExec();
            if (vbBinaryDir != null)
                    Environment.Variable var = new Environment.Variable();
                catch (IOException e)
                    throw new BuildException();

For some reason, by setting the binaryDir (configured as a File and set in
the ant build script with binaryDir="path/to/file.exe"), it is not finding
the file appropriately, but the path is correct. 
(I test this by rewriting this as an exec task, and pass in the path with
the env/key= parameter as follows:

            <exec executable="${bin.vb}" dir="${vb.projectdir}">
                <env key="path" path="${lib.sw-tools}/vb/bin"/>
                <arg line="/m ${vb.projectfile} /out

Is there an easy way to convert a File object into a org.ant...Path object?
And is this, where I am going wrong?

(And is there an official Visual Basic compiler task, which would make me
writing this task overkill?)


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message