ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/project ProjectRefTask.java
Date Fri, 05 Jul 2002 01:49:52 GMT
donaldp     2002/07/04 18:49:52

  Modified:    framework/src/java/org/apache/myrmidon/framework/project
                        AbstractWorkspaceTask.java
               antlib/src/test/org/apache/antlib/project/test ant-call.ant
               ant1compat/src/java/org/apache/tools/ant/taskdefs
                        CallTarget.java
               container/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java ProjectEntry.java
               container/src/java/org/apache/myrmidon/interfaces/workspace
                        ProjectDescriptor.java
               antlib/src/java/org/apache/antlib/project
                        ProjectRefTask.java
  Removed:     container/src/java/org/apache/myrmidon/interfaces/workspace
                        ProjectRef.java
  Log:
  ProjectRef wrapper is no longer required now that adding project-refs is done dynamically
by tasks
  
  Revision  Changes    Path
  1.8       +5 -6      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractWorkspaceTask.java	4 Jul 2002 07:44:16 -0000	1.7
  +++ AbstractWorkspaceTask.java	5 Jul 2002 01:49:51 -0000	1.8
  @@ -11,7 +11,6 @@
   import org.apache.avalon.excalibur.i18n.Resources;
   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.ProjectDescriptor;
   import org.apache.myrmidon.interfaces.workspace.Workspace;
   
  @@ -74,18 +73,18 @@
       protected ProjectDescriptor getProjectDescriptor( final String projectName )
           throws TaskException
       {
  -        String key = ProjectRef.KEY;
  +        String key = ProjectDescriptor.KEY;
           if( null != projectName )
           {
               key += "-" + projectName;
           }
  -        final ProjectRef projectRef = (ProjectRef)getContext().getProperty( key );
  -        if( null == projectRef )
  +        final ProjectDescriptor project = (ProjectDescriptor)getContext().getProperty(
key );
  +        if( null == project )
           {
               final String message =
                   REZ.getString( "workspace.missing-ref.error", projectName );
               throw new TaskException( message );
           }
  -        return projectRef.getProject();
  +        return project;
       }
   }
  
  
  
  1.7       +1 -1      jakarta-ant-myrmidon/antlib/src/test/org/apache/antlib/project/test/ant-call.ant
  
  Index: ant-call.ant
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/test/org/apache/antlib/project/test/ant-call.ant,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ant-call.ant	4 Jul 2002 07:44:16 -0000	1.6
  +++ ant-call.ant	5 Jul 2002 01:49:51 -0000	1.7
  @@ -107,7 +107,7 @@
       <target name="ref-unknown-target">
           <expect-error>
               <exc>Execution of target "common/no-such-target" in project "${myrmidon.project/projectDescriptor/uri}"
