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/proposal/myrmidon/src/java/org/apache/myrmidon/frontends CLIMain.java
Date Tue, 12 Jun 2001 14:01:58 GMT
donaldp     01/06/12 07:01:58

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/frontends
                        CLIMain.java
  Log:
  Update to work with new embeddor interface.
  
  Revision  Changes    Path
  1.3       +10 -23    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java
  
  Index: CLIMain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/frontends/CLIMain.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CLIMain.java	2001/06/05 04:34:01	1.2
  +++ CLIMain.java	2001/06/12 14:01:57	1.3
  @@ -90,7 +90,7 @@
       private ArrayList            m_targets     = new ArrayList();
   
       ///List of user supplied defines
  -    private HashMap              m_defines     = new HashMap();
  +    private Parameters           m_defines     = new Parameters();
   
       /**
        * Main entry point called to run standard Myrmidon.
  @@ -240,7 +240,7 @@
               case LISTENER_OPT: m_parameters.setParameter( "listener", option.getArgument()
); break;
   
               case DEFINE_OPT:
  -                m_defines.put( option.getArgument( 0 ), option.getArgument( 1 ) );
  +                m_defines.setParameter( option.getArgument( 0 ), option.getArgument( 1
) );
                   break;
   
               case 0: m_targets.add( option.getArgument() ); break;
  @@ -308,13 +308,9 @@
           embeddor.initialize();
           embeddor.start();
   
  -        final ProjectBuilder builder = embeddor.getProjectBuilder();
  -
           //create the project
  -        final Project project = builder.build( buildFile );
  -
  -        final ProjectManager manager = embeddor.getProjectManager();
  -        manager.addProjectListener( listener );
  +        final Project project = 
  +            embeddor.createProject( buildFile.toString(), null, null );
   
           BufferedReader reader = null;
   
  @@ -323,19 +319,11 @@
           while( true )
           {
               //actually do the build ...
  -            final TaskContext context = new DefaultTaskContext();
  -
  -            //Add CLI m_defines
  -            addToContext( context, m_defines );
  -
  -            //Add system properties second so that they overide user-defined properties
  -            addToContext( context, System.getProperties() );
  -
  -            context.setProperty( TaskContext.BASE_DIRECTORY, project.getBaseDirectory()
);
  -            context.setProperty( Project.PROJECT_FILE, buildFile );
  -            //context.setProperty( Project.PROJECT, project.getName() );
  +            final ProjectManager manager = 
  +                embeddor.createProjectManager( project, m_defines );
  +            manager.addProjectListener( listener );
   
  -            doBuild( manager, project, context, m_targets );
  +            doBuild( manager, project, m_targets );
   
               if( !incremental ) break;
   
  @@ -365,7 +353,6 @@
        */
       private void doBuild( final ProjectManager manager,
                             final Project project,
  -                          final TaskContext context,
                             final ArrayList targets )
       {
           try
  @@ -375,13 +362,13 @@
               //if we didn't specify a target on CLI then choose default
               if( 0 == targetCount )
               {
  -                manager.executeTarget( project, project.getDefaultTargetName(), context
);
  +                manager.executeProject( project, project.getDefaultTargetName() );
               }
               else
               {
                   for( int i = 0; i < targetCount; i++ )
                   {
  -                    manager.executeTarget( project, (String)targets.get( i ), context );
  +                    manager.executeProject( project, (String)targets.get( i ) );
                   }
               }
           }
  
  
  

Mime
View raw message