avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject svn commit: rev 21346 - in avalon/trunk: central/site/src/xdocs/central/about central/system runtime/meta/magic tools/magic tools/magic/src/main/org/apache/avalon/tools/home tools/magic/src/main/org/apache/avalon/tools/tasks
Date Wed, 16 Jun 2004 14:55:37 GMT
Author: mcconnell
Date: Wed Jun 16 07:55:36 2004
New Revision: 21346

Added:
   avalon/trunk/central/site/src/xdocs/central/about/faq.xml
Removed:
   avalon/trunk/runtime/meta/magic/
Modified:
   avalon/trunk/central/system/index.xml
   avalon/trunk/tools/magic/build.xml
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/home/Context.java
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JavacTask.java
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/PrepareTask.java
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/ReactorTask.java
Log:
Update magic handling of content inside the target directory so that we have an assured structure
common across all projects following execution of prepare.  This will allow subsequent reactor
builds to execute without the requirement to look at any local project variations (e.g. when
javadoc runs it will know that the src directory is ${basedir}/target/build/main for every
project irrespective of the projects actual src directory.

Added: avalon/trunk/central/site/src/xdocs/central/about/faq.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/central/site/src/xdocs/central/about/faq.xml	Wed Jun 16 07:55:36 2004
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document>
+
+  <properties>
+    <author email="dev@avalon.apache.org">Avalon Documentation Team</author>
+    <title>Avalon Central</title>
+  </properties> 
+
+  <body>
+    <section name="Frequently Asked Questions">
+      <p>
+      The Avalon Project maintains a WIKI containing lots of information
+      ranging from COP/SPO trivia through to some deep and meaning random 
+      thoughts prepared by some of the best people in the field.  Within 
+      the WIKI content you will find the classic 
+      <a href="http://wiki.apache.org/avalon/FrequentlyAskedQuestions">FAQ</a>

+      with links to lots of other stuff.
+      </p>
+    </section>
+  </body>
+
+</document>
+

Modified: avalon/trunk/central/system/index.xml
==============================================================================
--- avalon/trunk/central/system/index.xml	(original)
+++ avalon/trunk/central/system/index.xml	Wed Jun 16 07:55:36 2004
@@ -120,7 +120,7 @@
         <version>4.2.0</version>
       </info>
       <dependencies>
-        <include key="avalon-logkit" runtime="true" test="false"/>
+        <include key="avalon-logkit" runtime="false" test="false"/>
       </dependencies>
     </project>
 

Modified: avalon/trunk/tools/magic/build.xml
==============================================================================
--- avalon/trunk/tools/magic/build.xml	(original)
+++ avalon/trunk/tools/magic/build.xml	Wed Jun 16 07:55:36 2004
@@ -13,7 +13,7 @@
   <target name="install" depends="standard.install">
     <mkdir dir="${user.home}/.ant/lib"/>
     <copy toDir="${user.home}/.ant/lib" 
-       file="${project.target}/deliverables/jars/${project.name}.jar"/>
+       file="${basedir}/target/deliverables/jars/${project.name}.jar"/>
   </target>
 
 </project>

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/home/Context.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/home/Context.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/home/Context.java	Wed Jun 16
07:55:36 2004
@@ -38,6 +38,13 @@
  */
 public class Context extends Task
 {
+    public static final String TARGET = "target";
+    public static final String BUILD = "build";
+    public static final String TEMP = "temp";
+    public static final String TEST = "test";
+    public static final String DELIVERABLES = "deliverables";
+    public static final String DOCS = "docs";
+
     private static final String USER_PROPERTIES = "user.properties";
     private static final String BUILD_PROPERTIES = "build.properties";
 
@@ -46,33 +53,18 @@
     public static final String SRC_KEY = "project.src";
     public static final String SRC_VALUE = "src";
 
+    public static final String SRC_MAIN = "main";
     public static final String SRC_MAIN_KEY = "project.src.main";
-    public static final String SRC_MAIN_VALUE = "main";
 
     public static final String SRC_CONFIG_KEY = "project.src.config";
-    public static final String SRC_CONFIG_VALUE = "config";
+    public static final String SRC_CONFIG = "config";
 
     public static final String SRC_TEST_KEY = "project.src.test";
-    public static final String SRC_TEST_VALUE = "test";
+    public static final String SRC_TEST = "test";
 
     public static final String ETC_KEY = "project.etc";
     public static final String ETC_VALUE = "etc";
 
-    public static final String TARGET_KEY = "project.target";
-    public static final String TARGET_VALUE = "target";
-
-    public static final String DELIVERABLES_KEY = "project.target.deliverables";
-    private static final String DELIVERABLES_VALUE = "deliverables";
-
-    public static final String BUILD_KEY = "project.target.build";
-    private static final String BUILD_VALUE = "build";
-
-    public static final String TEMP_KEY = "project.target.temp";
-    private static final String TEMP_VALUE = "temp";
-
-    public static final String DOCS_KEY = "project.target.docs";
-    private static final String DOCS_VALUE = "docs";
-
     public static Context getContext( Project project )
     {
         if( null == project )
@@ -100,11 +92,13 @@
 
     private File m_src;
     private File m_etc;
+
     private File m_target;
     private File m_build;
     private File m_deliverables;
     private File m_temp;
     private File m_docs;
+    private File m_test;
     
     public void setKey( String key )
     {
@@ -122,37 +116,25 @@
         setupProperties( project );
 
         project.setNewProperty( SRC_KEY, SRC_VALUE );
-        project.setNewProperty( SRC_MAIN_KEY, SRC_MAIN_VALUE );
-        project.setNewProperty( SRC_CONFIG_KEY, SRC_CONFIG_VALUE );
-        project.setNewProperty( SRC_TEST_KEY, SRC_TEST_VALUE );
+        project.setNewProperty( SRC_MAIN_KEY, SRC_MAIN );
+        project.setNewProperty( SRC_CONFIG_KEY, SRC_CONFIG );
+        project.setNewProperty( SRC_TEST_KEY, SRC_TEST );
+
         project.setNewProperty( ETC_KEY, ETC_VALUE );
-        project.setNewProperty( TARGET_KEY, TARGET_VALUE );
-        project.setNewProperty( BUILD_KEY, BUILD_VALUE );
-        project.setNewProperty( DELIVERABLES_KEY, DELIVERABLES_VALUE );
-        project.setNewProperty( DOCS_KEY, DOCS_VALUE );
-        project.setNewProperty( TEMP_KEY, TEMP_VALUE );
 
         File basedir = project.getBaseDir();
         String src = project.getProperty( SRC_KEY );
         String etc = project.getProperty( ETC_KEY );
-        String target = project.getProperty( TARGET_KEY );
-        String build = project.getProperty( BUILD_KEY );
-        String temp = project.getProperty( TEMP_KEY );
-        String docs = project.getProperty( DOCS_KEY );
-        String deliverables = project.getProperty( DELIVERABLES_KEY );
 
         m_src = setupSrc( basedir, src );
         m_etc = setupEtc( basedir, etc );
-        m_target = setupTarget( basedir, target );
 
-        m_build = 
-          setBuildPath( BUILD_KEY, build );
-        m_deliverables = 
-          setBuildPath( DELIVERABLES_KEY, deliverables );
-        m_temp = 
-          setBuildPath( TEMP_KEY, temp );
-        m_docs = 
-          setBuildPath( DOCS_KEY, docs );
+        m_target = new File( basedir, TARGET );
+        m_build = setBuildPath( BUILD );
+        m_deliverables = setBuildPath( DELIVERABLES );
+        m_temp = setBuildPath( TEMP );
+        m_test = setBuildPath( TEST );
+        m_docs = setBuildPath( DOCS );
 
         project.addReference( KEY, this );
     }
@@ -207,11 +189,20 @@
         return m_temp;
     }
 
+    public File getTestDirectory()
+    {
+        return m_test;
+    }
+
     public File getDocsDirectory()
     {
         return m_docs;
     }
 
+    public File setBuildPath( String path )
+    {
+        return setBuildPath( path, path );
+    }
 
     public File setBuildPath( String key, String path )
     {
@@ -273,12 +264,6 @@
     private File setupEtc( File basedir, String path )
     {
         if( null == path ) return new File( basedir, ETC_VALUE );
-        return new File( basedir, path );
-    }
-
-    private File setupTarget( File basedir, String path )
-    {
-        if( null == path ) return new File( basedir, TARGET_VALUE );
         return new File( basedir, path );
     }
 

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	Wed
Jun 16 07:55:36 2004
@@ -49,9 +49,6 @@
 {
     public static final String TEST_ENABLED_KEY = "project.test.enabled";
 
-    public static final String TEST_KEY = "project.test";
-    public static final String TEST_VALUE = "test";
-
     public static final String TEST_SRC_KEY = "project.test.src";
     public static final String TEST_SRC_VALUE = "test";
 
@@ -94,8 +91,8 @@
             project.setNewProperty( TEST_TMP_KEY, "" + TEST_TMP_VALUE );
             project.setNewProperty( HALT_ON_ERROR_KEY, "" + HALT_ON_ERROR_VALUE );
             project.setNewProperty( HALT_ON_FAILURE_KEY, "" + HALT_ON_FAILURE_VALUE );
-            getContext().setBuildPath( TEST_KEY, TEST_VALUE );
-            m_test = getContext().getBuildPath( TEST_KEY );
+
+            m_test = getContext().getTestDirectory();
         }
     }
 

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JavacTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JavacTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/JavacTask.java	Wed Jun
16 07:55:36 2004
@@ -70,8 +70,7 @@
     {
         Project project = getProject();
         File build = getContext().getBuildDirectory();
-        String mainPath = project.getProperty( Context.SRC_MAIN_KEY );
-        File main = new File( build, mainPath );
+        File main = new File( build, Context.SRC_MAIN );
 
         if( main.exists() )
         {

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/PrepareTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/PrepareTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/PrepareTask.java	Wed Jun
16 07:55:36 2004
@@ -112,12 +112,37 @@
         File etc = getContext().getEtcDirectory();
         File build = getContext().getBuildDirectory();
         File buildEtcDir = new File( build, "etc" );
+
         if( src.exists() )
         {
+
+            String main = getSrcMain();
+            String config = getSrcConfig();
+            String test = getSrcTest();
+            
+            prepareMain( src, build, main, Context.SRC_MAIN );
+            prepareMain( src, build, config, Context.SRC_CONFIG );
+            prepareMain( src, build, test, Context.SRC_TEST );
+
+            //
+            // and any non-standard stuff
+            //
+
+            String excludes = 
+              main + "/**," + config + "/**," + test + "/**";
+
             String filters = project.getProperty( SRC_FILTERED_INCLUDES_KEY );
-            copy( src, build, true, filters, "" );
-            copy( src, build, false, "**/*.*", filters );
+            copy( src, build, true, filters, excludes );
+            if( filters.length() > 0 )
+            {
+                copy( src, build, false, "**/*.*", excludes + "," + filters );
+            }
+            else
+            {
+                copy( src, build, false, "**/*.*", excludes );
+            }
         }
+
         if( etc.exists() )
         {
             String includes = project.getProperty( ETC_FILTERED_INCLUDES_KEY );
@@ -136,6 +161,51 @@
         {
             File deliverables = getContext().getDeliverablesDirectory();
             copy( extra, deliverables, false, "**/*", "" );
+        }
+    }
+
+    private String getSrcMain()
+    {
+        String path = getProject().getProperty( Context.SRC_MAIN_KEY );
+        if( null != path ) return path;
+        return Context.SRC_MAIN;
+    }
+
+    private String getSrcConfig()
+    {
+        String path = getProject().getProperty( Context.SRC_CONFIG_KEY );
+        if( null != path ) return path;
+        return Context.SRC_CONFIG;
+    }
+
+    private String getSrcTest()
+    {
+        String path = getProject().getProperty( Context.SRC_TEST_KEY );
+        if( null != path ) return path;
+        return Context.SRC_TEST;
+    }
+
+
+    private void prepareMain( File projectSrc, File targetMain, String source, String path
)
+    {
+        if( null == projectSrc ) throw new NullPointerException( "projectSrc" );
+        if( null == targetMain ) throw new NullPointerException( "targetMain" );
+        if( null == source ) throw new NullPointerException( "source" );
+        if( null == path ) throw new NullPointerException( "path" );
+
+        File src = new File( projectSrc, source );
+        if( src.exists() )
+        {
+            log( 
+              "Adding content to target/main/" 
+              + path + " from " + source, 
+              Project.MSG_VERBOSE );
+
+            File dest = new File( targetMain, path );
+            mkDir( dest );
+            String filters = getProject().getProperty( SRC_FILTERED_INCLUDES_KEY );
+            copy( src, dest, true, filters, "" );
+            copy( src, dest, false, "**/*.*", filters );
         }
     }
 

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/ReactorTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/ReactorTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/ReactorTask.java	Wed Jun
16 07:55:36 2004
@@ -113,7 +113,7 @@
             final Definition def = defs[i];
             try
             {
-                build( def );
+                execute( def, m_target );
             }
             catch( Throwable e )
             {
@@ -131,15 +131,20 @@
         return m_path;
     }
 
-    public void build( final Definition definition )
+    public void execute( final Definition definition )
+    {
+        execute( definition, null );
+    }
+
+    public void execute( final Definition definition, String target )
     {
         final Ant ant = (Ant) getProject().createTask( "ant" );
         ant.setDir( definition.getBasedir() );
         ant.setInheritRefs( false );
         ant.setInheritAll( false );
-        if( null != m_target )
+        if( null != target )
         {
-            ant.setTarget( m_target );
+            ant.setTarget( target );
         }
         ant.init();
         ant.execute();

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message