|
Perforce Tasks User Manualby
Version 1.1 - 2001/01/09 ContentsIntroductionThese tasks provide an interface to the Perforce SCM.
The Note: These tasks require the oro 2.0.XXX regular expression package. Simply download this package and copy the jakarta-oro-2.0.XXX.jar file into Ant's lib directory. You will also need the Perforce client executable (p4 or p4.exe but not p4win.exe) in your path. The Tasks
General P4 PropertiesEach p4 task requires a number of settings, either through build-wide properties, individual attributes 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. Additionally, you may also specify the following attributes:
ExamplesSetting in the environment:- (Unix csh) setenv P4PORT myperforcebox:1666 (Unix sh et al) P4USER=myp4userid; export P4USER Using build properties:- <property name="p4.client" value="nightlybuild"/> Using task attributes:- <p4Whatever port="myserver:1666" client="smoketest" user="smoketestdude" . . . /> For more information regarding the underlying 'p4' commands you are referred to the Perforce Command Reference available from the Perforce website. TaskdefsStandard taskdefs (for you to copy'n'paste) -- normally this is done automatically if you install this optional task. <taskdef name="p4sync" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Sync"/> <taskdef name="p4change" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Change"/> <taskdef name="p4edit" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Edit"/> <taskdef name="p4submit" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Submit"/> <taskdef name="p4have" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Have"/> <taskdef name="p4label" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Label"/> <taskdef name="p4counter" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Counter"/> <taskdef name="p4reopen" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Reopen"/> <taskdef name="p4revert" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Revert"/> <taskdef name="p4add" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Add"/> Task DescriptionsP4SyncDescription:Synchronize the current workspace with the depot. Parameters
Examples<p4sync label="nightlybuild-0.0123" force="foo"/> <p4sync view="//depot/projects/projectfoo/main/src/..."/> P4ChangeDescription:Request a new changelist from the Perforce server. This task sets the ${p4.change} property which can then be passed to P4Submit, P4Edit, or P4Add. Parameters
Examples<p4change description="Change Build Number in Script"> P4EditDescription: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 it. Parameters
Examples<p4edit view="//depot/projects/projectfoo/main/src/Blah.java..." change="${p4.change}"/> P4SubmitDescription:Submit a changelist, usually obtained from P4Change. Parameters
Examples<p4submit change="${p4.change}"/> P4HaveDescription:List handy file info reflecting the current client contents. Parameters
Examples<p4have/> P4LabelDescription:Create a new label and set contents to reflect current client file revisions. Parameters
Examples<p4label name="NightlyBuild:${DSTAMP}:${TSTAMP}" desc="Auto Nightly Build" lock="locked" /> P4CounterDescription:Obtain or set the value of a counter. 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. The user performing this task must have Perforce "review" permissions as defined by Perforce protections in order for this task to succeed. Parameters
ExamplesPrint the value of the counter named "last-clean-build" to the output stream:<p4counter name="last-clean-build"/>Set the value of the counter based on the value of the "TSTAMP" property: <p4counter name="last-clean-build" value="${TSTAMP}"/>Set the value of the "p4.last.clean.build" property to the current value of the "last-clean-build" counter: <p4counter name="last-clean-build" property="${p4.last.clean.build}"/> P4ReopenDescription:Move (or reopen in Perforce speak) checkout files between changelists. Parameters
ExamplesMove all open files to the default changelist<p4reopen view="//..." tochange="default"/>Create a new changelist then reopen into it, any files from the view //projects/foo/main/... <p4change description="Move files out of the way"/> <p4reopen view="//projects/foo/main/..." tochange="${p4.change}"/> P4RevertDescription:Reverts files. Parameters
ExamplesRevert everything!<p4revert view="//..."/>Revert any unchanged files in the default change <p4revert change="default" revertonlyunchanged="true"/> P4AddDescription:Adds files specified in nested fileset children. Parameters
ExamplesRequire a changelist, add all java files starting from a directory, and submit<p4change/> <p4add commandlength="20000" changelist="${p4.change}"> <fileset dir="../dir/src/" includes="**/*.java"/> <p4add> <p4submit change="${p4.change}"/> Change History
Copyright © 2001-2002 Apache Software Foundation. All rights Reserved. |