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/framework/src/java/org/apache/myrmidon/framework ExecuteTarget.java
Date Tue, 11 Jun 2002 04:00:56 GMT
donaldp     2002/06/10 21:00:56

  Modified:    container/src/java/org/apache/myrmidon/interfaces/oldmodel
                        Project.java
               framework/src/java/org/apache/myrmidon/framework
                        ExecuteTarget.java
  Log:
  Project allows you to get default target name and then lookup target ratehr than having
two lookup mewthods
  
  Revision  Changes    Path
  1.20      +14 -6     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/Project.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Project.java	11 Jun 2002 03:07:27 -0000	1.19
  +++ Project.java	11 Jun 2002 04:00:55 -0000	1.20
  @@ -8,12 +8,10 @@
   package org.apache.myrmidon.interfaces.oldmodel;
   
   import java.io.File;
  -import org.apache.myrmidon.interfaces.model.Module;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  -import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  -import org.apache.myrmidon.interfaces.workspace.ProjectRef;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.metadata.ModelElement;
  +import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  +import org.apache.myrmidon.interfaces.workspace.ProjectRef;
   
   /**
    * Abstraction used to interact with projects.
  @@ -23,7 +21,6 @@
    * @version $Revision$ $Date$
    */
   public interface Project
  -    extends Module
   {
       /** Role name for this interface. */
       String ROLE = Project.class.getName();
  @@ -50,6 +47,8 @@
        */
       ProjectRef getProjectRef( String name );
   
  +    ProjectRef[] getProjectRefs();
  +
       /**
        * Return the default target name for this project.
        *
  @@ -75,4 +74,13 @@
        * @return the projects base directory
        */
       File getBaseDirectory();
  +
  +    /**
  +     * Retrieve MetaData associated with Module.
  +     * The primary purpose of the MetaData is to
  +     * enable a decent UI to run the Module.
  +     *
  +     * @return the MetaData for Module
  +     */
  +    TargetMetaData getMetaData();
   }
  
  
  
  1.15      +10 -25    jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/ExecuteTarget.java
  
  Index: ExecuteTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/ExecuteTarget.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ExecuteTarget.java	11 Jun 2002 03:07:27 -0000	1.14
  +++ ExecuteTarget.java	11 Jun 2002 04:00:55 -0000	1.15
  @@ -17,7 +17,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.interfaces.embeddor.Embeddor;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  -import org.apache.myrmidon.interfaces.model.TargetMetaData;
  +import org.apache.myrmidon.interfaces.oldmodel.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
   import org.apache.myrmidon.interfaces.oldmodel.ProjectHelper;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  @@ -105,9 +105,13 @@
           final Project project = buildProject( embeddor );
           final Map properties = buildParameters( context );
   
  -        final TargetMetaData projectMetaData = project.getMetaData();
  -        final TargetMetaData target = getTarget( projectMetaData );
  +        String targetName = m_target;
  +        if( null == targetName )
  +        {
  +            targetName = project.getDefaultTargetName();
  +        }
   
  +        final TargetMetaData target = project.getTarget( targetName );
           try
           {
               // TODO - need to be able to inherit services (TypeManager specifically)
  @@ -120,30 +124,11 @@
           catch( final Exception e )
           {
               final String message =
  -                REZ.getString( "execute-target.execute.error",
  -                               projectMetaData.getName(),
  +                REZ.getString( "execute-targetName.execute.error",
  +                               project.getProjectName(),
                                  target.getName() );
               throw new TaskException( message, e );
           }
  -    }
  -
  -    private TargetMetaData getTarget( final TargetMetaData projectMetaData )
  -    {
  -        TargetMetaData target = projectMetaData;
  -        if( null != m_target )
  -        {
  -            final TargetMetaData[] targets = target.getTargets();
  -            for( int i = 0; i < targets.length; i++ )
  -            {
  -                final TargetMetaData candidate = targets[ i ];
  -                if( m_target.equals( candidate.getName() ) )
  -                {
  -                    target = candidate;
  -                    break;
  -                }
  -            }
  -        }
  -        return target;
       }
   
       /**
  
  
  

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