diff --git a/docs/manual/OptionalTasks/perforce.html b/docs/manual/OptionalTasks/perforce.html
index 06640ec86..44b91fb55 100644
--- a/docs/manual/OptionalTasks/perforce.html
+++ b/docs/manual/OptionalTasks/perforce.html
@@ -8,8 +8,9 @@
@@ -122,8 +123,11 @@ or environment variables. These are
-
-Your local installation of Perforce may require other settings (e.g. P4PASSWD, P4CONFIG). At the moment, these can only be set outside of Ant, as environment variables.
+
Your local installation of Perforce may require other settings (e.g.
+P4PASSWD, P4CONFIG). Many of these settings can be set using the globalopts
+attribute (described below), but not all. If a setting cannot be set
+by the command-line options, then it can only be set outside of Ant as an
+environment variable.
Additionally, you may also specify the following attributes:
@@ -143,6 +147,16 @@ Additionally, you may also specify the following attributes:
if an error is returned from the p4 command.
No; defaults to true. |
+
+ globalopts
|
+ Specifies global options for perforce to use while
+ executing the task. These properties should be concatenated into one
+ string,
+ such as "-P password -C EUCJIS". Use the command-line option
+ syntax, NOT the environment variable names. See the
+ Perforce Command Reference for details. |
+ No
|
+
@@ -569,7 +583,15 @@ and submit
Jan 2001 |
V1.1 |
- fixed cross platform (NT/Unix) bug refactored p4 output handling code refactored exec'ing code |
+ Fixed cross platform (NT/Unix) bug
+ Refactored p4 output handling code
+ Refactored exec'ing code |
+
+
+ Nov 2002 |
+ V1.2 |
+ Added globalopts to P4Base to allow
+ additional global options to be set. |
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java b/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
index b0e11d7e2..fad01e21a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
@@ -132,6 +132,14 @@ public abstract class P4Base extends org.apache.tools.ant.Task {
public void setUser(String P4User) {
this.P4User = "-u" + P4User;
}
+
+ /**
+ * Set global P4 options; Used on all
+ * of the Perforce tasks.
+ */
+ public void setGlobalopts(String P4Opts) {
+ this.P4Opts = P4Opts;
+ }
/**
* The client, branch or label view to operate upon;
@@ -199,6 +207,9 @@ public abstract class P4Base extends org.apache.tools.ant.Task {
if (P4Client != null && P4Client.length() != 0) {
commandline.createArgument().setValue(P4Client);
}
+ if (P4Opts != null && P4Opts.length() != 0) {
+ commandline.createArgument().setValue(P4Opts);
+ }
commandline.createArgument().setLine(command);
log(commandline.describeCommand(), Project.MSG_VERBOSE);