svn commit: rev 21130 - in avalon/trunk/runtime: merlin/impl meta meta/magic meta/magic/src meta/magic/src/dist util

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
Author: niclas
Date: Sat Jun 12 03:58:04 2004
New Revision: 21130

Added:
   avalon/trunk/runtime/meta/magic/
   avalon/trunk/runtime/meta/magic/magic.properties   (contents, props changed)
   avalon/trunk/runtime/meta/magic/src/
   avalon/trunk/runtime/meta/magic/src/dist/
   avalon/trunk/runtime/meta/magic/src/dist/magic.bsh
   avalon/trunk/runtime/meta/magic/src/dist/magic.properties   (contents, props changed)
Modified:
   avalon/trunk/runtime/merlin/impl/magic.properties
   avalon/trunk/runtime/merlin/impl/magic.sequence
   avalon/trunk/runtime/meta/magic.sequence
   avalon/trunk/runtime/util/magic.sequence
Log:
Meta generation plugin.

Modified: avalon/trunk/runtime/merlin/impl/magic.properties
==============================================================================
--- avalon/trunk/runtime/merlin/impl/magic.properties	(original)
+++ avalon/trunk/runtime/merlin/impl/magic.properties	Sat Jun 12 03:58:04 2004
@@ -2,3 +2,10 @@
 project.name = merlin-impl
 
 project.system = ../../../central/system
+
+#
+# factory class
+#
+
+avalon.artifact.factory = org.apache.avalon.merlin.impl.DefaultFactory
+

Modified: avalon/trunk/runtime/merlin/impl/magic.sequence
==============================================================================
--- avalon/trunk/runtime/merlin/impl/magic.sequence	(original)
+++ avalon/trunk/runtime/merlin/impl/magic.sequence	Sat Jun 12 03:58:04 2004
@@ -1 +1,2 @@
-. jar.install
\ No newline at end of file
+
+. build jar.install

Modified: avalon/trunk/runtime/meta/magic.sequence
==============================================================================
--- avalon/trunk/runtime/meta/magic.sequence	(original)
+++ avalon/trunk/runtime/meta/magic.sequence	Sat Jun 12 03:58:04 2004
@@ -3,3 +3,4 @@
 impl
 tools
 plugin
+magic       plugin.install
\ No newline at end of file

Added: avalon/trunk/runtime/meta/magic/magic.properties
==============================================================================
--- (empty file)
+++ avalon/trunk/runtime/meta/magic/magic.properties	Sat Jun 12 03:58:04 2004
@@ -0,0 +1,4 @@
+
+project.name = avalon-meta-magic
+
+project.system = ../../../central/system

Added: avalon/trunk/runtime/meta/magic/src/dist/magic.bsh
==============================================================================
--- (empty file)
+++ avalon/trunk/runtime/meta/magic/src/dist/magic.bsh	Sat Jun 12 03:58:04 2004
@@ -0,0 +1,60 @@
+
+import java.io.File;
+
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+
+import org.apache.avalon.magic.AbstractPlugin;
+
+import org.apache.avalon.meta.info.ant.FormatEnum;
+import org.apache.avalon.meta.info.ant.MetaTask;
+
+public class AvalonMetaPlugin extends AbstractPlugin
+    implements Serviceable
+{
+    private Object m_PreparePlugin;
+    private Object m_JavaPlugin;
+    private Object m_TestPlugin;
+    
+    public void service( ServiceManager man )
+        throws ServiceException
+    {
+        m_PreparePlugin = man.lookup( "prepare" );
+        m_JavaPlugin = man.lookup( "java" );
+        m_TestPlugin = man.lookup( "test" );
+    }
+    
+    public void meta()
+    {
+        notifyPreMethod( "meta" );
+        File dest = new File( m_Context.getProjectDir(), m_Context.getProperty( "java.build.dest.dir" ) );
+        generate( dest );
+        notifyPostMethod( "meta" );
+    }
+    
+    public void unitmeta()
+    {
+        notifyPreMethod( "unitmeta" );
+        File dest = new File( m_Context.getProjectDir(), m_Context.getProperty( "unit.build.dest.dir" ) );
+        generate( dest );
+        notifyPostMethod( "unitmeta" );
+    }
+    
+    public void generate( File destDir )
+    {
+        String format = m_Context.getProperty( "meta.format" );
+        FormatEnum enumFormat = new FormatEnum();
+        enumFormat.setValue( format );
+        String postfix = m_Context.getProperty( "meta.postfix" );
+        String destname = m_Context.getProperty( "meta.dest.dir" );
+        String force = m_Context.getProperty( "meta.forces" );
+        
+        m_Project.addTaskDefinition( "avalonmeta", MetaTask.class );
+        MetaTask metaTask = (MetaTask) m_Project.createTask( "avalonmeta" );
+        metaTask.setPostfix( postfix );
+        metaTask.setDestDir( destDir );
+        metaTask.setFormat( enumFormat );
+        metaTask.execute();
+    }
+}
\ No newline at end of file

Added: avalon/trunk/runtime/meta/magic/src/dist/magic.properties
==============================================================================
--- (empty file)
+++ avalon/trunk/runtime/meta/magic/src/dist/magic.properties	Sat Jun 12 03:58:04 2004
@@ -0,0 +1,7 @@
+
+meta.format = xml
+
+meta.postfix = xinfo
+
+meta.force = false
+

Modified: avalon/trunk/runtime/util/magic.sequence
==============================================================================
--- avalon/trunk/runtime/util/magic.sequence	(original)
+++ avalon/trunk/runtime/util/magic.sequence	Sat Jun 12 03:58:04 2004
@@ -4,3 +4,4 @@
 exception
 extension
 i18n
+configuration
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.