ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: [Patch] trying solve w2k command line length limitations
Date Mon, 07 Apr 2003 14:18:04 GMT
I've solved that problem for my own purposes a few months ago, by just
hacking a bit at java.c, so it can read it's command line arguments from a
file, using the usual @file syntax (that Javac already supports, but
implemented in Java). Even enabled env. var. substitutions a la Ant, using
the ${env.VARNAME} syntax. You can even *set* env. var. within that command
line file, which is something I needed to debug JNI code from within Visual
Studio, to set the Path (using env. vars. to be location independent) to
find dependents of native libraries (since SUN apparently can't use
LoadLibraryEx as Steve L. pointed out). That hacked up java.exe (Windows
HACK only) find the right JDK as specified in the registry, which is just
normal behavior (didn't have to code that).

Never had a problem since... --DD

-----Original Message-----
From: Ignacio J. Ortega [mailto:nacho@siapi.es] 
Sent: Saturday, April 05, 2003 10:38 AM
To: 'ant-dev@apache.org'
Subject: [Patch] trying solve w2k command line length limitations

Hola a todos:

I'm trying to solve w2k command line length problems for gump.

what i've tried is to create a properties file from gump instead of
passing the classpath in the command line, make a Launcher class that
loads it in a URLclassloader and start ant's main, this approach by
itself doesnt work at all, javac needs real jars in a real classpath not
a CL with all the jars loaded..

Hence this patch, the Launcher in addition to create a UCL, adds a
system property ant.class.path and starts ant's Main.. i've modified ant
Path type to add this property to the classpath like it's done with
java.class.path ( this property is readonly ).., and if using
build.sysclasspath=only, this property contents are added in addition to
java.class.path..

Comments are welcomed..

Saludos, 
Ignacio J. Ortega 

Index: src/main/org/apache/tools/ant/types/Path.java
===================================================================
RCS file:
/home/cvspublic/ant/src/main/org/apache/tools/ant/types/Path.java,v
retrieving revision 1.47
diff -u -r1.47 Path.java
--- src/main/org/apache/tools/ant/types/Path.java	11 Mar 2003
10:57:42 -0000	1.47
+++ src/main/org/apache/tools/ant/types/Path.java	5 Apr 2003
16:28:25 -0000
@@ -103,6 +103,9 @@
     public static Path systemClasspath = 
         new Path(null, System.getProperty("java.class.path"));
 
+    public static Path antClasspath = 
+        new Path(null, System.getProperty("ant.classpath"));
+
 
     /**
      * Helper class, holds the nested <code>&lt;pathelement&gt;</code>
values.
@@ -556,7 +559,8 @@
         if (order.equals("only")) {
             // only: the developer knows what (s)he is doing
             result.addExisting(Path.systemClasspath, true);
-        
+            result.addExisting(Path.antClasspath, true);
+            
         } else if (order.equals("first")) {
             // first: developer could use a little help
             result.addExisting(Path.systemClasspath, true);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org

Mime
View raw message