avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject svn commit: rev 21000 - in avalon/trunk: central/system runtime runtime/framework runtime/logging runtime/meta runtime/repository runtime/test runtime/test/dynamics runtime/test/includes runtime/test/playground runtime/test/testa runtime/test/testb runtime/test/testc runtime/test/testd runtime/test/teste runtime/util tools/project/src/main/org/apache/avalon/tools/home tools/project/src/main/org/apache/avalon/tools/tasks tools/project/src/test
Date Thu, 10 Jun 2004 12:26:32 GMT
Author: mcconnell
Date: Thu Jun 10 05:26:31 2004
New Revision: 21000

Added:
   avalon/trunk/runtime/test/build.properties   (contents, props changed)
   avalon/trunk/runtime/test/build.xml   (contents, props changed)
Modified:
   avalon/trunk/central/system/index.xml
   avalon/trunk/runtime/build.xml
   avalon/trunk/runtime/framework/build.xml
   avalon/trunk/runtime/logging/build.xml
   avalon/trunk/runtime/meta/build.xml
   avalon/trunk/runtime/repository/build.xml
   avalon/trunk/runtime/test/dynamics/build.properties
   avalon/trunk/runtime/test/includes/build.properties
   avalon/trunk/runtime/test/playground/build.properties
   avalon/trunk/runtime/test/testa/build.properties
   avalon/trunk/runtime/test/testb/build.properties
   avalon/trunk/runtime/test/testc/build.properties
   avalon/trunk/runtime/test/testd/build.properties
   avalon/trunk/runtime/test/teste/build.properties
   avalon/trunk/runtime/util/build.xml
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
   avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/ReactorTask.java
   avalon/trunk/tools/project/src/test/build.xml
Log:
Adding improved reactor build.

Modified: avalon/trunk/central/system/index.xml
==============================================================================
--- avalon/trunk/central/system/index.xml	(original)
+++ avalon/trunk/central/system/index.xml	Thu Jun 10 05:26:31 2004
@@ -319,7 +319,7 @@
     Avalon Test.
     -->
 
-    <project basedir="../../runtime/meta/test/dynamics">
+    <project basedir="../../runtime/test/dynamics">
       <info>
         <group>avalon/test</group>
         <name>avalon-test-dynamics</name>
@@ -334,7 +334,7 @@
       </dependencies>
     </project>
 
-    <project basedir="../../runtime/meta/test/playground">
+    <project basedir="../../runtime/test/playground">
       <info>
         <group>avalon/test</group>
         <name>avalon-test-playground</name>
@@ -350,7 +350,7 @@
       </dependencies>
     </project>
 
-    <project basedir="../../runtime/meta/test/testa">
+    <project basedir="../../runtime/test/testa">
       <info>
         <group>avalon/test</group>
         <name>avalon-test-testa</name>
@@ -366,7 +366,7 @@
       </dependencies>
     </project>
 
-    <project basedir="../../runtime/meta/test/testb">
+    <project basedir="../../runtime/test/testb">
       <info>
         <group>avalon/test</group>
         <name>avalon-test-testb</name>
@@ -381,7 +381,7 @@
       </dependencies>
     </project>
 
-    <project basedir="../../runtime/meta/test/testc">
+    <project basedir="../../runtime/test/testc">
       <info>
         <group>avalon/test</group>ss
         <name>avalon-test-testc</name>
@@ -396,7 +396,7 @@
       </dependencies>
     </project>
 
-    <project basedir="../../runtime/meta/test/testd">
+    <project basedir="../../runtime/test/testd">
       <info>
         <group>avalon/test</group>
         <name>avalon-test-testd</name>
@@ -411,7 +411,7 @@
       </dependencies>
     </project>
 
-    <project basedir="../../runtime/meta/test/teste">
+    <project basedir="../../runtime/test/teste">
       <info>
         <group>avalon/test</group>
         <name>avalon-test-teste</name>
@@ -426,6 +426,13 @@
       </dependencies>
     </project>
 
+    <project basedir="../../runtime/test/includes">
+      <info>
+        <group>avalon/test</group>
+        <name>avalon-test-includes</name>
+      </info>
+    </project>
+
     <!--
     Avalon Repository.
     -->
@@ -724,6 +731,7 @@
           <projectref key="avalon-util-extension-impl"/>
           <projectref key="avalon-util-lifecycle"/>
           <projectref key="avalon-logging-impl" build="false" test="true"/>
+          <projectref key="avalon-test-dynamics" build="false" test="true"/>
         </projects>
       </dependencies>
     </project>

