ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce P4Add.java P4Base.java P4Change.java P4Counter.java P4Delete.java P4Edit.java P4Label.java P4Reopen.java P4Revert.java P4Submit.java P4Sync.java
Date Sun, 23 Jun 2002 06:04:20 GMT
stevel      2002/06/22 23:04:19

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/perforce
                        Tag: ANT_15_BRANCH P4Add.java P4Base.java
                        P4Change.java P4Counter.java P4Delete.java
                        P4Edit.java P4Label.java P4Reopen.java
                        P4Revert.java P4Submit.java P4Sync.java
  Log:
  the P4 set. I'm reverting erik's 'ignore' rating because the taskdefs for the tasks were
in the perforce.html man page; people could have used them even if they were (accidentally?)
left out of build.properties
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.1   +16 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java
  
  Index: P4Add.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- P4Add.java	12 Apr 2002 13:44:36 -0000	1.7
  +++ P4Add.java	23 Jun 2002 06:04:19 -0000	1.7.2.1
  @@ -68,7 +68,7 @@
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.types.FileSet;
   
  -/** P4Add  - add the specified files to perforce.
  +/** P4Add  - add specified files to Perforce.
    *
    * <b>Example Usage:</b>
    * <table border="1">
  @@ -88,6 +88,13 @@
       private Vector filesets = new Vector();
       private int cmdLength = 450;
   
  +    /**
  +     *   positive integer specifying the maximum length
  +     *   of the commandline when calling Perforce to add the files. 
  +     *   Defaults to 450, higher values mean faster execution,
  +     *   but also possible failures.
  +     */
  +     
       public void setCommandlength(int len) throws BuildException {
           if (len <= 0) {
               throw new BuildException("P4Add: Commandlength should be a positive number");
  @@ -95,6 +102,11 @@
           this.cmdLength = len;
       }
   
  +    /**
  +     * If specified the open files are associated with the
  +     * specified pending changelist number; otherwise the open files are
  +     * associated with the default changelist.
  +     */
       public void setChangelist(int changelist) throws BuildException {
           if (changelist <= 0) {
               throw new BuildException("P4Add: Changelist# should be a positive number");
  @@ -103,6 +115,9 @@
           this.changelist = changelist;
       }
   
  +    /**
  +     * files to add
  +     */
       public void addFileset(FileSet set) {
           filesets.addElement(set);
       }
  
  
  
  1.15.2.1  +23 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
  
  Index: P4Base.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- P4Base.java	25 Apr 2002 16:30:28 -0000	1.15
  +++ P4Base.java	23 Jun 2002 06:04:19 -0000	1.15.2.1
  @@ -109,28 +109,50 @@
       protected String P4CmdOpts = "";
   
       //Setters called by Ant
  +    
  +    /**
  +     * The p4d server and port to connect to;
  +     * optional, default "perforce:1666"
  +     */
       public void setPort(String P4Port) {
           this.P4Port = "-p" + P4Port;
       }
   
  +    /**
  +     * The p4 client spec to use;
  +     * optional, defaults to the current user
  +     */
       public void setClient(String P4Client) {
           this.P4Client = "-c" + P4Client;
       }
   
  +    /**
  +     * The p4 username;
  +     * optional, defaults to the current user
  +     */
       public void setUser(String P4User) {
           this.P4User = "-u" + P4User;
       }
   
  +    /**
  +     * The client, branch or label view to operate upon;
  +     * optional default "//..."
  +     */
       public void setView(String P4View) {
           this.P4View = P4View;
       }
   
  +    /**
  +     * Set extra command options; only used on some
  +     * of the Perforce tasks.
  +     */ 
       public void setCmdopts(String P4CmdOpts) {
           this.P4CmdOpts = P4CmdOpts;
       }
   
       /**
  -     * Optionally throw a BuildException if p4 command fails
  +     * whether to stop the build (true, default) 
  +     * or keep going if an error is returned from the p4 command
        */
       public void setFailonerror(boolean fail) {
           failOnError = fail;
  
  
  
  1.11.2.1  +10 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Change.java
  
  Index: P4Change.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Change.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- P4Change.java	12 Apr 2002 13:44:36 -0000	1.11
  +++ P4Change.java	23 Jun 2002 06:04:19 -0000	1.11.2.1
  @@ -62,11 +62,12 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   
  -/** P4Change - grab a new changelist from Perforce.
  - *
  +/** 
  + * Request a new changelist from the Perforce server. 
    * P4Change creates a new changelist in perforce. P4Change sets the property
    * ${p4.change} with the new changelist number. This should then be passed into
    * p4edit and p4submit.
  + * 
    *
    * @see P4Edit
    * @see P4Submit
  @@ -78,6 +79,9 @@
       protected String emptyChangeList = null;
       protected String description = "AutoSubmit By Ant";
   
  +    /**
  +     * throw all immutability rules to the wind
  +     */
       public void execute() throws BuildException {
   
           if (emptyChangeList == null) {
  @@ -162,7 +166,10 @@
           return buf.toString();
       }
   
  -    /* Set Description Variable. */
  +    /**
  +     * Description for ChangeList;optional.
  +     * If none is specified, it will default to "AutoSubmit By Ant"
  +     */
       public void setDescription(String desc) {
           this.description = desc;
       }
  
  
  
  1.6.2.1   +27 -7     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java
  
  Index: P4Counter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Counter.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- P4Counter.java	12 Apr 2002 13:44:36 -0000	1.6
  +++ P4Counter.java	23 Jun 2002 06:04:19 -0000	1.6.2.1
  @@ -62,13 +62,21 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
   
  -/** P4Counter - Obtain or set the value of a counter.
  - * P4Counter can be used to either print the value of a counter
  - * to the output stream for the project (by setting the "name"
  - * attribute only), to set a property based on the value of
  - * a counter (by setting the "property" attribute) or to set the counter
  - * on the perforce server (by setting the "value" attribute).
  - *
  +/** 
  + * Obtain or set the value of a counter.
  + * <p> When used in its base form
  + * (where only the counter name is provided), the counter value will be
  + * printed to the output stream. When the value is provided, the counter
  + * will be set to the value provided. When a property name is provided,
  + * the property will be filled with the value of the counter. You may
  + * not specify to both get and set the value of the counter in the same
  + * Task.
  + * </p>
  + * <P>
  + * The user performing this task must have Perforce &quot;review&quot; permissions
  + * as defined by Perforce protections in order for this task to succeed.
  +</P>
  + 
    * Example Usage:<br>
    * &lt;p4counter name="${p4.counter}" property=${p4.change}"/&gt;
    * @author <a href="mailto:kirk@radik.com">Kirk Wylie</a>
  @@ -81,20 +89,32 @@
       public boolean shouldSetProperty = false;
       public int value = 0;
   
  +    /**
  +     * The name of the counter; required
  +     */
       public void setName(String counter) {
           this.counter = counter;
       }
   
  +    /**
  +     * The new value for the counter; optional.
  +     */
       public void setValue(int value) {
           this.value = value;
           shouldSetValue = true;
       }
   
  +    /**
  +     * A property to be set with the value of the counter
  +     */
       public void setProperty(String property) {
           this.property = property;
           shouldSetProperty = true;
       }
   
  +    /**
  +     * again, properties are mutable in this tsk
  +     */
       public void execute() throws BuildException {
   
           if ((counter == null) || counter.length() == 0) {
  
  
  
  1.5.2.2   +7 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Delete.java
  
  Index: P4Delete.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Delete.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- P4Delete.java	22 Jun 2002 23:25:26 -0000	1.5.2.1
  +++ P4Delete.java	23 Jun 2002 06:04:19 -0000	1.5.2.2
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -55,14 +55,14 @@
   
   import org.apache.tools.ant.BuildException;
   
  -/** P4Delete - checkout file(s) for delete.
  +/** P4Delete - checkout file(s) for deletion.
    *
    * Example Usage:<br>
    * &lt;p4delete change="${p4.change}" view="//depot/project/foo.txt" /&gt;<br>
    *
    * Simple re-write of P4Edit changing 'edit' to 'delete'.<br>
    *
  - * ToDo: What to do if file is already open in one of our changelists perhaps
  + * @todo: What to do if file is already open in one of our changelists perhaps
    * (See also {@link P4Edit P4Edit})?<br>
    *
    * @author <A HREF="mailto:mike@tmorph.com">Mike Roberts</A>, <A HREF="mailto:leslie.hughes@rubus.com">Les
Hughes</A>
  @@ -72,6 +72,10 @@
   
       public String change = null;
   
  +    /**
  +     * An existing changelist number for the deletion; optional
  +     * but strongly recommended.
  +     */    
       public void setChange(String change) {
           this.change = change;
       }
  
  
  
  1.9.2.1   +11 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java
  
  Index: P4Edit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- P4Edit.java	12 Apr 2002 13:44:36 -0000	1.9
  +++ P4Edit.java	23 Jun 2002 06:04:19 -0000	1.9.2.1
  @@ -61,19 +61,27 @@
   
   import org.apache.tools.ant.BuildException;
   
  -/** P4Edit - checkout file(s) for edit.
  - *
  +/** 
  + * Open file(s) for edit. 
  + * P4Change should be used to obtain a new changelist for P4Edit as,
  + * although P4Edit can open files to the default change,  
  + * P4Submit cannot yet submit to it.
    * Example Usage:<br>
    * &lt;p4edit change="${p4.change}" view="//depot/project/foo.txt" /&gt;
  + * 
    * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A>
    *
  - * ToDo: Should call reopen if file is already open in one of our changelists perhaps?
  + * @todo Should call reopen if file is already open in one of our changelists perhaps?
    */
   
   public class P4Edit extends P4Base {
   
       public String change = null;
   
  +    /**
  +     * An existing changelist number to assign files to; optional
  +     * but strongly recommended.
  +     */
       public void setChange(String change) {
           this.change = change;
       }
  
  
  
  1.10.2.1  +15 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java
  
  Index: P4Label.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Label.java,v
  retrieving revision 1.10
  retrieving revision 1.10.2.1
  diff -u -r1.10 -r1.10.2.1
  --- P4Label.java	12 Apr 2002 13:44:36 -0000	1.10
  +++ P4Label.java	23 Jun 2002 06:04:19 -0000	1.10.2.1
  @@ -66,10 +66,10 @@
   import org.apache.tools.ant.Project;
   
   
  -/** P4Label - create a Perforce Label.
  +/** 
    *
  - *  P4Label inserts a label into perforce reflecting the
  - *  current client contents.
  + *  Create a new Perforce label and set contents to reflect current 
  + *  client file revisions.
    *
    *  Label name defaults to AntLabel if none set.
    *
  @@ -86,18 +86,30 @@
       protected String desc;
       protected String lock;
   
  +    /**
  +     * The name of the label; optional, default "AntLabel"
  +     */
       public void setName(String name) {
           this.name = name;
       }
   
  +    /**
  +     *Label Description; optional
  +     */
       public void setDesc(String desc) {
           this.desc = desc;
       }
   
  +    /**
  +     * when set to "locked", Perforce will lock the label once created; optional. 
  +     */
       public void setLock(String lock) {
           this.lock = lock;
       }
   
  +    /**
  +     *  do the work
  +     */
       public void execute() throws BuildException {
           log("P4Label exec:", Project.MSG_INFO);
   
  
  
  
  1.7.2.2   +5 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java
  
  Index: P4Reopen.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Reopen.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- P4Reopen.java	22 Jun 2002 23:25:26 -0000	1.7.2.1
  +++ P4Reopen.java	23 Jun 2002 06:04:19 -0000	1.7.2.2
  @@ -61,15 +61,18 @@
   
   import org.apache.tools.ant.BuildException;
   
  -/** P4Reopen - move files to a new changelist
  +/* 
  + * Move (or reopen in Perforce speak) checkout files between changelists.
    *
    * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A>
  - * @ant.task ignore="true"
    */
   public class P4Reopen extends P4Base {
   
       private String toChange = "";
   
  +    /**
  +     * The changelist to move files to; required.
  +     */
       public void setToChange(String toChange) throws BuildException {
           if (toChange == null && !toChange.equals("")) {
               throw new BuildException("P4Reopen: tochange cannot be null or empty");
  
  
  
  1.7.2.2   +8 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Revert.java
  
  Index: P4Revert.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Revert.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- P4Revert.java	22 Jun 2002 23:25:26 -0000	1.7.2.1
  +++ P4Revert.java	23 Jun 2002 06:04:19 -0000	1.7.2.2
  @@ -61,16 +61,19 @@
   
   import org.apache.tools.ant.BuildException;
   
  -/** P4Revert - revert open files or files in a changelist
  +/* 
  + * Revert open files or files in a changelist
    *
    * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A>
  - * @ant.task ignore="true"
    */
   public class P4Revert extends P4Base {
   
       private String revertChange = null;
       private boolean onlyUnchanged = false;
   
  +    /**
  +     * The changelist to revert; optional.
  +     */
       public void setChange(String revertChange) throws BuildException {
           if (revertChange == null && !revertChange.equals("")) {
               throw new BuildException("P4Revert: change cannot be null or empty");
  @@ -80,6 +83,9 @@
   
       }
   
  +    /**
  +     * flag to revert only unchanged files (p4 revert -a); optional, default false.
  +     */
       public void setRevertOnlyUnchanged(boolean onlyUnchanged) {
           this.onlyUnchanged = onlyUnchanged;
       }
  
  
  
  1.9.2.1   +4 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java
  
  Index: P4Submit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- P4Submit.java	15 Apr 2002 12:11:49 -0000	1.9
  +++ P4Submit.java	23 Jun 2002 06:04:19 -0000	1.9.2.1
  @@ -65,7 +65,7 @@
   /** P4Submit - submit a numbered changelist to Perforce.
    *
    * <B>Note:</B> P4Submit cannot (yet) submit the default changelist.
  - * This shouldn't be a problem with the ANT API as the usual flow is
  + * This shouldn't be a problem with the ANT task as the usual flow is
    * P4Change to create a new numbered change followed by P4Edit then P4Submit.
    *
    * Example Usage:-<br>
  @@ -79,6 +79,9 @@
       //ToDo: If dealing with default cl need to parse out <enter description here>
       public String change;
   
  +    /**
  +     * The changelist number to submit; required.
  +     */
       public void setChange(String change) {
           this.change = change;
       }
  
  
  
  1.8.2.1   +6 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java
  
  Index: P4Sync.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- P4Sync.java	12 Apr 2002 13:44:36 -0000	1.8
  +++ P4Sync.java	23 Jun 2002 06:04:19 -0000	1.8.2.1
  @@ -84,6 +84,9 @@
       String label;
       private String syncCmd = "";
   
  +    /**
  +     * Label to sync client to; optional.
  +     */
       public void setLabel(String label) throws BuildException {
           if (label == null && !label.equals("")) {
               throw new BuildException("P4Sync: Labels cannot be Null or Empty");
  @@ -94,6 +97,9 @@
       }
   
   
  +    /**
  +     * force a refresh of files, if this attribute is set; false by default.
  +     */
       public void setForce(String force) throws BuildException {
           if (force == null && !label.equals("")) {
               throw new BuildException("P4Sync: If you want to force, set force to non-null
string!");
  
  
  

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