I placed the diffs as a (small) attachement. Hope this helps. You can still
dowload the full modified source code from the previous address.
Ludovic.
"Twiggs, Glenn" wrote:
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Would you send the file diffs? The diffs are much easier to evaluate.
>
> Glenn.
>
> -----Original Message-----
> From: Ludovic Claude [mailto:[EMAIL PROTECTED]
>
> I've made some update to Ant, fixing some problems with Windows 95 and
> improving the rmic command.
>
> You can download the patch from:
> http://www.ringsys.co.uk/opensource/ant-patch.zip
--
___________________________________
Web Site Watchers Ltd
212 Piccadilly,
London W1V 9LD
United-Kingdom
Telephone: +44 (0)171 917 6255
Fax: +44 (0)171 439 0262
http://www.websitewatchers.co.uk
[EMAIL PROTECTED]
diff -r main/Exec.java mymain/Exec.java
59a60
> System.out.println("Detected OS "+myos);
71a73
> if (myos.toLowerCase().indexOf("nt") >= 0) {
72a75,76
> else {
> antRun = antRun+"95.bat";
77,79d80
< // ignore response
< InputStreamReader isr = new InputStreamReader(proc.getInputStream());
< BufferedReader din = new BufferedReader(isr);
84,91c85,87
< // pipe CVS output to STDOUT
< String line;
< while ((line = din.readLine()) != null) {
< if (fos == null) {
< project.log(line, "exec", Project.MSG_INFO);
< else {
< fos.println(line);
< if (fos != null) {
---
> pipeOutput(proc.getInputStream(), fos);
> pipeOutput(proc.getErrorStream(), fos);
> if (null != fos) {
119a116,131
> * TODO: Comment the method
> * @param is
> * @param fos
> * @throws IOException
> * @see
> private void pipeOutput(InputStream is,
> PrintWriter fos) throws IOException {
> InputStreamReader isr = new InputStreamReader(is);
> BufferedReader din = new BufferedReader(isr);
> // pipe CVS output to STDOUT
> String line;
> while ((line = din.readLine()) != null) {
> if (fos == null) {
> project.log(line, "exec", Project.MSG_INFO);
> else {
> fos.println(line);
diff -r main/Main.java mymain/Main.java
105a106,107
> * Ludo ([EMAIL PROTECTED]): This doesn't happens on Windows 98 at least,
> * so there is an additional check for parsing "="
107c109,116
< String value = args[++i];
---
> String value = null;
> int posEq = name.indexOf("=");
> if (posEq > 0) {
> value = name.substring(posEq+1);
> name = name.substring(0, posEq);
> else {
> value = args[++i];
> System.out.println("Defined property: "+name+" = "+value);
diff -r main/Project.java mymain/Project.java
87a88,89
> String myos = System.getProperty("os.name");
> log("Detected OS "+myos);
diff -r main/Rmic.java mymain/Rmic.java
46a47,58
> import java.util.StringTokenizer;
> * Task to compile RMI stubs and skeletons. This task can take the following
> * arguments:
> * <ul>
> * <li>base: The base directory for the compiled stubs and skeletons
> * <li>class: The name of the class to generate the stubs from
> * <li>stubVersion: The version of the stub prototol to use (1.1, 1.2, compat)
> * <li>sourceBase: The base directory for the generated stubs and skeletons
> * <li>classpath: Additional classpath, appended before the system classpath
> * </ul>
> * Of these arguments, the <b>base</b> and <b>class</b> are required.
> * <p>
47a60
> * @author [EMAIL PROTECTED]
50a64,66
> private String sourceBase;
> private String stubVersion;
> private String compileClasspath;
61a78,90
> * @param sourceBase
> * @see
> public void setSourceBase(String sourceBase) {
> this.sourceBase = sourceBase;
> * TODO: Comment the method
> * @param stubVersion
> * @see
> public void setStubVersion(String stubVersion) {
> this.stubVersion = stubVersion;
> * Set the classpath to be used for this compilation.
> public void setClasspath(String classpath) {
> compileClasspath = Project.translatePath(classpath);
> * TODO: Comment the method
65,66d93
< String pathsep = System.getProperty("path.separator");
< StringBuffer classpath = new StringBuffer();
67a95,153
> File sourceBaseFile = null;
> if (null != sourceBase) {
> sourceBaseFile = project.resolveFile(sourceBase);
> String classpath = getCompileClasspath(baseFile);
> // XXX
> // need to provide an input stream that we read in from!
> sun.rmi.rmic.Main compiler = new sun.rmi.rmic.Main(System.out, "rmic");
> int argCount = 5;
> int i = 0;
> if (null != stubVersion) {
> argCount++;
> if (null != sourceBase) {
> argCount++;
> String[] args = new String[argCount];
> args[i++] = "-d";
> args[i++] = baseFile.getAbsolutePath();
> args[i++] = "-classpath";
> args[i++] = classpath;
> args[i++] = classname;
> if (null != stubVersion) {
> if ("1.1".equals(stubVersion)) {
> args[i++] = "-v1.1";
> else if ("1.2".equals(stubVersion)) {
> args[i++] = "-v1.2";
> else {
> args[i++] = "-vcompat";
> if (null != sourceBase) {
> args[i++] = "-keepgenerated";
> compiler.compile(args);
> // Move the generated source file to the base directory
> if (null != sourceBase) {
> String stubFileName = classname.replace('.', '/')+"_Stub.java";
> File oldStubFile = new File(baseFile, stubFileName);
> File newStubFile = new File(sourceBaseFile, stubFileName);
> try {
> copyFile(oldStubFile, newStubFile);
> oldStubFile.delete();
> catch (IOException ioe) {
> String msg = "Failed to copy "+oldStubFile+" to "+newStubFile
> +" due to "+ioe.getMessage();
> throw new BuildException(msg);
> if (!"1.2".equals(stubVersion)) {
> String skelFileName = classname.replace('.', '/')+"_Skel.java";
> File oldSkelFile = new File(baseFile, skelFileName);
> File newSkelFile = new File(sourceBaseFile, skelFileName);
> try {
> copyFile(oldSkelFile, newSkelFile);
> oldSkelFile.delete();
> catch (IOException ioe) {
> String msg = "Failed to copy "+oldSkelFile+" to "+newSkelFile
> +" due to "+ioe.getMessage();
> throw new BuildException(msg);
> * Builds the compilation classpath.
> // XXX
> // we need a way to not use the current classpath.
> private String getCompileClasspath(File baseFile) {
> StringBuffer classpath = new StringBuffer();
> // add dest dir to classpath so that previously compiled and
> // untouched classes are on classpath
69,70c155,159
< classpath.append(pathsep);
< classpath.append(System.getProperty("java.class.path"));
---
> // add our classpath to the mix
> if (compileClasspath != null) {
> addExistingToClasspath(classpath, compileClasspath);
> // add the system classpath
> addExistingToClasspath(classpath, System.getProperty("java.class.path"));
75,86c164,185
< classpath.append(pathsep);
< classpath.append(bootcp);
< // XXX
< // need to provide an input stream that we read in from!
< sun.rmi.rmic.Main compiler = new sun.rmi.rmic.Main(System.out, "rmic");
< String[] args = new String[5];
< args[0] = "-d";
< args[1] = baseFile.getAbsolutePath();
< args[2] = "-classpath";
< args[3] = classpath.toString();
< args[4] = classname;
< compiler.compile(args);
---
> addExistingToClasspath(classpath, bootcp);
> return classpath.toString();
> * Takes a classpath-like string, and adds each element of
> * this string to a new classpath, if the components exist.
> * Components that don't exist, aren't added.
> * We do this, because jikes issues warnings for non-existant
> * files/dirs in his classpath, and these warnings are pretty
> * annoying.
> * @param target - target classpath
> * @param source - source classpath
> * to get file objects.
> private void addExistingToClasspath(StringBuffer target, String source) {
> StringTokenizer tok = new StringTokenizer(source,
> System.getProperty("path.separator"), false);
> while (tok.hasMoreTokens()) {
> File f = project.resolveFile(tok.nextToken());
> if (f.exists()) {
> target.append(File.pathSeparator);
> target.append(f.getAbsolutePath());
> else {
> project.log("Dropping from classpath: "+f.getAbsolutePath(),
> project.MSG_VERBOSE);