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/container/src/java/org/apache/myrmidon/components/builder DefaultProjectBuilder.java
Date Thu, 23 May 2002 05:02:54 GMT
donaldp     02/05/22 22:02:54

  Modified:    container/src/java/org/apache/myrmidon/components/builder
                        DefaultProjectBuilder.java
  Log:
  Remove a few layers in building
  
  Revision  Changes    Path
  1.61      +6 -33     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
  
  Index: DefaultProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- DefaultProjectBuilder.java	23 May 2002 05:01:37 -0000	1.60
  +++ DefaultProjectBuilder.java	23 May 2002 05:02:54 -0000	1.61
  @@ -11,7 +11,6 @@
   import java.io.IOException;
   import java.net.MalformedURLException;
   import java.net.URL;
  -import java.util.ArrayList;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.excalibur.io.FileUtil;
  @@ -33,7 +32,7 @@
    * Default implementation to construct project from a build file.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.60 $ $Date: 2002/05/23 05:01:37 $
  + * @version $Revision: 1.61 $ $Date: 2002/05/23 05:02:54 $
    *
    * @ant.type type="project-builder" name="ant2"
    */
  @@ -307,7 +306,9 @@
                                          final ModelElement model )
           throws Exception
       {
  -        final ArrayList implicitTaskList = new ArrayList();
  +        final ModelElement implicit = new ModelElement( "target",  model.getLocation()
);
  +        implicit.setAttribute( "name", "<init>" );
  +
           final ModelElement[] children = model.getChildren();
   
           int state = PROJECT_REFERENCES;
  @@ -335,7 +336,7 @@
                   //Check for any implicit tasks here
                   if( !name.equals( "target" ) )
                   {
  -                    implicitTaskList.add( element );
  +                    implicit.addChild( element );
                       continue;
                   }
                   else
  @@ -357,13 +358,7 @@
               }
           }
   
  -        final ModelElement[] implicitTasks =
  -            (ModelElement[])implicitTaskList.toArray( new ModelElement[ implicitTaskList.size()
] );
  -        final ModelElement target = new ModelElement( "target",  model.getLocation() );
  -        target.setAttribute( "name", "<init>" );
  -        target.addChildren( implicitTasks );
  -
  -        project.setImplicitTarget( new Target( target ) );
  +        project.setImplicitTarget( new Target( implicit ) );
       }
   
       private void buildProjectRef( final DefaultProject project,
  @@ -457,27 +452,5 @@
           }
   
           project.addTarget( name, new Target( target ) );
  -    }
  -
  -    private void verifyTargetName( final String name, final ModelElement target )
  -        throws ProjectException
  -    {
  -        if( null == name )
  -        {
  -            final String message =
  -                REZ.getString( "ant.target-noname.error", target.getLocation() );
  -            throw new ProjectException( message );
  -        }
  -
  -        try
  -        {
  -            m_nameValidator.validate( name );
  -        }
  -        catch( Exception e )
  -        {
  -            final String message =
  -                REZ.getString( "ant.target-bad-name.error", target.getLocation() );
  -            throw new ProjectException( message, e );
  -        }
       }
   }
  
  
  

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