Modified: avalon/trunk/runtime/build.xml
==============================================================================
--- avalon/trunk/runtime/build.xml	(original)
+++ avalon/trunk/runtime/build.xml	Thu Jun 10 05:26:31 2004
@@ -3,22 +3,6 @@
 <project name="runtime" default="dist" basedir="." xmlns:x="antlib:org.apache.avalon.tools">
 
   <property file="build.properties"/>
-
-  <path id="targets">
-    <fileset dir="." includes="**/build.xml" excludes="build.xml,framework/build.xml,logging/build.xml,meta/build.xml,repository/build.xml,util/build.xml,**/target/**"/>
-  </path>
-
-  <target name="dist" depends="">
-    <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
-  </target>
-
-  <target name="clean" depends="">
-    <subant inheritAll="false" 
-       genericantfile="${project.home}/build/standard.xml" target="clean"
-       buildpathref="targets"/>
-  </target>
+  <import file="${project.home}/build/reactor.xml"/>
 
 </project>

Modified: avalon/trunk/runtime/framework/build.xml
==============================================================================
--- avalon/trunk/runtime/framework/build.xml	(original)
+++ avalon/trunk/runtime/framework/build.xml	Thu Jun 10 05:26:31 2004
@@ -3,22 +3,6 @@
 <project name="test" default="build" basedir="." xmlns:x="antlib:org.apache.avalon.tools">
 
   <property file="build.properties"/>
-
-  <path id="targets">
-    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
-  </path>
-
-  <target name="build" depends="">
-    <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
-  </target>
-
-  <target name="clean" depends="">
-    <subant inheritAll="false" 
-       genericantfile="${project.home}/build/standard.xml" target="clean"
-       buildpathref="targets"/>
-  </target>
+  <import file="${project.home}/build/reactor.xml"/>
 
 </project>

Modified: avalon/trunk/runtime/logging/build.xml
==============================================================================
--- avalon/trunk/runtime/logging/build.xml	(original)
+++ avalon/trunk/runtime/logging/build.xml	Thu Jun 10 05:26:31 2004
@@ -3,22 +3,6 @@
 <project name="avalon-logging" default="dist" basedir="." xmlns:x="antlib:org.apache.avalon.tools">
 
   <property file="build.properties"/>
-
-  <path id="targets">
-    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
-  </path>
-
-  <target name="dist" depends="">
-    <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
-  </target>
-
-  <target name="clean" depends="">
-    <subant inheritAll="false" 
-       genericantfile="${project.home}/build/standard.xml" target="clean"
-       buildpathref="targets"/>
-  </target>
+  <import file="${project.home}/build/reactor.xml"/>
 
 </project>

Modified: avalon/trunk/runtime/meta/build.xml
==============================================================================
--- avalon/trunk/runtime/meta/build.xml	(original)
+++ avalon/trunk/runtime/meta/build.xml	Thu Jun 10 05:26:31 2004
@@ -4,22 +4,6 @@
     xmlns:x="antlib:org.apache.avalon.tools">
 
   <property file="build.properties"/>
-
-  <path id="targets">
-    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
-  </path>
-
-  <target name="build" depends="">
-    <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
-  </target>
-
-  <target name="clean" depends="">
-    <subant inheritAll="false" 
-       genericantfile="${project.home}/build/standard.xml" target="clean"
-       buildpathref="targets"/>
-  </target>
+  <import file="${project.home}/build/reactor.xml"/>
 
 </project>

Modified: avalon/trunk/runtime/repository/build.xml
==============================================================================
--- avalon/trunk/runtime/repository/build.xml	(original)
+++ avalon/trunk/runtime/repository/build.xml	Thu Jun 10 05:26:31 2004
@@ -4,22 +4,6 @@
     xmlns:x="antlib:org.apache.avalon.tools">
 
   <property file="build.properties"/>
-
-  <path id="targets">
-    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
-  </path>
-
-  <target name="build" depends="">
-    <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
-  </target>
-
-  <target name="clean" depends="">
-    <subant inheritAll="false" 
-       genericantfile="${project.home}/build/standard.xml" target="clean"
-       buildpathref="targets"/>
-  </target>
+  <import file="${project.home}/build/reactor.xml"/>
 
 </project>

Added: avalon/trunk/runtime/test/build.properties
==============================================================================
--- (empty file)
+++ avalon/trunk/runtime/test/build.properties	Thu Jun 10 05:26:31 2004
@@ -0,0 +1 @@
+project.home = ../../central/system

