ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss MSVSS.java MSVSSGET.java MSVSSLABEL.java
Date Fri, 27 Jul 2001 08:43:26 GMT
bodewig     01/07/27 01:43:26

  Modified:    docs/manual/OptionalTasks vss.html
               src/main/org/apache/tools/ant/taskdefs/optional/vss
                        MSVSS.java MSVSSGET.java MSVSSLABEL.java
  Log:
  added autoresponse attribute to <vssget> and <vsslabel> as well as a quiet
  attribute to <vssget>.
  
  Submitted by:	Jon Skeet <jon.skeet@peramon.com>
  
  Note that I don't use VSS, so this patch has not been tested for
  functionality (it compiles and looks OK, that's all I can check).
  
  Revision  Changes    Path
  1.3       +17 -0     jakarta-ant/docs/manual/OptionalTasks/vss.html
  
  Index: vss.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/OptionalTasks/vss.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- vss.html	2001/05/03 07:11:24	1.2
  +++ vss.html	2001/07/27 08:43:26	1.3
  @@ -126,6 +126,17 @@
        <td>label</td>
        <td>a label to get for</td>
     </tr>
  +  <tr>
  +     <td>quiet</td>
  +     <td>suppress output (off by default)</td>
  +     <td>No</td>
  +  </tr>
  +  <tr>
  +     <td>autoresponse</td>
  +     <td>What to respond with (sets the -I option). By default, -I- is
  +     used; values of Y or N will be appended to this.</td>
  +     <td>No</td>
  +  </tr>
   </table>
   <p>Note that only one of version, date or label should be specified</p>
   <h3>Examples</h3>
  @@ -201,6 +212,12 @@
         <td>The comment to use for this label. Empty or '-' for no comment.</td>
         <td>No</td>
      </tr>
  +  <tr>
  +     <td>autoresponse</td>
  +     <td>What to respond with (sets the -I option). By default, -I- is
  +     used; values of Y or N will be appended to this.</td>
  +     <td>No</td>
  +  </tr>
   </table>
   <h3>Examples</h3>
   <blockquote>
  
  
  
  1.10      +2 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  
  Index: MSVSS.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MSVSS.java	2001/04/29 16:23:20	1.9
  +++ MSVSS.java	2001/07/27 08:43:26	1.10
  @@ -242,5 +242,7 @@
       public static final String VALUE_NO = "-N";
       /** */
       public static final String VALUE_YES = "-Y";
  +    /** */
  +    public static final String FLAG_QUIET = "-O-";
   }
   
  
  
  
  1.10      +34 -7     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java
  
  Index: MSVSSGET.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MSVSSGET.java	2001/06/25 07:46:50	1.9
  +++ MSVSSGET.java	2001/07/27 08:43:26	1.10
  @@ -74,42 +74,53 @@
    *      <td>login</td>
    *      <td>username,password</td>
    *      <td>No</td>
  + *   </tr>
    *   <tr>
  - *   <tr>
    *      <td>vsspath</td>
    *      <td>SourceSafe path</td>
    *      <td>Yes</td>
  - *   <tr>
  + *   </tr>
    *   <tr>
    *      <td>localpath</td>
    *      <td>Override the working directory and get to the specified path</td>
    *      <td>No</td>
  + *   </tr>
    *   <tr>
  - *   <tr>
    *      <td>writable</td>
    *      <td>true or false</td>
    *      <td>No</td>
  - *   <tr>
  + *   </tr>
    *   <tr>
    *      <td>recursive</td>
    *      <td>true or false</td>
    *      <td>No</td>
  + *   </tr>
    *   <tr>
  - *   <tr>
    *      <td>version</td>
    *      <td>a version number to get</td>
    *      <td>No</td>
  - *   <tr>
  + *   </tr>
    *   <tr>
    *      <td>date</td>
    *      <td>a date stamp to get at</td>
    *      <td>No</td>
  + *   </tr>
    *   <tr>
  - *   <tr>
    *      <td>label</td>
    *      <td>a label to get for</td>
    *      <td>No</td>
  + *   </tr>
    *   <tr>
  + *      <td>quiet</td>
  + *      <td>suppress output (off by default)</td>
  + *      <td>No</td>
  + *   </tr>
  + *   <tr>
  + *      <td>autoresponse</td>
  + *      <td>What to respond with (sets the -I option). By default, -I- is
  + *      used; values of Y or N will be appended to this.</td>
  + *      <td>No</td>
  + *   </tr>
    * </table>
    * <p>Note that only one of version, date or label should be specified</p>
    *
  @@ -125,6 +136,7 @@
       private String m_Date = null;
       private String m_Label = null;
       private String m_AutoResponse = null;
  +    private boolean m_Quiet = false;
   
       /**
        * Executes the task.
  @@ -156,6 +168,8 @@
           getLocalpathCommand(commandLine);
           // -I- or -I-Y or -I-N
           getAutoresponse(commandLine);
  +        // -O-
  +        getQuietCommand(commandLine);
           // -R
           getRecursiveCommand(commandLine);
           // -V
  @@ -222,6 +236,19 @@
           }
       }
   
  +    /**
  +     * Sets/clears quiet mode
  +     */
  +    public final void setQuiet (boolean quiet) {
  +        this.m_Quiet=quiet;
  +    }
  +    
  +    public void getQuietCommand (Commandline cmd) {
  +        if (m_Quiet) {
  +            cmd.createArgument().setValue (FLAG_QUIET);
  +        }
  +    }
  +    
       /**
        * Set behaviour, used in get command to make files that are 'got' writable
        */
  
  
  
  1.3       +44 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java
  
  Index: MSVSSLABEL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSLABEL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MSVSSLABEL.java	2001/04/29 16:13:53	1.2
  +++ MSVSSLABEL.java	2001/07/27 08:43:26	1.3
  @@ -93,13 +93,25 @@
    *      <td>An existing file or project version to label</td>
    *      <td>No</td>
    *   </tr>
  + *   <tr>
  + *      <td>autoresponse</td>
  + *      <td>What to respond with (sets the -I option). By default, -I- is
  + *      used; values of Y or N will be appended to this.</td>
  + *      <td>No</td>
  + *   </tr>
  + *   <tr>
  + *      <td>comment</td>
  + *      <td>The comment to use for this label. Empty or '-' for no comment.</td>
  + *      <td>No</td>
  + *   </tr>
  + *      
    * </table>
    *
    * @author Phillip Wells
    */
   public class MSVSSLABEL extends MSVSS
   {
  -
  +    private String m_AutoResponse = null;
       private String m_Label = null;
       private String m_Version = null;
       private String m_Comment = "-";
  @@ -140,8 +152,8 @@
           // -C
           commandLine.createArgument().setValue("-C"+getComment());
   
  -        // -I-
  -        commandLine.createArgument().setValue("-I-");  // ignore all errors
  +        // -I- or -I-Y or -I-N
  +        getAutoresponse(commandLine);
   
           // -L
           // Specify the new label on the command line (instead of being prompted)
  @@ -242,5 +254,34 @@
        */
       public String getComment() {
           return m_Comment;
  +    }
  +    
  +    public void setAutoresponse(String response){
  +        if ( response.equals("") || response.equals("null") ) {
  +            m_AutoResponse = null;
  +        } else {
  +            m_AutoResponse = response;
  +        }
  +    }
  +    
  +    /**
  +     * Checks the value set for the autoResponse.
  +     * if it equals "Y" then we return -I-Y
  +     * if it equals "N" then we return -I-N
  +     * otherwise we return -I
  +     */
  +    public void getAutoresponse(Commandline cmd) {
  +        
  +        if ( m_AutoResponse == null) {
  +            cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
  +        } else if ( m_AutoResponse.equalsIgnoreCase("Y")) {
  +            cmd.createArgument().setValue(FLAG_AUTORESPONSE_YES);
  +            
  +        } else if ( m_AutoResponse.equalsIgnoreCase("N")) {
  +            cmd.createArgument().setValue(FLAG_AUTORESPONSE_NO);
  +        }else {
  +            cmd.createArgument().setValue(FLAG_AUTORESPONSE_DEF);
  +        } // end of else
  +
       }
   }
  
  
  

Mime
View raw message