Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1157 - in development/main: . magic/core/etc/deliverables/templates transit/handler/src/test/net/dpml/transit/artifact transit/plugin/etc/bin transit/task/src/main/net/dpml/transit/task

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1157 - in development/main: . magic/core/etc/deliverables/templates transit/handler/src/test/net/dpml/transit/artifact transit/plugin/etc/bin transit/task/src/main/net/dpml/transit/task
  • Date: Sat, 11 Dec 2004 16:12:24 +0100

Author: mcconnell
Date: Sat Dec 11 16:12:24 2004
New Revision: 1157

Removed:
development/main/main.xml
Modified:
development/main/build.xml
development/main/magic/core/etc/deliverables/templates/reactor.xml
development/main/magic/core/etc/deliverables/templates/standard.xml

development/main/transit/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
development/main/transit/plugin/etc/bin/transit.bat
development/main/transit/task/src/main/net/dpml/transit/task/MainTask.java

development/main/transit/task/src/main/net/dpml/transit/task/TransitComponentHelper.java
Log:
Remove the faulty build.xml and replace it with the the main.xml (temporary
pending top-level build updates). Update the transit task to better handle
plugin management.

Modified: development/main/build.xml
==============================================================================
--- development/main/build.xml (original)
+++ development/main/build.xml Sat Dec 11 16:12:24 2004
@@ -19,30 +19,30 @@
-->


-<project name="dpml-main" default="default" basedir=".">
+<project name="dpml-main" default="default" basedir="."
+ xmlns:transit="antlib:net.dpml.transit" xmlns:x="antlib:net.dpml.magic" >

- <target name="setup">
- <ant antfile="setup.xml"/>
- </target>
-
- <target name="update">
- <ant antfile="setup.xml" target="update"/>
- </target>
-
- <target name="clean">
- <ant antfile="main.xml" target="clean"/>
- </target>
-
- <target name="install">
- <ant antfile="main.xml" target="install"/>
- </target>
+ <transit:init/>
+ <import file="${dpml.templates}/reactor.xml"/>

- <target name="default">
- <ant antfile="main.xml"/>
- </target>
+ <target name="default" depends="reactor.default,bin"/>

<target name="bin">
- <ant antfile="main.xml" target="bin"/>
+ <echo>
+#----------------------------------------------------------------------------------
+# Updating DPML HOME bin directory.
+# Directory: ${dpml.home}/bin
+#----------------------------------------------------------------------------------
+ </echo>
+ <x:property name="metro.group" key="dpml-metro-main" feature="group"/>
+ <!-- copy scripts to ${dpml.home}/bin -->
+ <mkdir dir="${dpml.home}/bin"/>
+ <copy todir="${dpml.home}/bin">
+ <fileset dir="${dpml.home}/main/${metro.group}/bin"/>
+ </copy>
+ <chmod file="${dpml.home}/bin/metro" perm="755"/>
+ <chmod file="${dpml.home}/bin/transit" perm="755"/>
+ <chmod dir="${dpml.home}/bin" includes="*.sh" perm="755"/>
</target>

</project>

Modified: development/main/magic/core/etc/deliverables/templates/reactor.xml
==============================================================================
--- development/main/magic/core/etc/deliverables/templates/reactor.xml
(original)
+++ development/main/magic/core/etc/deliverables/templates/reactor.xml Sat
Dec 11 16:12:24 2004
@@ -20,6 +20,8 @@
xmlns:transit="antlib:net.dpml.transit"
xmlns:x="antlib:net.dpml.magic">

+ <transit:init/>
+
<target name="init">
<x:reactor target="init"/>
</target>

Modified: development/main/magic/core/etc/deliverables/templates/standard.xml
==============================================================================
--- development/main/magic/core/etc/deliverables/templates/standard.xml
(original)
+++ development/main/magic/core/etc/deliverables/templates/standard.xml Sat
Dec 11 16:12:24 2004
@@ -20,6 +20,8 @@
xmlns:transit="antlib:net.dpml.transit"
xmlns:x="antlib:net.dpml.magic">

+ <transit:init/>
+
<target name="info">
<x:info/>
</target>