Added: avalon/trunk/runtime/test/build.xml
==============================================================================
--- (empty file)
+++ avalon/trunk/runtime/test/build.xml	Thu Jun 10 05:26:31 2004
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<project name="test" default="build" basedir="." 
+    xmlns:x="antlib:org.apache.avalon.tools">
+
+  <property file="build.properties"/>
+  <import file="${project.home}/build/reactor.xml"/>
+
+</project>

Modified: avalon/trunk/runtime/test/dynamics/build.properties
==============================================================================
--- avalon/trunk/runtime/test/dynamics/build.properties	(original)
+++ avalon/trunk/runtime/test/dynamics/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-dynamics
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/includes/build.properties
==============================================================================
--- avalon/trunk/runtime/test/includes/build.properties	(original)
+++ avalon/trunk/runtime/test/includes/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-includes
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/playground/build.properties
==============================================================================
--- avalon/trunk/runtime/test/playground/build.properties	(original)
+++ avalon/trunk/runtime/test/playground/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-playground
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/testa/build.properties
==============================================================================
--- avalon/trunk/runtime/test/testa/build.properties	(original)
+++ avalon/trunk/runtime/test/testa/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-testa
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/testb/build.properties
==============================================================================
--- avalon/trunk/runtime/test/testb/build.properties	(original)
+++ avalon/trunk/runtime/test/testb/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-testb
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/testc/build.properties
==============================================================================
--- avalon/trunk/runtime/test/testc/build.properties	(original)
+++ avalon/trunk/runtime/test/testc/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-testc
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/testd/build.properties
==============================================================================
--- avalon/trunk/runtime/test/testd/build.properties	(original)
+++ avalon/trunk/runtime/test/testd/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-testd
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/test/teste/build.properties
==============================================================================
--- avalon/trunk/runtime/test/teste/build.properties	(original)
+++ avalon/trunk/runtime/test/teste/build.properties	Thu Jun 10 05:26:31 2004
@@ -1,2 +1,2 @@
 project.name = avalon-test-teste
-project.home = ../../../../central/system
+project.home = ../../../central/system

Modified: avalon/trunk/runtime/util/build.xml
==============================================================================
--- avalon/trunk/runtime/util/build.xml	(original)
+++ avalon/trunk/runtime/util/build.xml	Thu Jun 10 05:26:31 2004
@@ -3,22 +3,6 @@
 <project name="test" default="build" basedir="." xmlns:x="antlib:org.apache.avalon.tools">
 
   <property file="build.properties"/>
-
-  <path id="targets">
-    <fileset dir="." includes="**/build.xml" excludes="build.xml"/>
-  </path>
-
-  <target name="build" depends="">
-    <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
-  </target>
-
-  <target name="clean" depends="">
-    <subant inheritAll="false" 
-       genericantfile="${project.home}/build/standard.xml" target="clean"
-       buildpathref="targets"/>
-  </target>
+  <import file="${project.home}/build/reactor.xml"/>
 
 </project>

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/home/Home.java	Thu Jun 10
05:26:31 2004
@@ -143,6 +143,27 @@
         return m_repository;
     }
 
