git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273975 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -51,7 +51,7 @@ | |||||
| * information on the Apache Software Foundation, please see | * information on the Apache Software Foundation, please see | ||||
| * <http://www.apache.org/>. | * <http://www.apache.org/>. | ||||
| */ | */ | ||||
| /* | |||||
| /* | |||||
| * Portions of this software are based upon public domain software | * Portions of this software are based upon public domain software | ||||
| * originally written at the National Center for Supercomputing Applications, | * originally written at the National Center for Supercomputing Applications, | ||||
| * University of Illinois, Urbana-Champaign. | * University of Illinois, Urbana-Champaign. | ||||
| @@ -79,6 +79,8 @@ import org.apache.tools.ant.types.FileSet; | |||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * @author <A HREF="mailto:ashundi@tibco.com">Anli Shundi</A> | * @author <A HREF="mailto:ashundi@tibco.com">Anli Shundi</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Add extends P4Base { | public class P4Add extends P4Base { | ||||
| @@ -89,11 +91,11 @@ public class P4Add extends P4Base { | |||||
| /** | /** | ||||
| * positive integer specifying the maximum length | * positive integer specifying the maximum length | ||||
| * of the commandline when calling Perforce to add the files. | |||||
| * of the commandline when calling Perforce to add the files. | |||||
| * Defaults to 450, higher values mean faster execution, | * Defaults to 450, higher values mean faster execution, | ||||
| * but also possible failures. | * but also possible failures. | ||||
| */ | */ | ||||
| public void setCommandlength(int len) throws BuildException { | public void setCommandlength(int len) throws BuildException { | ||||
| if (len <= 0) { | if (len <= 0) { | ||||
| throw new BuildException("P4Add: Commandlength should be a positive number"); | throw new BuildException("P4Add: Commandlength should be a positive number"); | ||||
| @@ -108,7 +108,7 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| protected String P4CmdOpts = ""; | protected String P4CmdOpts = ""; | ||||
| //Setters called by Ant | //Setters called by Ant | ||||
| /** | /** | ||||
| * The p4d server and port to connect to; | * The p4d server and port to connect to; | ||||
| * optional, default "perforce:1666" | * optional, default "perforce:1666" | ||||
| @@ -152,13 +152,13 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| /** | /** | ||||
| * Set extra command options; only used on some | * Set extra command options; only used on some | ||||
| * of the Perforce tasks. | * of the Perforce tasks. | ||||
| */ | |||||
| */ | |||||
| public void setCmdopts(String P4CmdOpts) { | public void setCmdopts(String P4CmdOpts) { | ||||
| this.P4CmdOpts = P4CmdOpts; | this.P4CmdOpts = P4CmdOpts; | ||||
| } | } | ||||
| /** | /** | ||||
| * whether to stop the build (true, default) | |||||
| * whether to stop the build (true, default) | |||||
| * or keep going if an error is returned from the p4 command | * or keep going if an error is returned from the p4 command | ||||
| */ | */ | ||||
| public void setFailonerror(boolean fail) { | public void setFailonerror(boolean fail) { | ||||
| @@ -62,17 +62,18 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| /** | |||||
| /** | |||||
| * Requests a new changelist from the Perforce server. | * Requests a new changelist from the Perforce server. | ||||
| * P4Change creates a new changelist in perforce. P4Change sets the property | * P4Change creates a new changelist in perforce. P4Change sets the property | ||||
| * ${p4.change} with the new changelist number. This should then be passed into | * ${p4.change} with the new changelist number. This should then be passed into | ||||
| * p4edit and p4submit. | * p4edit and p4submit. | ||||
| * | |||||
| * | |||||
| * | * | ||||
| * @see P4Edit | * @see P4Edit | ||||
| * @see P4Submit | * @see P4Submit | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | * | ||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Change extends P4Base { | public class P4Change extends P4Base { | ||||
| @@ -62,7 +62,7 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| /** | |||||
| /** | |||||
| * Obtains or sets the value of a counter. | * Obtains or sets the value of a counter. | ||||
| * | * | ||||
| * <p> When used in its base form | * <p> When used in its base form | ||||
| @@ -77,10 +77,12 @@ import org.apache.tools.ant.Project; | |||||
| * The user performing this task must have Perforce "review" permissions | * The user performing this task must have Perforce "review" permissions | ||||
| * as defined by Perforce protections in order for this task to succeed. | * as defined by Perforce protections in order for this task to succeed. | ||||
| </P> | </P> | ||||
| * Example Usage:<br> | * Example Usage:<br> | ||||
| * <p4counter name="${p4.counter}" property=${p4.change}"/> | * <p4counter name="${p4.counter}" property=${p4.change}"/> | ||||
| * @author <a href="mailto:kirk@radik.com">Kirk Wylie</a> | * @author <a href="mailto:kirk@radik.com">Kirk Wylie</a> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Counter extends P4Base { | public class P4Counter extends P4Base { | ||||
| @@ -66,6 +66,8 @@ import org.apache.tools.ant.BuildException; | |||||
| * (See also {@link P4Edit P4Edit})?<br> | * (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> | * @author <A HREF="mailto:mike@tmorph.com">Mike Roberts</A>, <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Delete extends P4Base { | public class P4Delete extends P4Base { | ||||
| @@ -74,7 +76,7 @@ public class P4Delete extends P4Base { | |||||
| /** | /** | ||||
| * An existing changelist number for the deletion; optional | * An existing changelist number for the deletion; optional | ||||
| * but strongly recommended. | * but strongly recommended. | ||||
| */ | |||||
| */ | |||||
| public void setChange(String change) { | public void setChange(String change) { | ||||
| this.change = change; | this.change = change; | ||||
| } | } | ||||
| @@ -61,17 +61,19 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| /** | |||||
| * Open file(s) for edit. | |||||
| /** | |||||
| * Open file(s) for edit. | |||||
| * P4Change should be used to obtain a new changelist for P4Edit as, | * P4Change should be used to obtain a new changelist for P4Edit as, | ||||
| * although P4Edit can open files to the default change, | |||||
| * although P4Edit can open files to the default change, | |||||
| * P4Submit cannot yet submit to it. | * P4Submit cannot yet submit to it. | ||||
| * Example Usage:<br> | * Example Usage:<br> | ||||
| * <p4edit change="${p4.change}" view="//depot/project/foo.txt" /> | * <p4edit change="${p4.change}" view="//depot/project/foo.txt" /> | ||||
| * | |||||
| * | |||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @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? | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Edit extends P4Base { | public class P4Edit extends P4Base { | ||||
| @@ -67,6 +67,8 @@ import org.apache.tools.ant.BuildException; | |||||
| * P4Have simply dumps the current file version info into | * P4Have simply dumps the current file version info into | ||||
| * the Ant log (or stdout). | * the Ant log (or stdout). | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Have extends P4Base { | public class P4Have extends P4Base { | ||||
| @@ -77,6 +77,8 @@ import org.apache.tools.ant.util.StringUtils; | |||||
| * </pre> | * </pre> | ||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Label extends P4Base { | public class P4Label extends P4Base { | ||||
| @@ -120,7 +122,7 @@ public class P4Label extends P4Base { | |||||
| } | } | ||||
| if (desc == null || desc.length() < 1) { | if (desc == null || desc.length() < 1) { | ||||
| log("Label Description not set, assuming 'AntLabel'", | |||||
| log("Label Description not set, assuming 'AntLabel'", | |||||
| Project.MSG_WARN); | Project.MSG_WARN); | ||||
| desc = "AntLabel"; | desc = "AntLabel"; | ||||
| } | } | ||||
| @@ -130,7 +132,7 @@ public class P4Label extends P4Base { | |||||
| } | } | ||||
| if (name == null || name.length() < 1) { | if (name == null || name.length() < 1) { | ||||
| SimpleDateFormat formatter | |||||
| SimpleDateFormat formatter | |||||
| = new SimpleDateFormat("yyyy.MM.dd-hh:mm"); | = new SimpleDateFormat("yyyy.MM.dd-hh:mm"); | ||||
| Date now = new Date(); | Date now = new Date(); | ||||
| name = "AntLabel-" + formatter.format(now); | name = "AntLabel-" + formatter.format(now); | ||||
| @@ -162,7 +164,7 @@ public class P4Label extends P4Base { | |||||
| }); | }); | ||||
| log("Created Label " + name + " (" + desc + ") with view:\n" + P4View, | |||||
| log("Created Label " + name + " (" + desc + ") with view:\n" + P4View, | |||||
| Project.MSG_INFO); | Project.MSG_INFO); | ||||
| //Now lock if required | //Now lock if required | ||||
| @@ -61,10 +61,12 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| /* | |||||
| /** | |||||
| * Reopen Perforce checkout files between changelists. | * Reopen Perforce checkout files between changelists. | ||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Reopen extends P4Base { | public class P4Reopen extends P4Base { | ||||
| @@ -65,6 +65,8 @@ import org.apache.tools.ant.BuildException; | |||||
| * Revert Perforce open files or files in a changelist | * Revert Perforce open files or files in a changelist | ||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Revert extends P4Base { | public class P4Revert extends P4Base { | ||||
| @@ -74,6 +74,7 @@ import java.util.Vector; | |||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | * | ||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Submit extends P4Base { | public class P4Submit extends P4Base { | ||||
| @@ -79,6 +79,8 @@ import org.apache.tools.ant.Project; | |||||
| * @todo Add decent label error handling for non-exsitant labels | * @todo Add decent label error handling for non-exsitant labels | ||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| * | |||||
| * @ant.task category="scm" | |||||
| */ | */ | ||||
| public class P4Sync extends P4Base { | public class P4Sync extends P4Base { | ||||