failed.</exc>
  -            <exc>No target named "no-such-target" in project "${myrmidon.project-ref-common/project/uri}".</exc>
  +            <exc>No target named "no-such-target" in project "${myrmidon.project-descriptor-common/uri}".</exc>
               <tasks>
                   <ant-call targets="common/no-such-target"/>
               </tasks>
  
  
  
  1.12      +4 -4      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CallTarget.java	4 Jul 2002 08:02:10 -0000	1.11
  +++ CallTarget.java	5 Jul 2002 01:49:51 -0000	1.12
  @@ -9,7 +9,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.ProjectDescriptor;
   
   /**
    * The Ant1Compat version of the &lt;antcall&gt; task, which delegates to the
  @@ -35,7 +35,7 @@
        */
       protected void prepare( final ExecuteTarget exe ) throws TaskException
       {
  -        final ProjectRef thisProject = (ProjectRef)m_context.getProperty( ProjectRef.KEY
);
  -        exe.setProject( thisProject.getProject() );
  +        final ProjectDescriptor project = (ProjectDescriptor)m_context.getProperty( ProjectDescriptor.KEY
);
  +        exe.setProject( project );
       }
   }
  
  
  
  1.118     +5 -6      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.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- DefaultWorkspace.java	4 Jul 2002 08:21:12 -0000	1.117
  +++ DefaultWorkspace.java	5 Jul 2002 01:49:51 -0000	1.118
  @@ -19,7 +19,6 @@
   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.ProjectRef;
   import org.apache.myrmidon.interfaces.workspace.TargetSet;
   import org.apache.myrmidon.interfaces.workspace.Workspace;
   
  @@ -65,10 +64,10 @@
           if( projectName != null )
           {
               // A target in a referenced project
  -            final String key = ProjectRef.KEY + "-" + projectName;
  +            final String key = ProjectDescriptor.KEY + "-" + projectName;
   
  -            final ProjectRef otherProject =
  -                (ProjectRef)entry.getContext().getProperty( key );
  +            final ProjectDescriptor otherProject =
  +                (ProjectDescriptor)entry.getContext().getProperty( key );
               if( otherProject == null )
               {
                   final String message = REZ.getString( "no-project.error", projectName );
  @@ -76,7 +75,7 @@
               }
   
               // Recursively call this method, so that projects can be traversed
  -            execute( otherProject.getProject(), targetName );
  +            execute( otherProject, targetName );
           }
           else
           {
  
  
  
  1.27      +4 -4      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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ProjectEntry.java	4 Jul 2002 07:44:16 -0000	1.26
  +++ ProjectEntry.java	5 Jul 2002 01:49:52 -0000	1.27
  @@ -17,8 +17,8 @@
   import org.apache.myrmidon.interfaces.model.Target;
   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.TargetSet;
  +import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   
   /**
    * This contains details for each project that is being executed by a
  @@ -83,8 +83,8 @@
           }
   
           // Add a reference to self
  -        final ProjectRef self = new ProjectRef( project.getName(), project.getProjectDescriptor()
);
  -        m_taskContext.setProperty( ProjectRef.KEY, self );
  +        m_taskContext.setProperty( ProjectDescriptor.KEY,
  +                                   project.getProjectDescriptor() );
       }
   
       Project getProject()
  
  
  
  1.7       +3 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace/ProjectDescriptor.java
  
  Index: ProjectDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/workspace/ProjectDescriptor.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ProjectDescriptor.java	25 Jun 2002 14:45:55 -0000	1.6
  +++ ProjectDescriptor.java	5 Jul 2002 01:49:52 -0000	1.7
  @@ -16,6 +16,8 @@
    */
   public class ProjectDescriptor
   {
  +    public final static String KEY = "myrmidon.project-descriptor";
  +
       private final String m_uri;
       private final String m_type;
   
  
  
  
  1.6       +4 -6      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProjectRefTask.java	4 Jul 2002 07:44:17 -0000	1.5
  +++ ProjectRefTask.java	5 Jul 2002 01:49:52 -0000	1.6
  @@ -12,7 +12,6 @@
   import org.apache.avalon.excalibur.i18n.Resources;
   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.ProjectDescriptor;
   import org.apache.myrmidon.interfaces.property.NameValidatorManager;
   import org.apache.myrmidon.interfaces.property.NameValidator;
  @@ -83,8 +82,8 @@
               throw new TaskException( message );
           }
   
  -        final String key = ProjectRef.KEY + "-" + m_name;
  -        final ProjectRef other = (ProjectRef)getContext().getProperty( key );
  +        final String key = ProjectDescriptor.KEY + "-" + m_name;
  +        final ProjectDescriptor other = (ProjectDescriptor)getContext().getProperty( key
);
           if( null != other )
           {
               final String message =
  @@ -95,9 +94,8 @@
   
           final String uri = m_location.getAbsolutePath();
           final ProjectDescriptor descriptor = new ProjectDescriptor( uri, m_type );
  -        final ProjectRef ref = new ProjectRef( m_name, descriptor );
   
  -        getContext().setProperty( key, ref );
  +        getContext().setProperty( key, descriptor );
       }
   
       private void validate() 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