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 EmbeddedAnt.java
Date Tue, 02 Jul 2002 03:30:57 GMT
adammurdoch    2002/07/01 20:30:57

  Modified:    container/src/java/org/apache/myrmidon/frontends
                        CLIMain.java Resources.properties
               container/src/java/org/apache/myrmidon/interfaces
                        EmbeddedAnt.java
  Log:
  - Changed frontend back, so that it executes each target given on the
    command-line in it's own separate workspace.
  - Added -r/--reuse option, which executes all of the targets given
    on the command-line in the same workspace.
  
  Revision  Changes    Path
  1.52      +11 -2     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/CLIMain.java
  
  Index: CLIMain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/CLIMain.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- CLIMain.java	17 Jun 2002 00:15:56 -0000	1.51
  +++ CLIMain.java	2 Jul 2002 03:30:57 -0000	1.52
  @@ -60,6 +60,7 @@
       private static final int NO_PREFIX_OPT = 'p';
       private static final int GUI_OPT = 'g';
       private static final int SERVICE_PARAM_OPT = 'S';
  +    private static final int REUSE_WORKSPACE_OPT = 'r';
       private static final int VERSION_OPT = 1;
       private static final int LISTENER_OPT = 2;
       private static final int LISTENER_CONFIG_OPT = 3;
  @@ -77,7 +78,7 @@
           HELP_OPT, QUIET_OPT, VERBOSE_OPT, FILE_OPT,
           LOG_LEVEL_OPT, LISTENER_PARAM_OPT,
           NO_PREFIX_OPT, SERVICE_PARAM_OPT, VERSION_OPT, LISTENER_OPT,
  -        LISTENER_CONFIG_OPT, EXTLIB_DIR_OPT, INCREMENTAL_OPT,
  +        REUSE_WORKSPACE_OPT, LISTENER_CONFIG_OPT, EXTLIB_DIR_OPT, INCREMENTAL_OPT,
           HOME_DIR_OPT, DRY_RUN_OPT, TYPE_OPT, BANNER_OPT
       };
   
  @@ -257,6 +258,10 @@
                                       CLOptionDescriptor.ARGUMENTS_REQUIRED_2 | CLOptionDescriptor.DUPLICATES_ALLOWED,
                                       SERVICE_PARAM_OPT,
                                       REZ.getString( "serviceparam.opt" ) ),
  +            new CLOptionDescriptor( "reuse",
  +                                    CLOptionDescriptor.ARGUMENT_DISALLOWED,
  +                                    REUSE_WORKSPACE_OPT,
  +                                    REZ.getString( "reuse.opt" ) ),
               new CLOptionDescriptor( "dryrun",
                                       CLOptionDescriptor.ARGUMENT_DISALLOWED,
                                       DRY_RUN_OPT,
  @@ -328,6 +333,10 @@
                       break;
                   case QUIET_OPT:
                       m_priority = BasicLogger.LEVEL_ERROR;
  +                    break;
  +
  +                case REUSE_WORKSPACE_OPT:
  +                    m_embedded.setReuseWorkspace( true );
                       break;
   
                   case INCREMENTAL_OPT:
  
  
  
  1.16      +1 -0      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/Resources.properties,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Resources.properties	17 Jun 2002 00:15:56 -0000	1.15
  +++ Resources.properties	2 Jul 2002 03:30:57 -0000	1.16
  @@ -21,6 +21,7 @@
   dry-run.opt=Do not execute tasks - just print them out.
   gui.opt=Run the GUI frontend.
   type.opt=Specify the project file type.
  +reuse.opt=Execute each target in the same workspace.
   
   file-no-exist.error={0} {1} does not exist.
   file-not-dir.error={0} {1} is not a directory.
  
  
  
  1.34      +24 -3     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java
  
  Index: EmbeddedAnt.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- EmbeddedAnt.java	2 Jul 2002 02:18:09 -0000	1.33
  +++ EmbeddedAnt.java	2 Jul 2002 03:30:57 -0000	1.34
  @@ -58,6 +58,7 @@
       private Embeddor m_embeddor;
       private File m_homeDir;
       private ClassLoader m_containerClassLoader;
  +    private boolean m_reuse;
   
       /**
        * Sets the Myrmidon home directory.  Default is to use the current
  @@ -134,6 +135,16 @@
       }
   
       /**
  +     * Controls whether all targets are executed in a single workspace, or
  +     * whether each target is executed in its own workspace.  The default
  +     * is to not reuse the workspace.
  +     */
  +    public void setReuseWorkspace( final boolean reuse )
  +    {
  +        m_reuse = reuse;
  +    }
  +
  +    /**
        * Executes a set of targets in the project.  This method may be called
        * multiple times.
        */
  @@ -187,7 +198,18 @@
                                    final String[] targets )
           throws TaskException
       {
  -        m_embeddor.execute( frame, descriptor, targets );
  +        if( m_reuse || targets == null || targets.length == 0 )
  +        {
  +            m_embeddor.execute( frame, descriptor, targets );
  +        }
  +        else
  +        {
  +            for( int i = 0; i < targets.length; i++ )
  +            {
  +                final String target = targets[ i ];
  +                m_embeddor.execute( frame, descriptor, new String[] { target } );
  +            }
  +        }
       }
   
       /**
  @@ -397,5 +419,4 @@
               throw new Exception( message );
           }
       }
  -
   }
  
  
  

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