Modified:
development/main/transit/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
==============================================================================
---
development/main/transit/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
(original)
+++
development/main/transit/handler/src/test/net/dpml/transit/artifact/OnlineTestCase.java
Sat Dec 11 16:12:24 2004
@@ -69,6 +69,16 @@
classloader.loadClass( "net.dpml.test.testb.B" );
}

+ public void testResource() throws Exception
+ {
+ URL url = new URL( "artifact:jar:dpml/test/dpml-test-testb" );
+ ClassLoader classloader = new URLClassLoader( new URL[]{ url } );
+ Class clazz = classloader.loadClass( "net.dpml.test.testb.B" );
+ URL resourceUrl = clazz.getResource( "TestB.xinfo" );
+ System.out.println( "#URL: " + resourceUrl.toExternalForm() );
+ resourceUrl.openStream();
+ }
+
public void testContentConversionA() throws Exception
{
URL url = new URL( "artifact:jar:dpml/test/dpml-test-testa" );

Modified: development/main/transit/plugin/etc/bin/transit.bat
==============================================================================
--- development/main/transit/plugin/etc/bin/transit.bat (original)
+++ development/main/transit/plugin/etc/bin/transit.bat Sat Dec 11 16:12:24
2004
@@ -19,7 +19,7 @@

set CMD_LINE_ARGS=%*
set SECURITY_POLICY=-Djava.security.policy=%DPML_HOME%\bin\security.policy
-set TRANSIT_CLASSPATH=@WINDOWS-CLI-CLASSPATH@
+set TRANSIT_CLASSPATH=%DPML_HOME%\transit\lib;@WINDOWS-CLI-CLASSPATH@

:RUN_METRO
%JAVA% "%SECURITY_POLICY%" %TRANSIT_JVM_OPTS%
-Ddpml.transit.bootstrap.uri=%TRANSIT_PLUGIN% -classpath
"%TRANSIT_CLASSPATH%" net.dpml.transit.Main %CMD_LINE_ARGS%

Modified:
development/main/transit/task/src/main/net/dpml/transit/task/MainTask.java
==============================================================================
---
development/main/transit/task/src/main/net/dpml/transit/task/MainTask.java
(original)
+++
development/main/transit/task/src/main/net/dpml/transit/task/MainTask.java
Sat Dec 11 16:12:24 2004
@@ -123,22 +123,14 @@
setupMonitors();
File home = Transit.HOME;
log( "home: " + home.getAbsolutePath() );
- TransitComponentHelper.getComponentHelper( project );
+ TransitComponentHelper helper = new TransitComponentHelper(
project );
+ project.addBuildListener( helper );
+ TransitComponentHelper.initialize( project );
init = true;
}
}

/**
- * Initialization of the task during which a singleton reference to the
TRANSIT
- * sub-system is establish.
- * @exception BuildException if an initialization error occurs
- */
- public void init()
- throws BuildException
- {
- }
-
- /**
* Return the repository service.
* @return the repository service
*/

Modified:
development/main/transit/task/src/main/net/dpml/transit/task/TransitComponentHelper.java
==============================================================================
---
development/main/transit/task/src/main/net/dpml/transit/task/TransitComponentHelper.java
(original)
+++
development/main/transit/task/src/main/net/dpml/transit/task/TransitComponentHelper.java
Sat Dec 11 16:12:24 2004
@@ -63,9 +63,9 @@
* @param project the project
* @return the project component for a specific project
*/
- public static ComponentHelper getComponentHelper( Project project )
+ public static void initialize( Project project )
{
- return getComponentHelper( project, false );
+ initialize( project, false );
}

/**
@@ -74,13 +74,13 @@
* @param project the project
* @return the project component for a specific project
*/
- public static ComponentHelper getComponentHelper( Project project,
boolean flag )
+ public static void initialize( Project project, boolean flag )
{
ComponentHelper current =
(ComponentHelper) project.getReference( "ant.ComponentHelper" );
if( ( null != current ) && ( current instanceof
TransitComponentHelper) )
{
- return current;
+ return;
}
TransitComponentHelper helper = new TransitComponentHelper( project,
current );
helper.initDefaultDefinitions();
@@ -96,7 +96,6 @@
}
project.addReference( "ant.ComponentHelper", helper );
project.addBuildListener( helper );
- return helper;
}

