Building

From P4dotnet

Jump to: navigation, search

Prerequisites

Visual Studio (2003 for .Net 1.1 and 2005 for .Net 2.0) including C++ Perforce C++ API

Download the Perforce C++ API. Currently P4.Net requires the 2006.2 "dynamic" version. Managed C++ applications require building with the /Md compiler switch. Only Perforce API's in the "dyn" folder are built with this switch. ftp://ftp.perforce.com/perforce/r06.2/bin.ntx86/dyn/p4api.zip Extract the Perforce API into the the /ext/p4api folder. All the ".h" files should be in the root of /ext/p4api, if not move the files to mimic this hierarchy.

Compiling

Run the following from a Visual Studio Command Prompt (2003 for .Net 1.1 or 2005 for .Net 2.0) build/compile_p4dn.bat 1.1|2.0 [SN]

Specify either 1.1 or 2.0 for the target framework version. If you need strong-named assemblies, add the 'SN' flag.

Unit Tests

To run the unit tests, you must download your prefered version of p4.exe and p4d.exe to the test/ directory. Then execute the following at the command-line:

runtest.bat 1.1^|2.0 [compile] [unicode]

Specify either 1.1 or 2.0 for the target framework version. The optional 'compile' flag will only compile the unit-tests (not P4.Net itself). The optional 'unicode' flag will execute additional tests with the server in unicode mode.

Personal tools