using System.Reflection; using System; using System.Text.RegularExpressions; using UnityEngine; using Perforce.P4; namespace P4Connect { /// /// Version wrappers for P4Connect /// public static class Version { public static string appName = "p4connect"; public static string p4ConnectVersion = "2.7"; public static string perforceRelease = "2015.1.0.0"; // Copy this into the AssemblyInfo for P4Connect? public static string branch = "GA.7."; public static string changeIdStr = ""; #if DEBUG public static string build = branch + "D." + ChangeId; #else public static string build = branch + "R." + ChangeId; #endif public static string ChangeId { get { string change = " $Change: 14193 $"; // File must be stored +k so the RCS Keyword expands if (String.IsNullOrEmpty(changeIdStr)) { changeIdStr = Regex.Match(change, @"\d+").Value; } return changeIdStr; } } static Options NameVerOpts = null; // Create an Array of options for the Connect call. You can see these in the Perforce server log public static Options ConnectOptions { get { if (NameVerOpts == null) { NameVerOpts = new Options(); NameVerOpts.Add("ProgramName", appName); NameVerOpts.Add("ProgramVersion", p4ConnectVersion + "." + build); } return NameVerOpts; } } } }