ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/extensions JarLibManifestTask.java
Date Wed, 17 Apr 2002 07:16:21 GMT
adammurdoch    02/04/17 00:16:21

  Modified:    api/src/java/org/apache/myrmidon/api TaskContext.java
               container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               antlib/src/java/org/apache/antlib/extensions
                        JarLibManifestTask.java
  Log:
  Make Constants.BUILD_DESCRIPTION available via the TaskContext as a
  property.  Use this property in <jarlib-manifest>, since Constants is
  off in another ClassLoader.
  
  Revision  Changes    Path
  1.29      +17 -2     jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/TaskContext.java
  
  Index: TaskContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/TaskContext.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- TaskContext.java	7 Apr 2002 01:59:27 -0000	1.28
  +++ TaskContext.java	17 Apr 2002 07:16:20 -0000	1.29
  @@ -16,13 +16,28 @@
    * path between the container and the Task.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.28 $ $Date: 2002/04/07 01:59:27 $
  + * @version $Revision: 1.29 $ $Date: 2002/04/17 07:16:20 $
  + *
  + * @todo Add some additional standard properties.
    */
   public interface TaskContext
   {
  -    //these are the names of properties that every TaskContext must contain
  +    // Sandard properties that every TaskContext must contain
  +
  +    /**
  +     * The name of the base directory property.  This property must be present.
  +     */
       String BASE_DIRECTORY = "myrmidon.base.directory";
  +
  +    /**
  +     * The name of the task name property.  This property must be present.
  +     */
       String NAME = "myrmidon.task.name";
  +
  +    /**
  +     * The name of the container description.  This is an optional property.
  +     */
  +    String CONTAINER_DESCRIPTION = "myrmidon.container.description";
   
       /**
        * Retrieve Name of task.
  
  
  
  1.46      +6 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- DefaultEmbeddor.java	9 Apr 2002 07:21:12 -0000	1.45
  +++ DefaultEmbeddor.java	17 Apr 2002 07:16:20 -0000	1.46
  @@ -55,13 +55,15 @@
   import org.apache.myrmidon.listeners.ProjectListener;
   import org.apache.myrmidon.components.workspace.DefaultExecutionFrame;
   import org.apache.myrmidon.components.store.DefaultPropertyStore;
  +import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.Constants;
   
   /**
    * Default implementation of Embeddor.
    * Instantiate this to embed inside other applications.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.45 $ $Date: 2002/04/09 07:21:12 $
  + * @version $Revision: 1.46 $ $Date: 2002/04/17 07:16:20 $
    */
   public class DefaultEmbeddor
       extends AbstractLogEnabled
  @@ -429,6 +431,9 @@
   
           //Add system properties so that they overide user-defined properties
           addToStore( store, System.getProperties() );
  +
  +        //Add runtime info
  +        store.setProperty( TaskContext.CONTAINER_DESCRIPTION, Constants.BUILD_DESCRIPTION
);
   
           return store;
       }
  
  
  
  1.2       +6 -2      jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/extensions/JarLibManifestTask.java
  
  Index: JarLibManifestTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/extensions/JarLibManifestTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JarLibManifestTask.java	14 Apr 2002 10:55:07 -0000	1.1
  +++ JarLibManifestTask.java	17 Apr 2002 07:16:21 -0000	1.2
  @@ -18,8 +18,8 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.io.IOUtil;
  -import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.AbstractTask;
  +import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   
   /**
  @@ -150,7 +150,11 @@
           final Attributes attributes = manifest.getMainAttributes();
   
           attributes.put( Attributes.Name.MANIFEST_VERSION, MANIFEST_VERSION );
  -        attributes.putValue( CREATED_BY, Constants.BUILD_DESCRIPTION );
  +        final Object containerDescription = getContext().getProperty( TaskContext.CONTAINER_DESCRIPTION
);
  +        if( containerDescription != null )
  +        {
  +            attributes.putValue( CREATED_BY, containerDescription.toString() );
  +        }
   
           appendExtraAttributes( attributes );
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message