+    public Resource[] getResources()
+    {
+        return (Resource[]) m_resources.values().toArray( new Resource[0] );
+
+    }
+    public Definition[] getDefinitions()
+      throws BuildException
+    {
+        ArrayList list = new ArrayList();
+        Resource[] resources = getResources();
+        for( int i=0; i<resources.length; i++ )
+        {
+            Resource resource = resources[i];
+            if( resource instanceof Definition )
+            {
+                list.add( resource );
+            }
+        }
+        return (Definition[]) list.toArray( new Definition[0] );
+    }
+
     public Plugin getPlugin( PluginRef ref )
       throws BuildException
     {

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/JUnitTestTask.java	Thu
Jun 10 05:26:31 2004
@@ -187,9 +187,7 @@
     private File getUnitTestResourcesDirectory( File build )
     {
         File etc = new File( build, "etc" );
-        File test = new File( etc, "test" );
-        File unit = new File( test, "unit" );
-        return unit;
+        return new File( etc, "test" );
     }
 
     private void copyCompileResource( File src, File classes )

Modified: avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/ReactorTask.java
==============================================================================
--- avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/ReactorTask.java	(original)
+++ avalon/trunk/tools/project/src/main/org/apache/avalon/tools/tasks/ReactorTask.java	Thu
Jun 10 05:26:31 2004
@@ -57,6 +57,8 @@
 {
     private static final String BANNER = 
       "------------------------------------------------------------------------";
+
+    private String m_target;
     private Path m_path;
     private List m_defs;
 
@@ -65,38 +67,47 @@
         if( !isInitialized() )
         {
             super.init();
-            m_path = new Path( getProject() );
         }
     }
 
+    public void setTarget( final String target )
+    {
+        m_target = target;
+    }
+
     public void addConfigured( final Path path )
     {
-        m_path.add( path );
+        getPath().add( path );
     }
 
     public void addConfigured( final DirSet dirset )
     {
-        m_path.addDirset( dirset );
+        getPath().addDirset( dirset );
     }
 
     public void addConfigured( final FileSet fileset )
     {
-        m_path.addFileset( fileset );
+        getPath().addFileset( fileset );
     }
 
     public void addConfigured( final FileList list ) 
     {
-        m_path.addFilelist( list );
+        getPath().addFilelist( list );
     }
 
     public void execute() throws BuildException 
     {
         final Project project = getProject();
         log( "Finding project defintions." );
+        long now = System.currentTimeMillis();
         m_defs = getDefinitions();
+        long discovery = System.currentTimeMillis() - now;
+
+        log( "Discovery took: (" + discovery + " msecs.)" );
         log( "Build sequence for projects." );
         final Definition[] defs = walkGraph();
-        log( "Sequence established:" );
+        long graph = System.currentTimeMillis() - discovery - now;
+        log( "Sequence established: (" + graph + " msecs.)" );
         project.log( BANNER );
         for( int i=0; i<defs.length; i++ )
         {
@@ -118,12 +129,25 @@
         }
     }
 
+    private Path getPath()
+    {
+        if( null == m_path )
+        {
+            m_path = new Path( getProject() );
+        }
+        return m_path;
+    }
+
     public void build( final Definition definition )
     {
         final Ant ant = (Ant) getProject().createTask( "ant" );
         ant.setDir( definition.getBasedir() );
         ant.setInheritRefs( false );
         ant.setInheritAll( false );
+        if( null != m_target )
+        {
+            ant.setTarget( m_target );
+        }
         ant.init();
         ant.execute();
     }
@@ -189,10 +213,47 @@
 
     private List getDefinitions()
     {
-        final ArrayList list = new ArrayList();
         final Project project = getProject();
-        final File basedir = project.getBaseDir();
-        final String[] names = m_path.list();
+        final File basedir = project.getBaseDir(); 
+        if( null == m_path )
+        {
+            return getLocalDefinitions( project, basedir );
+        }
+        else
+        {
+            return getExplicitDefinitions( project, basedir );
+        }
+    }
+
+    private List getLocalDefinitions( Project project, File basedir )
+    {
+        try
+        {
+            final ArrayList list = new ArrayList();
+            String path = basedir.getCanonicalPath();
+            Definition[] defs = getHome().getDefinitions();
+            for( int i=0; i<defs.length; i++ )
+            {
+                Definition def = defs[i];
+                String base = def.getBasedir().getCanonicalPath();
+                if( base.startsWith( path ) )
+                {
+                    list.add( def );
+                }
+            }
+            return list;
+        }
+        catch( IOException ioe )
+        {
+            throw new BuildException( ioe );
+        }
+    }
+
+    private List getExplicitDefinitions( Project project, File basedir )
+    {
+        final ArrayList list = new ArrayList();
+
+        final String[] names = getPath().list();
         for( int i=0; i<names.length; i++ )
         {
             final String path = names[i];

Modified: avalon/trunk/tools/project/src/test/build.xml
==============================================================================
--- avalon/trunk/tools/project/src/test/build.xml	(original)
+++ avalon/trunk/tools/project/src/test/build.xml	Thu Jun 10 05:26:31 2004
@@ -2,21 +2,15 @@
 
 <project name="test" default="build" basedir="." xmlns:x="antlib:org.apache.avalon.tools">
 
-  <path id="targets">
-    <dirset dir="projects" includes="*"/>
-  </path>
-
   <target name="build" depends="">
     <property file="build.properties"/>
     <x:home/>
-    <x:reactor>
-      <path refid="targets"/>
-    </x:reactor>
+    <x:reactor/>
   </target>
 
   <target name="clean" depends="">
-    <subant inheritAll="false" genericantfile="standard.xml" target="clean"
-       buildpathref="targets"/>
+    <x:home/>
+    <x:reactor target="clean"/>
   </target>
 
 </project>

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


Mime
View raw message