This is the official Perforce plugin that is shipped with Unity, as a built-in Version Control provider.
On Windows it is shipped as Editor\Data\Tools\VersionControl\PerforcePlugin.exe
.
See also the Community Supported Perforce (Helix Core) plugin for Unity It is a fork of these code, but allows the linked version of the P4 API to be changed as needed, and provide more recent builds.
You can build support for you own favorite version control system into Unity by cloning this repository and make changes as needed.
A plugin is an executable located in a designated directory that Unity can start and kill at will. At startup, Unity will scan the directory and start each executable in order to identify the plugin and its settings. When a version control system has been enabled in unity it will start the associated plugin executable and send commands to it by using stdin/stdout (MacOS) or Named Pipes (Windows).
The Perforce plugin is using the libraries provided by Perforce and its callback style API. Furthermore, is streams results from the perforce server directly to Unity.
You need Unity 4.2+ to use the integrated version control plugins.
Common/
contains structures and functionality common to all pluginsP4Plugin/
contains the Perforce plugin code and Perforce libraries (binaries shipped with Unity)TFSPlugin/
contains the Team Foundation Server/VS Online plugin code (not officially supported by Unity, and not shipped with Unity)Test/
contains integration tests
To build:
perl ./build.pl
To test:
perl ./build.pl -test
You need to clone PerforceBinaries
from mercurial to get the binaries you will run the tests on. You can execute this command from NativeVersionControlPlugins root:
hg clone --config extensions.largefiles= http://hg-mirror-slo.hq.unity3d.com/unity-extra/perforce PerforceBinaries
Steps for setting up Mercurial can be found here: Setting Up Mercurial
The Perforce plugin source code is located under /P4Plugin/Source
. It references the Perforce APIs, located under
/P4Plugin/Source/r19.1
. As its name states, we're targeting the 19.1 release of Perforce.
Perforce API includes and libraries were downloaded from the Perforce downloads page.
Windows binaries are located under /P4Plugin/Source/r17.2/lib/win32
and /P4Plugin/Source/r17.2/lib/win32debug
.
Both directories contain libraries for Win32 - x86 only. They require Visual Studio v10.0 (2010).
The plugin code itself is licensed under public domain.
Libraries used by the plugin have their own licenses and are allowed to be distributed with the plugin.
The PerforcePlugin uses the P4 API. For more information on terms of usage and how to get the P4 API, visit the following links: