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/container/src/java/org/apache/myrmidon/interfaces/workspace ProjectRefSet.java TargetSet.java ProjectRefs.java
Date Tue, 02 Jul 2002 10:48:39 GMT
adammurdoch    2002/07/02 03:48:39

  Modified:    antlib/src/java/org/apache/antlib/project
                        ProjectRefTask.java
               ant1compat/src/java/org/apache/tools/ant/taskdefs
                        CallTarget.java
               framework/src/java/org/apache/myrmidon/framework/project
                        AbstractWorkspaceTask.java
               container/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java ProjectEntry.java
  Added:       container/src/java/org/apache/myrmidon/interfaces/workspace
                        ProjectRefSet.java TargetSet.java
  Removed:     container/src/java/org/apache/myrmidon/interfaces/workspace
                        ProjectRefs.java
  Log:
  - Renamed ProjectRefs to ProjectRefSet.
  - Added TargetSet interface, which allows tasks to manage the set of targets
    in the current project.  Workspace provides the implementation.
  
  Revision  Changes    Path
  1.2       +3 -3      jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/project/ProjectRefTask.java
  
  Index: ProjectRefTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/project/ProjectRefTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProjectRefTask.java	27 Jun 2002 11:13:08 -0000	1.1
  +++ ProjectRefTask.java	2 Jul 2002 10:48:38 -0000	1.2
  @@ -13,7 +13,7 @@
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.interfaces.workspace.ProjectRef;
  -import org.apache.myrmidon.interfaces.workspace.ProjectRefs;
  +import org.apache.myrmidon.interfaces.workspace.ProjectRefSet;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   
   /**
  @@ -79,7 +79,7 @@
           final ProjectDescriptor descriptor = new ProjectDescriptor( uri, m_type );
           final ProjectRef ref = new ProjectRef( m_name, descriptor );
   
  -        final ProjectRefs projectRefs = (ProjectRefs)getContext().getProperty( ProjectRefs.KEY
);
  +        final ProjectRefSet projectRefs = (ProjectRefSet)getContext().getProperty( ProjectRefSet.KEY
);
           projectRefs.addProjectRef( ref );
       }
   }
  
  
  
  1.9       +3 -3      jakarta-ant-myrmidon/ant1compat/src/java/org/apache/tools/ant/taskdefs/CallTarget.java
  
  Index: CallTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/ant1compat/src/java/org/apache/tools/ant/taskdefs/CallTarget.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CallTarget.java	2 Jul 2002 02:10:43 -0000	1.8
  +++ CallTarget.java	2 Jul 2002 10:48:38 -0000	1.9
  @@ -10,7 +10,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.ExecuteTarget;
   import org.apache.myrmidon.interfaces.workspace.ProjectRef;
  -import org.apache.myrmidon.interfaces.workspace.ProjectRefs;
  +import org.apache.myrmidon.interfaces.workspace.ProjectRefSet;
   
   /**
    * The Ant1Compat version of the <antcall> task, which delegates to the
  @@ -36,7 +36,7 @@
        */
       protected void prepare( final ExecuteTarget exe ) throws TaskException
       {
  -        final ProjectRefs refs = (ProjectRefs)m_context.getProperty( ProjectRefs.KEY );
  +        final ProjectRefSet refs = (ProjectRefSet)m_context.getProperty( ProjectRefSet.KEY
);
           final ProjectRef thisProject = refs.getProjectRef( null );
           exe.setProject( thisProject.getProject() );
       }
  
  
  
  1.5       +4 -4      jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/project/AbstractWorkspaceTask.java
  
  Index: AbstractWorkspaceTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/project/AbstractWorkspaceTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractWorkspaceTask.java	2 Jul 2002 09:56:25 -0000	1.4
  +++ AbstractWorkspaceTask.java	2 Jul 2002 10:48:38 -0000	1.5
  @@ -12,7 +12,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.AbstractContainerTask;
   import org.apache.myrmidon.interfaces.workspace.ProjectRef;
  -import org.apache.myrmidon.interfaces.workspace.ProjectRefs;
  +import org.apache.myrmidon.interfaces.workspace.ProjectRefSet;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   import org.apache.myrmidon.interfaces.workspace.Workspace;
   
  @@ -76,8 +76,8 @@
       protected ProjectDescriptor getProjectDescriptor( final String projectName )
           throws TaskException
       {
  -        final ProjectRefs projectRefs =
  -            (ProjectRefs)getContext().getProperty( ProjectRefs.KEY );
  +        final ProjectRefSet projectRefs =
  +            (ProjectRefSet)getContext().getProperty( ProjectRefSet.KEY );
           final ProjectRef projectRef = projectRefs.getProjectRef( projectName );
           if( null == projectRef )
           {
  
  
  
  1.110     +5 -3      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
  
  Index: DefaultWorkspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- DefaultWorkspace.java	2 Jul 2002 09:56:26 -0000	1.109
  +++ DefaultWorkspace.java	2 Jul 2002 10:48:38 -0000	1.110
  @@ -23,8 +23,9 @@
   import org.apache.myrmidon.interfaces.property.PropertyStore;
   import org.apache.myrmidon.interfaces.service.AntServiceKernel;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  -import org.apache.myrmidon.interfaces.workspace.ProjectRefs;
  +import org.apache.myrmidon.interfaces.workspace.ProjectRefSet;
   import org.apache.myrmidon.interfaces.workspace.Workspace;
  +import org.apache.myrmidon.interfaces.workspace.TargetSet;
   
   /**
    * This is the default implementation of Workspace.
  @@ -218,7 +219,8 @@
           final PropertyStore propertyStore =
               (PropertyStore)projectContext.getService( PropertyStore.class );
           propertyStore.setProperty( Project.KEY, project );
  -        propertyStore.setProperty( ProjectRefs.KEY, entry );
  +        propertyStore.setProperty( ProjectRefSet.KEY, entry );
  +        propertyStore.setProperty( TargetSet.KEY, entry );
   
           return entry;
       }
  
  
  
  1.20      +30 -8     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/ProjectEntry.java
  
  Index: ProjectEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/ProjectEntry.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ProjectEntry.java	2 Jul 2002 09:56:26 -0000	1.19
  +++ ProjectEntry.java	2 Jul 2002 10:48:38 -0000	1.20
  @@ -19,7 +19,8 @@
   import org.apache.myrmidon.interfaces.property.NameValidator;
   import org.apache.myrmidon.interfaces.property.NameValidatorManager;
   import org.apache.myrmidon.interfaces.workspace.ProjectRef;
  -import org.apache.myrmidon.interfaces.workspace.ProjectRefs;
  +import org.apache.myrmidon.interfaces.workspace.ProjectRefSet;
  +import org.apache.myrmidon.interfaces.workspace.TargetSet;
   
   /**
    * This contains details for each project that is being executed by a
  @@ -29,7 +30,7 @@
    * @version $Revision$ $Date$
    */
   public class ProjectEntry
  -    implements ProjectRefs
  +    implements ProjectRefSet, TargetSet
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( ProjectEntry.class );
  @@ -105,6 +106,10 @@
        * Returns a read-only map of all the {@link org.apache.myrmidon.interfaces.workspace.ProjectRef}
objects in project.
        *
        * @return A map from project reference name to {@link org.apache.myrmidon.interfaces.workspace.ProjectRef}.
  +     *
  +     * @todo Return an unmodifiable wrapper.  For some reason JXPath won't
  +     *       introspect the wrapper returned by Collections.unmodifiableMap().
  +     *       Need to investigate more.
        */
       public Map getProjectRefs()
       {
  @@ -160,6 +165,28 @@
       }
   
       /**
  +     * Returns all the targets of the current project.
  +     *
  +     * @return A map from target name to {@link Target}.
  +     *
  +     * @todo Return an unmodifiable wrapper.  For some reason JXPath won't
  +     *       introspect the wrapper returned by Collections.unmodifiableMap().
  +     *       Need to investigate more.
  +     */
  +    public Map getTargets()
  +    {
  +        return m_targets;
  +    }
  +
  +    /**
  +     * Returns a target.
  +     */
  +    public Target getTarget( final String targetName )
  +    {
  +        return (Target)m_targets.get( targetName );
  +    }
  +
  +    /**
        * Adds a target to this project.
        */
       public void addTarget( final Target target )
  @@ -211,10 +238,5 @@
       public void setTargetState( final Target target, final TargetState state )
       {
           m_targetState.put( target, state );
  -    }
  -
  -    public Target getTarget( final String targetName )
  -    {
  -        return (Target)m_targets.get( targetName );
       }
   }
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace/ProjectRefSet.java
  
  Index: ProjectRefSet.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.interfaces.workspace;
  
  import java.util.Map;
  import org.apache.myrmidon.api.TaskException;
  
  /**
   * This interface is used by tasks to manage the set of project references
   * for the current project.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/02 10:48:38 $
   */
  public interface ProjectRefSet
  {
      String KEY = "myrmidon.projectrefs";
  
      /**
       * Returns all the project references of the current project.
       *
       * @return A map from project reference name to {@link ProjectRef}.
       */
      Map getProjectRefs();
  
      /**
       * Retrieve a project reference by name.
       *
       * @param name The name of the project to get.  Use null for a reference to
       * the current project.
       */
      ProjectRef getProjectRef( final String name );
  
      /**
       * Adds a project reference to the current project.
       */
      void addProjectRef( final ProjectRef ref ) throws TaskException;
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace/TargetSet.java
  
  Index: TargetSet.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.interfaces.workspace;
  
  import java.util.Map;
  import org.apache.myrmidon.api.TaskException;
  import org.apache.myrmidon.interfaces.model.Target;
  
  /**
   * This interface is used by tasks to manage the targets of the current
   * project.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/07/02 10:48:38 $
   */
  public interface TargetSet
  {
      String KEY = "myrmidon.targets";
  
      /**
       * Returns all the targets of the current project.
       *
       * @return A read-only map from target name to {@link Target}.
       */
      Map getTargets();
  
      /**
       * Retrieve a target by name.
       *
       * @param name The name of the target to get.
       */
      Target getTarget( final String name );
  
      /**
       * Adds a target to the current project.
       */
      void addTarget( final Target target ) throws TaskException;
  }
  
  
  

--
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