using System.Reflection; using System; using System.Text.RegularExpressions; using UnityEngine; using Perforce.P4; namespace P4Connect { /// <summary> /// Version wrappers for P4Connect /// </summary> public static class Version { public static string appName = "p4connect"; public static string perforceRelease = "2015.2.0.0"; // Cache _PerforceReleaseString for re-use private static string _PerforceReleaseString = null; private static string _BuildType = ""; private static string _BuildString = ""; private static string changeIdStr; #if DEBUG private static string _build = "Debug"; #else private static string _build = "Release"; #endif public static string Build { get { if (_BuildString != null) { _BuildString = _build; } return _BuildString; } } public static string ChangeId { get { string change = " $Change: 21852 $"; // File must be stored +k so the RCS Keyword expands if (String.IsNullOrEmpty(changeIdStr)) { changeIdStr = Regex.Match(change, @"\d+").Value; } return changeIdStr; } } public static string PerforceReleaseString { get { if (_PerforceReleaseString != null) return _PerforceReleaseString; char[] delims = { '.' }; string[] fields = perforceRelease.Split(delims); // If UpdateVersion.exe is missing, perforceRelease will be unchanged, // so we instead generate the last two version fields from the contents of the "Change" RCS Keyword if (fields[2].Equals("0") && fields[3].Equals("0")) { // Convert change ID into last two fields of version string. each field is limited to 16 bits, so we split values so they look appropriate in decimal. int changeId = Convert.ToInt32(ChangeId); fields[2] = (changeId / 10000).ToString(); fields[3] = (changeId % 10000).ToString(); _BuildType = "W"; // Mark workshop builds } _PerforceReleaseString = string.Join(".",fields) + _BuildType; return _PerforceReleaseString; } } 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", PerforceReleaseString); } return NameVerOpts; } } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 21852 | cswiedler | Branch //guest/cswiedler/p4connect | ||
//guest/perforce_software/p4connect/dev/shelves/src/P4Connect/P4Connect/P4Connect.VersionInfo.cs | |||||
#1 | 17331 | Norman Morse | Dev branch for Shelves | ||
//guest/perforce_software/p4connect/main/src/P4Connect/P4Connect/P4Connect.VersionInfo.cs | |||||
#1 | 16209 | Norman Morse | Move entire source tree into "main" branch so workshop code will act correctly. | ||
//guest/perforce_software/p4connect/src/P4Connect/P4Connect/P4Connect.VersionInfo.cs | |||||
#22 | 16163 | Norman Morse |
Import latest changes from 2015.2/1245676 Fixes disconnect issue on "run" Fixes SSL versioning problem on OSX Added VS2015 support to project files |
||
#21 | 15383 | Norman Morse |
Improved Diagnostics, cleaned up unnecessary log output Moved some Dialog Initialization to OnEnable() Fixed Unity 5.1.1 incompatibilities Added Operation support for In Depot Deleted files |
||
#20 | 15300 | Norman Morse | Change version string to use '-' hyphen before the build type | ||
#19 | 15298 | Norman Morse | Fix Version Stamping to not use UpdateVersion.exe for personal (workshop) builds. | ||
#18 | 15266 | Norman Morse |
Integrated "UpdateVersion" tool to update the VersionInfo and the DLL properties with information from "Version" EC generates the Version file for us in builds. Workshop users need to generate their own Release number with two zeros (like 2015.2.0.0) which will have the last two numbers replaced with change ID. |
||
#17 | 15256 | Norman Morse | Make these files writeable in the workspace, so they can be modified in a pre build hook. | ||
#16 | 15245 | Norman Morse |
Missed a couple files. Bumped version to 2.8 2015.2 |
||
#15 | 14801 | Norman Morse |
GA.9 changes. Fixed debug message exceptions Improved Pending Changes dialog for large changesets Changed configuration to allow saving configuration with Perforce disabled. Improved restart after recompile, automatically attempts connection now unless disabled. |
||
#14 | 14232 | Norman Morse | GA.8 release | ||
#13 | 14193 | Norman Morse |
GA.7 release Refactor Pending Changes Resolve Submit issues. Fixed Menu entries. Handle mismatched file and meta states. |
||
#12 | 14007 | Norman Morse |
Bump release to GA.6 Fixes problem accessing Unicode server on OSX |
||
#11 | 13814 | Norman Morse | Upped version to GA.5 | ||
#10 | 13693 | Norman Morse |
Updated release notes and version. GA.4 it is |
||
#9 | 13596 | Norman Morse |
GA.3 fixes Update release notes. Fix config dialog initialization, update version Disable warnings for PackageIcons.cs, Fix crash in GetLockState() call |
||
#8 | 13269 | Norman Morse |
Bumped version to 2.7 GA 2 Fixed problem with Hung Config Window and no previous settings Fixed code to automattically attempt to connect to Perforce Server if configuration allows. |
||
#7 | 12945 | Norman Morse | Changes from internal main GA.1 | ||
#6 | 12566 | Norman Morse |
Fixed hang when restarting after rebuild Updated Release String to GA |
||
#5 | 12553 | Norman Morse |
integrate from internal main Build fixes for EC. Major changes to Configuration and re-initialization code. Bug fixes |
||
#4 | 12512 | Norman Morse | Integrate from Dev branch, preparing for Beta3 release | ||
#3 | 12252 | Norman Morse |
2.7 Beta2 release unitypackages. Updated version file. |
||
#2 | 12251 | Norman Morse |
Fixes for Beta 2 release Mostly Configuration dialog bug fixes |
||
#1 | 12135 | Norman Morse |
Integrate dev branch changes into main. This code is the basiis of the 2.7 BETA release which provides Unity 5 compatibility |
||
//guest/norman_morse/dev/p4connect/src/P4Connect/P4Connect/P4Connect.VersionInfo.cs | |||||
#5 | 12101 | Norman Morse |
Additional movement towards Unity 5. Still gettting DllNotFound exceptions in 5 |
||
#4 | 12099 | Norman Morse |
Various changes to prepare for Beta Fixed VersionInfo to show changeID Added "additional ignore in config". Updated ReleaseNotes |
||
#3 | 12088 | Norman Morse | Fix RCS keyword | ||
#2 | 11896 | Norman Morse | Checkin of Version file | ||
#1 | 11403 | Norman Morse | Add version module to P4Connect |