git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@473560 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -42,7 +42,8 @@ import org.apache.tools.ant.types.Commandline; | |||||
| * @see org.apache.tools.ant.taskdefs.Execute | * @see org.apache.tools.ant.taskdefs.Execute | ||||
| */ | */ | ||||
| public abstract class P4Base extends org.apache.tools.ant.Task { | public abstract class P4Base extends org.apache.tools.ant.Task { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| // CheckStyle:MemberNameCheck OFF - bc | |||||
| /**Perl5 regexp in Java - cool eh? */ | /**Perl5 regexp in Java - cool eh? */ | ||||
| protected Perl5Util util = null; | protected Perl5Util util = null; | ||||
| /** The OS shell to use (cmd.exe or /bin/sh) */ | /** The OS shell to use (cmd.exe or /bin/sh) */ | ||||
| @@ -76,6 +77,10 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| /** If inError is set, then errorMessage needs to contain the reason why. */ | /** If inError is set, then errorMessage needs to contain the reason why. */ | ||||
| private String errorMessage = ""; | private String errorMessage = ""; | ||||
| // CheckStyle:MemberNameCheck ON | |||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * gets whether or not the task has encountered an error | * gets whether or not the task has encountered an error | ||||
| * @return error flag | * @return error flag | ||||
| @@ -115,39 +120,39 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| * The p4d server and port to connect to; | * The p4d server and port to connect to; | ||||
| * optional, default "perforce:1666" | * optional, default "perforce:1666" | ||||
| * | * | ||||
| * @param P4Port the port one wants to set such as localhost:1666 | |||||
| * @param p4Port the port one wants to set such as localhost:1666 | |||||
| */ | */ | ||||
| public void setPort(String P4Port) { | |||||
| this.P4Port = "-p" + P4Port; | |||||
| public void setPort(String p4Port) { | |||||
| this.P4Port = "-p" + p4Port; | |||||
| } | } | ||||
| /** | /** | ||||
| * The p4 client spec to use; | * The p4 client spec to use; | ||||
| * optional, defaults to the current user | * optional, defaults to the current user | ||||
| * | * | ||||
| * @param P4Client the name of the Perforce client spec | |||||
| * @param p4Client the name of the Perforce client spec | |||||
| */ | */ | ||||
| public void setClient(String P4Client) { | |||||
| this.P4Client = "-c" + P4Client; | |||||
| public void setClient(String p4Client) { | |||||
| this.P4Client = "-c" + p4Client; | |||||
| } | } | ||||
| /** | /** | ||||
| * The p4 username; | * The p4 username; | ||||
| * optional, defaults to the current user | * optional, defaults to the current user | ||||
| * | * | ||||
| * @param P4User the user name | |||||
| * @param p4User the user name | |||||
| */ | */ | ||||
| public void setUser(String P4User) { | |||||
| this.P4User = "-u" + P4User; | |||||
| public void setUser(String p4User) { | |||||
| this.P4User = "-u" + p4User; | |||||
| } | } | ||||
| /** | /** | ||||
| * Set global P4 options; Used on all | * Set global P4 options; Used on all | ||||
| * of the Perforce tasks. | * of the Perforce tasks. | ||||
| * | * | ||||
| * @param P4Opts global options, to use a specific P4Config file for instance | |||||
| * @param p4Opts global options, to use a specific P4Config file for instance | |||||
| */ | */ | ||||
| public void setGlobalopts(String P4Opts) { | |||||
| this.P4Opts = P4Opts; | |||||
| public void setGlobalopts(String p4Opts) { | |||||
| this.P4Opts = p4Opts; | |||||
| } | } | ||||
| /** | /** | ||||
| * The client, branch or label view to operate upon; | * The client, branch or label view to operate upon; | ||||
| @@ -161,21 +166,21 @@ public abstract class P4Base extends org.apache.tools.ant.Task { | |||||
| * <li>p4resolve</li> | * <li>p4resolve</li> | ||||
| * </ul> | * </ul> | ||||
| * | * | ||||
| * @param P4View the view one wants to use | |||||
| * @param p4View the view one wants to use | |||||
| */ | */ | ||||
| public void setView(String P4View) { | |||||
| this.P4View = P4View; | |||||
| public void setView(String p4View) { | |||||
| this.P4View = p4View; | |||||
| } | } | ||||
| /** | /** | ||||
| * Set extra command options; only used on some | * Set extra command options; only used on some | ||||
| * of the Perforce tasks. | * of the Perforce tasks. | ||||
| * | * | ||||
| * @param P4CmdOpts command line options going after the particular | |||||
| * @param p4CmdOpts command line options going after the particular | |||||
| * Perforce command | * Perforce command | ||||
| */ | */ | ||||
| public void setCmdopts(String P4CmdOpts) { | |||||
| this.P4CmdOpts = P4CmdOpts; | |||||
| public void setCmdopts(String p4CmdOpts) { | |||||
| this.P4CmdOpts = p4CmdOpts; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -39,9 +39,11 @@ import org.apache.tools.ant.Project; | |||||
| * @ant.task category="scm" | * @ant.task category="scm" | ||||
| */ | */ | ||||
| public class P4Change extends P4Base { | public class P4Change extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| protected String emptyChangeList = null; | protected String emptyChangeList = null; | ||||
| protected String description = "AutoSubmit By Ant"; | protected String description = "AutoSubmit By Ant"; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * creates a new Perforce change list | * creates a new Perforce change list | ||||
| @@ -49,6 +49,7 @@ import org.apache.tools.ant.Project; | |||||
| */ | */ | ||||
| public class P4Counter extends P4Base { | public class P4Counter extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| /** | /** | ||||
| * name of the counter | * name of the counter | ||||
| */ | */ | ||||
| @@ -70,6 +71,8 @@ public class P4Counter extends P4Base { | |||||
| */ | */ | ||||
| public int value = 0; | public int value = 0; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * The name of the counter; required | * The name of the counter; required | ||||
| * @param counter name of the counter | * @param counter name of the counter | ||||
| @@ -33,10 +33,12 @@ import org.apache.tools.ant.BuildException; | |||||
| */ | */ | ||||
| public class P4Delete extends P4Base { | public class P4Delete extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| /** | /** | ||||
| * number of the change list to work on | * number of the change list to work on | ||||
| */ | */ | ||||
| public String change = null; | public String change = null; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * An existing changelist number for the deletion; optional | * An existing changelist number for the deletion; optional | ||||
| @@ -40,11 +40,14 @@ import org.apache.tools.ant.BuildException; | |||||
| public class P4Edit extends P4Base { | public class P4Edit extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| /** | /** | ||||
| * number of the change list to work on | * number of the change list to work on | ||||
| */ | */ | ||||
| public String change = null; | public String change = null; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * An existing changelist number to assign files to; optional | * An existing changelist number to assign files to; optional | ||||
| * but strongly recommended. | * but strongly recommended. | ||||
| @@ -30,9 +30,10 @@ import org.apache.tools.ant.taskdefs.PumpStreamHandler; | |||||
| * command line client | * command line client | ||||
| */ | */ | ||||
| public abstract class P4HandlerAdapter implements P4Handler { | public abstract class P4HandlerAdapter implements P4Handler { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| String p4input = ""; | String p4input = ""; | ||||
| private PumpStreamHandler myHandler = null; | private PumpStreamHandler myHandler = null; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * set any data to be written to P4's stdin | * set any data to be written to P4's stdin | ||||
| * @param p4Input the text to write to P4's stdin | * @param p4Input the text to write to P4's stdin | ||||
| @@ -50,7 +51,7 @@ public abstract class P4HandlerAdapter implements P4Handler { | |||||
| /** | /** | ||||
| * this routine gets called by the execute routine of the Execute class | * this routine gets called by the execute routine of the Execute class | ||||
| * it connects the PumpStreamHandler to the input/output/error streams of the process. | * it connects the PumpStreamHandler to the input/output/error streams of the process. | ||||
| * @throws BuildException | |||||
| * @throws BuildException if there is a error. | |||||
| * @see org.apache.tools.ant.taskdefs.Execute#execute | * @see org.apache.tools.ant.taskdefs.Execute#execute | ||||
| */ | */ | ||||
| public void start() throws BuildException { | public void start() throws BuildException { | ||||
| @@ -75,9 +76,11 @@ public abstract class P4HandlerAdapter implements P4Handler { | |||||
| myHandler.stop(); | myHandler.stop(); | ||||
| } | } | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| OutputStream os; //Input | OutputStream os; //Input | ||||
| InputStream is; //Output | InputStream is; //Output | ||||
| InputStream es; //Error | InputStream es; //Error | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * connects the handler to the input stream into Perforce | * connects the handler to the input stream into Perforce | ||||
| @@ -44,9 +44,11 @@ import org.apache.tools.ant.util.StringUtils; | |||||
| */ | */ | ||||
| public class P4Label extends P4Base { | public class P4Label extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| protected String name; | protected String name; | ||||
| protected String desc; | protected String desc; | ||||
| protected String lock; | protected String lock; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * The name of the label; optional, default "AntLabel" | * The name of the label; optional, default "AntLabel" | ||||
| @@ -42,10 +42,12 @@ import org.apache.tools.ant.util.StringUtils; | |||||
| */ | */ | ||||
| public class P4Labelsync extends P4Base { | public class P4Labelsync extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| protected String name; | protected String name; | ||||
| private boolean add; /* -a */ | private boolean add; /* -a */ | ||||
| private boolean delete; /* -n */ | private boolean delete; /* -n */ | ||||
| private boolean simulationmode; /* -n */ | private boolean simulationmode; /* -n */ | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * -a flag of p4 labelsync - preserve files which exist in the label, | * -a flag of p4 labelsync - preserve files which exist in the label, | ||||
| * but not in the current view | * but not in the current view | ||||
| @@ -40,11 +40,13 @@ import java.util.Vector; | |||||
| */ | */ | ||||
| public class P4Submit extends P4Base { | public class P4Submit extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| //ToDo: If dealing with default cl need to parse out <enter description here> | //ToDo: If dealing with default cl need to parse out <enter description here> | ||||
| /** | /** | ||||
| * change list number | * change list number | ||||
| */ | */ | ||||
| public String change; | public String change; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * change property | * change property | ||||
| */ | */ | ||||
| @@ -96,6 +98,10 @@ public class P4Submit extends P4Base { | |||||
| * internal class used to process the output of p4 submit | * internal class used to process the output of p4 submit | ||||
| */ | */ | ||||
| public class P4SubmitAdapter extends SimpleP4OutputHandler { | public class P4SubmitAdapter extends SimpleP4OutputHandler { | ||||
| /** | |||||
| * Constructor. | |||||
| * @param parent a P4Base instance. | |||||
| */ | |||||
| public P4SubmitAdapter(P4Base parent) { | public P4SubmitAdapter(P4Base parent) { | ||||
| super(parent); | super(parent); | ||||
| } | } | ||||
| @@ -114,7 +120,7 @@ public class P4Submit extends P4Base { | |||||
| util.split(myarray, line); | util.split(myarray, line); | ||||
| boolean found = false; | boolean found = false; | ||||
| for (int counter = 0; counter < myarray.size(); counter++) { | for (int counter = 0; counter < myarray.size(); counter++) { | ||||
| if (found == true) { | |||||
| if (found) { | |||||
| String chnum = (String) myarray.elementAt(counter + 1); | String chnum = (String) myarray.elementAt(counter + 1); | ||||
| int changenumber = Integer.parseInt(chnum); | int changenumber = Integer.parseInt(chnum); | ||||
| log("Perforce change renamed " + changenumber, Project.MSG_INFO); | log("Perforce change renamed " + changenumber, Project.MSG_INFO); | ||||
| @@ -50,8 +50,10 @@ import org.apache.tools.ant.Project; | |||||
| */ | */ | ||||
| public class P4Sync extends P4Base { | public class P4Sync extends P4Base { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| String label; | String label; | ||||
| private String syncCmd = ""; | private String syncCmd = ""; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * Label to sync client to; optional. | * Label to sync client to; optional. | ||||
| @@ -33,7 +33,9 @@ import org.apache.tools.ant.util.StringUtils; | |||||
| */ | */ | ||||
| public class SimpleP4OutputHandler extends P4HandlerAdapter { | public class SimpleP4OutputHandler extends P4HandlerAdapter { | ||||
| // CheckStyle:VisibilityModifier OFF - bc | |||||
| P4Base parent; | P4Base parent; | ||||
| // CheckStyle:VisibilityModifier ON | |||||
| /** | /** | ||||
| * simple constructor | * simple constructor | ||||