hlship 2004/07/20 10:25:57
Modified: framework/src/java/org/apache/hivemind/ant
ConstructRegistry.java
Log:
Fix minor bugs in ConstructRegistry related to sub-modules.
Revision Changes Path
1.8 +25 -4
jakarta-hivemind/framework/src/java/org/apache/hivemind/ant/ConstructRegistry.java
Index: ConstructRegistry.java
===================================================================
RCS file:
/home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/ant/ConstructRegistry.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ConstructRegistry.java 18 Jun 2004 13:50:33 -0000 1.7
+++ ConstructRegistry.java 20 Jul 2004 17:25:57 -0000 1.8
@@ -101,6 +101,9 @@
{
File f = new File(paths[i]);
+ if (f.isDirectory())
+ continue;
+
if (f.lastModified() > outputStamp)
needsUpdate = true;
@@ -168,13 +171,20 @@
*/
private void enqueue(File file) throws IOException
{
+ // This occurs when a bare directory is part of the classpath.
+
+ if (file == null)
+ return;
+
if (file.getName().endsWith(".jar"))
{
enqueueJar(file);
return;
}
- Resource r = new FileResource(file.getPath());
+ String path = file.getPath().replace('\\', '/');
+
+ Resource r = new FileResource(path);
enqueue(r);
}
@@ -201,6 +211,7 @@
if (r.getResourceURL() != null)
enqueue(r);
}
+
private void processResource(
Resource descriptor,
DocumentBuilder builder,
@@ -213,7 +224,7 @@
Element e = module.getDocumentElement();
- prepareModuleForInclusion(e);
+ prepareModuleForInclusion(descriptor, e);
Document d = (Document) registryElement.getParentNode();
@@ -284,7 +295,7 @@
}
}
- private void prepareModuleForInclusion(Element module)
+ private void prepareModuleForInclusion(Resource currentResource, Element
module)
{
NamedNodeMap attributes = module.getAttributes();
@@ -336,7 +347,8 @@
if (name.equals("service-point") ||
name.equals("implementation"))
qualifyServiceIds(moduleId, e);
- // TODO: submodule!
+ if (name.equals("sub-module"))
+ enqueueSubmodule(currentResource, e);
}
@@ -374,6 +386,15 @@
node = node.getNextSibling();
}
+ }
+
+ private void enqueueSubmodule(Resource currentResource, Element e)
+ {
+ String descriptor = e.getAttribute("descriptor");
+
+ Resource sub = currentResource.getRelativeResource(descriptor);
+
+ enqueue(sub);
}
private void writeDocument(Document document, OutputStream out) throws
IOException
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]