ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: build.exe
Date Sat, 07 Jul 2001 16:58:11 GMT

----- Original Message -----
From: "Nico Seessle" <nico@seessle.de>
To: <ant-dev@jakarta.apache.org>
Cc: <southgate.software@home.com>
Sent: Saturday, July 07, 2001 8:07 AM
Subject: Re: build.exe


> ----- Original Message -----
> From: "Michael Jennings" <southgate.software@home.com>
> To: <ant-dev@jakarta.apache.org>
> Sent: Sunday, June 24, 2001 9:56 PM
> Subject: build.exe
>
>
> > A while ago I sent a message to the ant-user mailing list saying that I
> had
> > developed a win32 executable for running ANT. I posted a URL with
> > a link to source code+exe but it doesn't look like it made it into
> > the ANT distribution.
>
> I had a look at it today, since there are so many problems with ant.bat on
> different Windows-versions.
>
> I have it working on my system (W2K, SP2) with JDK 1.3, JDK 1.3.1, JDK 1.4
> and it does not seem to have any problems with Ant being installed in a
> directory with spaces.
>
> I had the following problems with it:
> - I didn't know how to compile it (found out that you can compile it with
> for example
>   "bcc32 -WC -ID:\jdk13\include -ID:\jdk13\include\win32 *.cpp")
> - The source looked ugly to me (I reformatted it a little bit)
> - It didn't work with JDK 1.4 (there is no classic-vm in JDK 1.4) (*1)
> - It didn't worked for me without passing any argument (it passed "null"
to
> main() instead of an empty array)

> Some problems remain:
> - Doesn't work with JDK 1.1 (Don't know how to start a VM?)

MS JVM is fairly easy to start from an exe; its just a COM object or
something. The source to do it comes with the MS j++ SDK. But I'm not sure
we should encourage use of java1.1 or corrupted variants, at least not if it
involves extra effort on our part.

> - You can't pass any arguments to the VM (to specify memory sizes).

Interesting -I wonder how java.exe does it?

>
> Please be warned: I'm not a good C (or CPP) programmer, so that modified
> version may do anything to your system (but I don't think so, maybe I
> introduced some memory-leaks as I'm not very good at working with
pointers).

I've looked at the source; no pointer problems spring to mind, though I'd
use more of std::sting than legacy sprintf stuff.

If I were using/editing this app, here are the changes I'd make. Note I'm
not promising to make the changes, I just know what to do if I had the time
:-)

1. check for JIKESPATH and set the jikes option if found
2. check for ANT_HOME and if it is there (and valid), use it instead of
using ::GetModulePath() to work out location

Adding these two checks would let you install by configuring the env
variables but not changing path -dropping ant into %SYSTEM32% instead would
be all that an installer needs to do.

3. make it build under msvc. Some pragmas and things look different; a few
#ifdefs will address that

I'd debate making the thing build in unicode, but am not in favour. The
source is very char oriented right now, but even if it was upped to using
TCHAR for narrow and wide builds, without a unicode entry point to the jvm
invocation, you dont gain much from the work. Plus it would inevitably make
dual bcc and msvc building more complex.

-Steve







Mime
View raw message