mcconnell    2003/09/15 01:26:22

  Modified:    merlin   maven.xml project.xml
               merlin/kernel/bootstrap .cvsignore maven.xml project.xml
               merlin/kernel/bootstrap/src/java Merlin.java
               merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl
                        DefaultKernelContext.java
               merlin/kernel/plugin .cvsignore plugin.jelly project.xml
               merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools
                        MerlinBean.java
  Log:
  Addition of a build identifier.
  
  Revision  Changes    Path
  1.64      +1 -4      avalon-sandbox/merlin/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/maven.xml,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- maven.xml 14 Sep 2003 13:17:06 -0000      1.63
  +++ maven.xml 15 Sep 2003 08:26:21 -0000      1.64
  @@ -65,8 +65,7 @@
     </goal>
   
   
  -  <goal name="merlin:build" description="Build Merlin." >
  -    <!-- build the subprojects -->
  +  <goal name="merlin:build" description="Build Merlin.">
       <maven:reactor basedir="${basedir}"
         includes="**/project.xml"
         
excludes="target/**,merlin-platform/**,kernel/plugin/**,project.xml,merlin-extensions/**"
  @@ -76,10 +75,8 @@
       <attainGoal name="merlin:plugin"/>
     </goal>
   
  -
     <goal name="merlin:install" 
       description="Build the Merlin distribution." prereqs="merlin:build,xinstall"/>
  -
   
     <goal name="xinstall">
       <!-- prepare structure -->
  
  
  
  1.37      +6 -0      avalon-sandbox/merlin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/project.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- project.xml       12 Sep 2003 21:10:55 -0000      1.36
  +++ project.xml       15 Sep 2003 08:26:21 -0000      1.37
  @@ -268,6 +268,12 @@
             <include>kernel.xml</include>
           </includes>
         </resource>
  +      <resource>
  +        <directory>${basedir}</directory>
  +        <includes> 
  +          <include>snapshot.properties</include>
  +        </includes>
  +      </resource>
       </resources>
       
       <jars></jars>
  
  
  
  1.2       +1 -0      avalon-sandbox/merlin/kernel/bootstrap/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/bootstrap/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore        11 Aug 2003 22:34:45 -0000      1.1
  +++ .cvsignore        15 Sep 2003 08:26:21 -0000      1.2
  @@ -2,3 +2,4 @@
   velocity.log
   build.properties
   target
  +snapshot.properties
  \ No newline at end of file
  
  
  
  1.4       +8 -2      avalon-sandbox/merlin/kernel/bootstrap/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/bootstrap/maven.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- maven.xml 14 Sep 2003 13:10:17 -0000      1.3
  +++ maven.xml 15 Sep 2003 08:26:21 -0000      1.4
  @@ -2,15 +2,21 @@
   
     <property name="maven.jar.manifest" value="${basedir}/src/etc/project.mf"/>
     <property name="maven.jar.manifest.extensions.add" value="false"/>
  +  <property file="project.properties"/>
   
     <preGoal name="jar:jar">
  -    <echo>Jar creation: ${maven.home}</echo>
  +    <maven:snapshot project="${pom}"/>
  +    <j:set var="timestamp" 
value="${snapshotSignature.substring(pom.artifactId.length)}"/>
  +    <ant:property name="merlin.timestamp" value="${timestamp}"/>
  +<ant:echo file="${basedir}/snapshot.properties">
  +build.signature = ${snapshotSignature}
  +</ant:echo>
       <unzip 
src="${pom.getDependencyPath('avalon-repository:avalon-repository-spi')}" 
         dest="${maven.build.dir}/classes"/>
       <unzip 
src="${pom.getDependencyPath('avalon-repository:avalon-repository-impl')}" 
         dest="${maven.build.dir}/classes"/>
     </preGoal>
  -  
  +
     <goal name="build" prereqs="jar:install">
       <ant:property environment="env"/>
       <ant:property name="merlinEnvironment" value="${env.MERLIN_HOME}"/>
  
  
  
  1.7       +6 -0      avalon-sandbox/merlin/kernel/bootstrap/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/bootstrap/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml       12 Sep 2003 21:10:55 -0000      1.6
  +++ project.xml       15 Sep 2003 08:26:21 -0000      1.7
  @@ -45,6 +45,12 @@
             <include>merlin.properties</include>
           </includes>
         </resource>
  +      <resource>
  +        <directory>${basedir}</directory>
  +        <includes> 
  +          <include>snapshot.properties</include>
  +        </includes>
  +      </resource>
       </resources>
   
       <jars></jars>
  
  
  
  1.15      +2 -2      avalon-sandbox/merlin/kernel/bootstrap/src/java/Merlin.java
  
  Index: Merlin.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/bootstrap/src/java/Merlin.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Merlin.java       14 Sep 2003 13:10:17 -0000      1.14
  +++ Merlin.java       15 Sep 2003 08:26:21 -0000      1.15
  @@ -146,7 +146,7 @@
   
           if( debug )
           {
  -            System.out.println( "MERLIN SYSTEM REPOSITORY: " + base );
  +            System.out.println( "System Repository: " + base );
           }
   
           //
  @@ -235,7 +235,7 @@
   
           if( debug )
           {
  -            System.out.println( "\nCONTEXT CLASSLOADER DUMP\n" );
  +            System.out.println( "Classloader dump:\n" );
               printClassLoader( loader );
               System.out.println( "\n" );
           }
  
  
  
  1.30      +29 -2     
avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelContext.java
  
  Index: DefaultKernelContext.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/merlin/kernel/impl/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernelContext.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- DefaultKernelContext.java 14 Sep 2003 13:11:34 -0000      1.29
  +++ DefaultKernelContext.java 15 Sep 2003 08:26:22 -0000      1.30
  @@ -51,10 +51,12 @@
   package org.apache.avalon.merlin.kernel.impl;
   
   import java.io.File;
  +import java.io.IOException;
  +import java.io.InputStream;
   import java.net.URL;
   import java.util.ArrayList;
   import java.util.Enumeration;
  -import java.io.InputStream;
  +import java.util.Properties;
   
   import org.apache.avalon.composition.data.CategoryDirective;
   import org.apache.avalon.composition.data.CategoriesDirective;
  @@ -84,6 +86,7 @@
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.merlin.kernel.KernelContext;
   import org.apache.avalon.merlin.kernel.KernelException;
  +import org.apache.avalon.merlin.kernel.KernelRuntimeException;
   import org.apache.avalon.repository.Repository;
   import org.apache.avalon.repository.ProxyContext;
   import org.apache.avalon.repository.impl.DefaultAuthenticator;
  @@ -712,6 +715,7 @@
           buffer.append( "  ${user.dir}: " + System.getProperty( "user.dir" ) );
           buffer.append( "\n  ${merlin.home}: " + getMerlinHomeDirectory() );
           buffer.append( "\n  Version: " + getVersionString() );
  +        buffer.append( "\n  Build: " + getBuildSignature() );
           buffer.append( "\n  Environment: " 
                 + System.getProperty( "os.name" ) + " "
                 + System.getProperty( "os.version" ) + " Java " 
  @@ -962,4 +966,27 @@
           }
       }
   
  +    private static String getBuildSignature()
  +    {
  +        try
  +        {
  +            final ClassLoader classloader = 
DefaultKernelContext.class.getClassLoader();
  +            final InputStream input = 
  +              classloader.getResourceAsStream( "snapshot.properties"  );
  +            if( input == null ) return "ERROR-MISSING-PROPERTIES: 
snapshot.properties";
  +            final Properties properties = new Properties();
  +            properties.load( input );
  +            final String snapshot = properties.getProperty( "build.signature" );
  +            if( snapshot == null ) return "ERROR-MISSING-PROPERTY: build.signature";
  +            final int start = snapshot.lastIndexOf("-");
  +            final int end = snapshot.lastIndexOf(".");
  +            return snapshot.substring( start + 1, end );
  +        }
  +        catch( Throwable e )
  +        {
  +            final String error = 
  +              "Internal error while attempting to build the build signature.";
  +            throw new KernelRuntimeException( error, e );
  +        }
  +    }
   }
  
  
  
  1.2       +1 -0      avalon-sandbox/merlin/kernel/plugin/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/plugin/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore        10 Sep 2003 00:32:27 -0000      1.1
  +++ .cvsignore        15 Sep 2003 08:26:22 -0000      1.2
  @@ -1,3 +1,4 @@
   target
   maven.log
   velocity.log
  +snapshot.properties
  
  
  
  1.3       +0 -1      avalon-sandbox/merlin/kernel/plugin/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/plugin/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly      14 Sep 2003 13:09:32 -0000      1.2
  +++ plugin.jelly      15 Sep 2003 08:26:22 -0000      1.3
  @@ -75,7 +75,6 @@
       <j:if test="${!repo.exists()}">
         <j:set var="merlin.repository.local" value="${user.dir}/.maven/repository"/>
       </j:if>
  -    <echo>merlin.repository.local = ${merlin.repository.local}</echo>
   
       <!--
       If a kernel configuration has been declared the use it otherwise
  
  
  
  1.6       +6 -0      avalon-sandbox/merlin/kernel/plugin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/kernel/plugin/project.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project.xml       12 Sep 2003 21:10:55 -0000      1.5
  +++ project.xml       15 Sep 2003 08:26:22 -0000      1.6
  @@ -241,6 +241,12 @@
             <include>project.xml</include>
           </includes>
         </resource>
  +      <resource>
  +        <directory>${basedir}</directory>
  +        <includes>
  +          <include>snapshot.properties</include>
  +        </includes>
  +      </resource>
       </resources>
   
     </build>
  
  
  
  1.3       +4 -1      
avalon-sandbox/merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools/MerlinBean.java
  
  Index: MerlinBean.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/merlin/kernel/plugin/src/java/org/apache/avalon/merlin/tools/MerlinBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MerlinBean.java   14 Sep 2003 13:09:33 -0000      1.2
  +++ MerlinBean.java   15 Sep 2003 08:26:22 -0000      1.3
  @@ -50,11 +50,14 @@
   package org.apache.avalon.merlin.tools;
   
   import java.io.File;
  +import java.io.IOException;
  +import java.io.InputStream;
   import java.net.URL;
   import java.util.ArrayList;
   import java.util.Hashtable;
   import java.util.List;
   import java.util.Map;
  +import java.util.Properties;
   
   import org.apache.avalon.repository.Repository;
   import org.apache.avalon.repository.impl.DefaultFileRepository;
  @@ -326,6 +329,7 @@
       public void doExecute() throws Exception
       {
           DefaultKernelContext context = null;
  +
           try
           {
               Repository repository = new DefaultFileRepository( m_repository );
  @@ -409,6 +413,5 @@
             }
           );
       }
  -
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to