From 68fb37b1a2632d9da411ffa8d6b942fb8536fc82 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 26 Jun 2001 13:42:28 +0000 Subject: [PATCH] Some initial work on rmic to make it handle -iiop better (doesn't detect generated files properly) - doesn't quite work ATM. Add some extra warning and debugging info to Project. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269231 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/Project.java | 8 +- .../org/apache/tools/ant/taskdefs/Rmic.java | 36 ++++----- .../ant/taskdefs/rmic/DefaultRmicAdapter.java | 75 ++++++++++++------- .../tools/ant/taskdefs/rmic/RmicAdapter.java | 12 --- webpage/docs/faq.html | 4 +- webpage/xdocs/faq.xml | 2 +- 6 files changed, 71 insertions(+), 66 deletions(-) diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index 2eee4c224..5651626f2 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -242,8 +242,10 @@ public class Project { public void setProperty(String name, String value) { // command line properties take precedence - if (null != userProperties.get(name)) + if (null != userProperties.get(name)) { + log("Override ignored for user property " + name, MSG_VERBOSE); return; + } log("Setting project property: " + name + " -> " + value, MSG_DEBUG); properties.put(name, value); @@ -1034,6 +1036,10 @@ public class Project { } public void addReference(String name, Object value) { + if (null != references.get(name)) { + log("Overriding previous definition of reference to " + name, + MSG_WARN); + } log("Adding reference: " + name + " -> " + value, MSG_DEBUG); references.put(name,value); } diff --git a/src/main/org/apache/tools/ant/taskdefs/Rmic.java b/src/main/org/apache/tools/ant/taskdefs/Rmic.java index 9c9112487..db3ee9dc2 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Rmic.java +++ b/src/main/org/apache/tools/ant/taskdefs/Rmic.java @@ -418,29 +418,23 @@ public class Rmic extends MatchingTask { String classname, RmicAdapter adapter) throws BuildException { - String stubFileName = classname.replace('.', File.separatorChar) - + adapter.getStubClassSuffix()+".java"; - File oldStubFile = new File(baseDir, stubFileName); - File newStubFile = new File(sourceBaseFile, stubFileName); - try { - project.copyFile(oldStubFile, newStubFile, filtering); - oldStubFile.delete(); - } catch (IOException ioe) { - String msg = "Failed to copy " + oldStubFile + " to " + - newStubFile + " due to " + ioe.getMessage(); - throw new BuildException(msg, ioe, location); - } - if (!"1.2".equals(stubVersion)) { - String skelFileName = classname.replace('.', File.separatorChar) - + adapter.getSkelClassSuffix()+".java"; - File oldSkelFile = new File(baseDir, skelFileName); - File newSkelFile = new File(sourceBaseFile, skelFileName); + + String classFileName = + classname.replace('.', File.separatorChar) + ".class"; + String[] generatedFiles = + adapter.getMapper().mapFileName(classFileName); + + for (int i=0; i @@ -387,7 +387,7 @@ - Why does Ant always recompile all my Java files + Why does Ant always recompile all my Java files? diff --git a/webpage/xdocs/faq.xml b/webpage/xdocs/faq.xml index 28a0363aa..a573a88cb 100644 --- a/webpage/xdocs/faq.xml +++ b/webpage/xdocs/faq.xml @@ -114,7 +114,7 @@ - Why does Ant always recompile all my Java files + Why does Ant always recompile all my Java files?

In order to find out which files should be compiled, Ant