/**
@@ -123,10 +122,16 @@
// constructor
//------------------------------------------------------------------------

+ public TransitComponentHelper( Project project )
+ {
+ this( project, ComponentHelper.getComponentHelper( project ) );
+ }
+
public TransitComponentHelper( Project project, ComponentHelper parent )
{
setProject( project );
m_parent = parent;
+ parent.setNext( this );
}

//------------------------------------------------------------------------
@@ -162,7 +167,6 @@
{
String urn = name.substring( 0, k );
String task = name.substring( k+1 );
-
URI uri = convertUrnToURI( urn );
if( null == uri )
{
@@ -170,16 +174,24 @@
}
else
{
+ String alias = uri.toString() + ":" + task;
if( m_parent != null )
{
- Object object = m_parent.createComponent( name );
+ Object object = m_parent.createComponent( alias );
if( null != object )
{
+ final String message =
+ "mapping requested name ["
+ + name
+ + "] to alias ["
+ + alias
+ + "]";
+ getProject().log( message, Project.MSG_VERBOSE );
return object;
}
}
- String alias = installPlugin( uri, urn, task );
- return super.createComponent( name );
+ installPlugin( uri, urn, task );
+ return super.createComponent( alias );
}
}
else
@@ -221,11 +233,11 @@
* @param uri the plugin uri
* @param name the fully qualified component name
*/
- private String installPlugin( URI uri, String urn, String name )
+ private void installPlugin( URI uri, String urn, String name )
{
if( m_uris.contains( uri ) )
{
- return uri.toString() + ":" + name;
+ return;
}

try
@@ -239,7 +251,9 @@
if( null != descriptor.getClassname() )
{
Class clazz = classloader.loadClass(
descriptor.getClassname() );
- super.addTaskDefinition( uri + ":" + name, clazz );
+ final String key = uri + ":" + name;
+ getProject().log( "installing single task [" + key + "]",
Project.MSG_VERBOSE );
+ super.addTaskDefinition( key, clazz );
}
else
{
@@ -252,7 +266,8 @@
for( int i=0; i < tasks.length; i++ )
{
Element task = tasks[i];
- String key = urn + ":" + ElementHelper.getAttribute(
task, "name" );
+ String key = uri.toString() + ":" +
ElementHelper.getAttribute( task, "name" );
+ getProject().log( "installing task [" + key + "]",
Project.MSG_VERBOSE );
String classname = ElementHelper.getAttribute( task,
"classname" );
Class clazz = classloader.loadClass( classname );
super.addTaskDefinition( key, clazz );
@@ -262,7 +277,8 @@
for( int i=0; i < types.length; i++ )
{
Element type = types[i];
- String key = urn + ":" + ElementHelper.getAttribute(
type, "name" );
+ String key = uri.toString() + ":" +
ElementHelper.getAttribute( type, "name" );
+ getProject().log( "installing type [" + key + "]",
Project.MSG_VERBOSE );
String classname = ElementHelper.getAttribute( type,
"classname" );
Class clazz = classloader.loadClass( classname );
super.addDataTypeDefinition( key, clazz );
@@ -270,8 +286,6 @@
}

m_uris.add( uri );
-
- return uri.toString() + ":" + name;
}
catch( Throwable e )
{
@@ -339,12 +353,12 @@
public void buildStarted( BuildEvent event )
throws BuildException
{
- getComponentHelper( event.getProject(), false );
+ initialize( event.getProject(), false );
}

public void subBuildStarted( BuildEvent event )
{
- getComponentHelper( event.getProject(), true );
+ initialize( event.getProject(), true );
}

public void subBuildFinished( BuildEvent event )



  • svn commit: r1157 - in development/main: . magic/core/etc/deliverables/templates transit/handler/src/test/net/dpml/transit/artifact transit/plugin/etc/bin transit/task/src/main/net/dpml/transit/task, mcconnell, 12/11/2004

Archive powered by MHonArc 2.6.24.

Top of Page