notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1266 - in development/main: central magic/core/src/main/net/dpml/magic magic/core/src/main/net/dpml/magic/tasks
- From: mcconnell AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1266 - in development/main: central magic/core/src/main/net/dpml/magic magic/core/src/main/net/dpml/magic/tasks
- Date: Thu, 23 Dec 2004 11:26:35 +0100
Author: mcconnell
Date: Thu Dec 23 11:26:35 2004
New Revision: 1266
Modified:
development/main/central/index.xml
development/main/magic/core/src/main/net/dpml/magic/Index.java
development/main/magic/core/src/main/net/dpml/magic/tasks/ModuleTask.java
Log:
update index files to reflect tutorial move and update Index implementation
to support module declaration
Modified: development/main/central/index.xml
==============================================================================
--- development/main/central/index.xml (original)
+++ development/main/central/index.xml Thu Dec 23 11:26:35 2004
@@ -5,8 +5,8 @@
<import index="../magic/index.xml"
uri="artifact:module:dpml/magic/dpml-magic#SNAPSHOT"/>
<import index="../metro/index.xml"
- uri="artifact:module:dpml/metro/tools/dpml-metro-tools#SNAPSHOT"/>
- <import index="../metro/tutorials/index.xml" />
+ uri="artifact:module:dpml/metro/dpml-metro#SNAPSHOT"/>
+ <import index="tutorials/index.xml" />
<!--
Module
Modified: development/main/magic/core/src/main/net/dpml/magic/Index.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/Index.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/Index.java Thu
Dec 23 11:26:35 2004
@@ -32,6 +32,7 @@
import net.dpml.magic.model.Definition;
import net.dpml.magic.model.Resource;
import net.dpml.magic.model.ResourceRef;
+import net.dpml.magic.model.Info;
import net.dpml.transit.Transit;
import net.dpml.transit.TransitException;
@@ -468,9 +469,33 @@
else if( "module".equals( rootElementName ) )
{
//
- // its a module definition
+ // its a module definition so we need to add the module as
an available
+ // resources and add all of the resources defined by the
module
//
+ final String moduleUri = ElementHelper.getAttribute( root,
"uri" );
+ Info info = Info.create( moduleUri );
+ String key = info.getName();
+ Resource resource = new Resource( this, key, info, new
ResourceRef[0], null );
+
+ if( !m_resources.containsKey( key ) )
+ {
+ m_resources.put( key, resource );
+ log( "resource: " + resource, Project.MSG_VERBOSE );
+ }
+ else
+ {
+ Resource r = (Resource) m_resources.get( key );
+ if( !r.equals( resource ) )
+ {
+ final String error =
+ "WARNING: Ignoring duplicate module key reference
["
+ + key
+ + "].";
+ log( error, Project.MSG_WARN );
+ }
+ }
+
final Element resources = ElementHelper.getChild( root,
"resources" );
final Element[] elements = ElementHelper.getChildren(
resources );
final File anchor = source.getParentFile();
Modified:
development/main/magic/core/src/main/net/dpml/magic/tasks/ModuleTask.java
==============================================================================
--- development/main/magic/core/src/main/net/dpml/magic/tasks/ModuleTask.java
(original)
+++ development/main/magic/core/src/main/net/dpml/magic/tasks/ModuleTask.java
Thu Dec 23 11:26:35 2004
@@ -147,7 +147,8 @@
try
{
writer.write( "<?xml version=\"1.0\"
encoding=\"ISO-8859-1\"?>" );
- writer.write( "\n\n<module group=\"" + group + "\"
version=\"" + version + "\">" );
+ //writer.write( "\n\n<module group=\"" + group + "\"
version=\"" + version + "\">" );
+ writer.write( "\n\n<module uri=\"" +
definition.getInfo().getURI() + "\">" );
writeHeader( writer, getHeader() );
writeModule( writer, definition );
writer.write( "\n\n</module>\n" );
- svn commit: r1266 - in development/main: central magic/core/src/main/net/dpml/magic magic/core/src/main/net/dpml/magic/tasks, mcconnell, 12/23/2004
Archive powered by MHonArc 2.6.24.