From bf9d283d9060411e0630f9d9412ce36d11ebfa79 Mon Sep 17 00:00:00 2001 From: Jairo Calleja Date: Wed, 3 Nov 2021 16:36:26 +0100 Subject: [PATCH] Remove anything related to PlasticSCM In thisPR https://github.cds.internal.unity3d.com/unity/unity/pull/6328 we remove the option to choose Plastic in Unity's internal version control. We must remove the binaries from here too. --- .yamato/osx-build.yml | 1 - .yamato/windows-build.yml | 1 - Makefile.osx | 5 +- PlasticSCMPlugin/PipeClient.cs | 79 -------------- PlasticSCMPlugin/PlasticSCMPlugin | 76 -------------- PlasticSCMPlugin/PlasticSCMPlugin.csproj | 102 ------------------ PlasticSCMPlugin/Program.cs | 127 ----------------------- README.md | 3 +- VersionControl.sln | 2 - build.pl | 2 - 10 files changed, 2 insertions(+), 396 deletions(-) delete mode 100644 PlasticSCMPlugin/PipeClient.cs delete mode 100755 PlasticSCMPlugin/PlasticSCMPlugin delete mode 100644 PlasticSCMPlugin/PlasticSCMPlugin.csproj delete mode 100644 PlasticSCMPlugin/Program.cs diff --git a/.yamato/osx-build.yml b/.yamato/osx-build.yml index d58cf1b..4b4fec7 100644 --- a/.yamato/osx-build.yml +++ b/.yamato/osx-build.yml @@ -14,7 +14,6 @@ artifacts: builds: paths: - "Build/OSXx64/PerforcePlugin" - - "Build/OSXx64/PlasticSCMPlugin" logs: paths: - "mac_build.txt" diff --git a/.yamato/windows-build.yml b/.yamato/windows-build.yml index 52a471e..f36cf7d 100644 --- a/.yamato/windows-build.yml +++ b/.yamato/windows-build.yml @@ -14,7 +14,6 @@ artifacts: builds: paths: - "Build/Win32/PerforcePlugin.exe" - - "Build/Win32/PlasticSCMPlugin.exe" - "Build/Win32/PerforcePlugin.pdb" logs: paths: diff --git a/Makefile.osx b/Makefile.osx index b6635db..9ee216f 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -23,13 +23,10 @@ OSX_SRCS = ./P4Plugin/Source/P4OSX.mm OSX_MODULES = $(OSX_SRCS:.mm=.o) P4PLUGIN_MODULES += $(OSX_MODULES) -PLASTICSCMPLUGIN_TARGET = PlasticSCMPlugin/PlasticSCMPlugin - default: all -all: P4Plugin PlasticSCMPlugin testserver +all: P4Plugin testserver @mkdir -p Build/$(PLATFORM) - cp $(PLASTICSCMPLUGIN_TARGET) Build/$(PLATFORM) testserver: $(TESTSERVER_TARGET) @mkdir -p Build/$(PLATFORM) diff --git a/PlasticSCMPlugin/PipeClient.cs b/PlasticSCMPlugin/PipeClient.cs deleted file mode 100644 index 8658f1f..0000000 --- a/PlasticSCMPlugin/PipeClient.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; - -using Microsoft.Win32.SafeHandles; - -namespace Codice.Unity3D -{ - internal class PipeClient - { - [DllImport("kernel32.dll", SetLastError = true)] - public static extern SafeFileHandle CreateFile( - String pipeName, - uint dwDesiredAccess, - uint dwShareMode, - IntPtr lpSecurityAttributes, - uint dwCreationDisposition, - uint dwFlagsAndAttributes, - IntPtr hTemplate); - - internal bool Connected - { - get { return mbConnected; } - } - - internal void Connect() - { - this.mHandle = - CreateFile( - PIPE_NAME, - GENERIC_READ | GENERIC_WRITE, - 0, - IntPtr.Zero, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - IntPtr.Zero); - - //could not create handle - server probably not running - if (mHandle.IsInvalid) - return; - - mbConnected = true; - - mStream = new FileStream( - mHandle, FileAccess.ReadWrite, BUFFER_SIZE, true); - } - - internal void SendMessage(string message) - { - ASCIIEncoding encoder = new ASCIIEncoding(); - byte[] messageBuffer = encoder.GetBytes(message); - - mStream.Write(messageBuffer, 0, messageBuffer.Length); - mStream.Flush(); - } - - internal void Close() - { - if (mStream != null) - mStream.Close(); - - if (mHandle != null) - mHandle.Close(); - } - - const uint GENERIC_READ = (0x80000000); - const uint GENERIC_WRITE = (0x40000000); - const uint OPEN_EXISTING = 3; - const uint FILE_FLAG_OVERLAPPED = (0x40000000); - const int BUFFER_SIZE = 4096; - - const string PIPE_NAME = "\\\\.\\pipe\\UnityVCS"; - - FileStream mStream; - SafeFileHandle mHandle; - bool mbConnected; - } -} \ No newline at end of file diff --git a/PlasticSCMPlugin/PlasticSCMPlugin b/PlasticSCMPlugin/PlasticSCMPlugin deleted file mode 100755 index 8df18e8..0000000 --- a/PlasticSCMPlugin/PlasticSCMPlugin +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# -# PlasticSCMPlugin is the PlasticSCM's Unity plugin launcher script for Mac OS provided by Codice Software S.L. -# - -EXE_TO_CHECK="PlasticSCMUnityPlugin" -EXE_DEFAULT_PATH="/usr/local/bin/PlasticSCMUnityPlugin" -EXE_FULL_PATH="" -RETVAL=0 - -start() { - startPlugin - RETVAL=$? -} - -# Start PlasticSCM Unity Plugin -startPlugin() { - - # Check if process file exists - EXE_FULL_PATH=$EXE_TO_CHECK - checkExe $EXE_FULL_PATH - exec_file_exists=$? - - # fallback to the default install path in case of error - if [ $exec_file_exists -ne 0 ] - then - checkPath $EXE_DEFAULT_PATH - exec_file_exists=$? - if [ $exec_file_exists -eq 0 ] - then - EXE_FULL_PATH=$EXE_DEFAULT_PATH - fi - fi - - if [ $exec_file_exists -eq 0 ] - then - exec $EXE_FULL_PATH - RETVAL=0 - return - fi - - notifyPlasticSCMNotInstalled - RETVAL=1 - return -} - -# Check whether plugin file exists -checkExe() { - which_retval=1 - exe_path=`which $1` - which_retval=$? - if [ $which_retval -eq 0 ] - then - EXE_FULL_PATH=$exe_path - fi - return $which_retval -} - -# Check path exists -checkPath() { - retval=1 - if [ -f $1 ]; then - retval=0 - fi - return $retval -} - -# Notify error to Unity -notifyPlasticSCMNotInstalled() { - echo "e1:PlasticSCM not installed. Please visit http://www.plasticscm.com to download PlasticSCM or contact support team at: support@codicesoftware.com" - echo "r1:end of response" -} - -# Starting point -start -exit $RETVAL diff --git a/PlasticSCMPlugin/PlasticSCMPlugin.csproj b/PlasticSCMPlugin/PlasticSCMPlugin.csproj deleted file mode 100644 index 4921316..0000000 --- a/PlasticSCMPlugin/PlasticSCMPlugin.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6CB882FE-B944-4036-8229-06F2BA9C9D51} - Exe - Properties - Codice.Unity3D - PlasticSCMPlugin - v2.0 - 512 - - - - - - - - - - - 3.5 - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - ..\Debug\ - DEBUG;TRACE - prompt - 4 - AnyCPU - - - pdbonly - true - ..\Release\ - TRACE - prompt - 4 - AnyCPU - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - echo f | xcopy "$(SolutionDir)$(Configuration)\$(TargetFileName)" "$(SolutionDir)Build\Win32\$(TargetFileName)" /Y - - - \ No newline at end of file diff --git a/PlasticSCMPlugin/Program.cs b/PlasticSCMPlugin/Program.cs deleted file mode 100644 index faadc70..0000000 --- a/PlasticSCMPlugin/Program.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Diagnostics; -using System.IO; -using System.Reflection; - -namespace Codice.Unity3D -{ - internal class InstallChecker - { - static void Main(string[] args) - { - string installPath = GetInstallFolder(PLUGIN_EXEC_NAME); - - if (string.IsNullOrEmpty(installPath)) - { - NotifyNotInstalled(); - return; - } - - ExecutePlugin(PLUGIN_EXEC_NAME); - } - - private static string GetInstallFolder(string fileToCheck) - { - StringDictionary env = - Process.GetCurrentProcess().StartInfo.EnvironmentVariables; - - string pathEnvVble = env["PATH"]; - string[] paths = new string[] { }; - paths = pathEnvVble.Split(new char[] { ';' }); - - foreach (string path in paths) - { - if (File.Exists(Path.Combine(path, fileToCheck))) - return path; - } - return string.Empty; - } - - private static void NotifyNotInstalled() - { - try - { - UnityConnection conn = new UnityConnection(); - conn.WriteLine(string.Format("e1:{0}", NOT_INSTALLED_MSG)); - conn.WriteLine("r1:end of response"); - conn.Close(); - } - catch - { - //nothing to do.We cannot neither log nor crash - } - } - - private static void ExecutePlugin(string execFile) - { - Process p = new Process(); - p.StartInfo.FileName = execFile; - p.StartInfo.Arguments = string.Empty; - p.StartInfo.CreateNoWindow = true; - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardInput = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.RedirectStandardError = true; - - try - { - p.Start(); - p.WaitForExit(); - } - catch - { - //nothing to do.We cannot neither log nor crash - } - finally - { - if (p != null) - p.Close(); - } - } - - private static string GetExecutingLocation() - { - try - { - return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - } - catch - { - return string.Empty; - } - } - - const string PLUGIN_EXEC_NAME = "PlasticSCMUnityPlugin.exe"; - - const string NOT_INSTALLED_MSG = - "PlasticSCM not installed. Please visit http://www.plasticscm.com " + - "to download PlasticSCM or contact support team at: " + - "support@codicesoftware.com"; - } - - internal class UnityConnection - { - internal UnityConnection() - { - mClient = new PipeClient(); - mClient.Connect(); - } - - internal void WriteLine(string message) - { - if (!mClient.Connected) - return; - - mClient.SendMessage( - string.Format("{0}{1}", message, Environment.NewLine)); - } - - internal void Close() - { - mClient.Close(); - } - - PipeClient mClient; - } -} diff --git a/README.md b/README.md index 477045b..3d2f3bd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the source code of the builtin version control plugins that are shipped You can build support for you own favourite version control system into Unity by cloning this repository and make changes as needed. -Note that only Perforce support is shipped for Unity 4.2+, PlasticSCM for 4.3+, TFSPlugin for 4.6+. +Note that only Perforce support is shipped for Unity 4.2+, TFSPlugin for 4.6+. #### Overview @@ -18,7 +18,6 @@ You need Unity 4.2+ to use the integrated version control plugins. * Common/ contains structures and functionallity common to all plugins * P4Plugin/ contains the Perforce plugin code and Perforce libraries (binaries shipped with Unity) -* PlasticSCMPlugn contains the Plastic plugin code (binaries shipped with Unity) * TFSPlugin/ contains the Team Foundation Server/VS Online plugin code * Test/ contains integration tests diff --git a/VersionControl.sln b/VersionControl.sln index 7fbef5c..a156697 100644 --- a/VersionControl.sln +++ b/VersionControl.sln @@ -5,8 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "P4Plugin", "P4Plugin\P4Plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestServer", "Test\TestServer\TestServer.vcxproj", "{64C0D8D3-68C7-46C6-B341-0ED1C78B225B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlasticSCMPlugin", "PlasticSCMPlugin\PlasticSCMPlugin.csproj", "{6CB882FE-B944-4036-8229-06F2BA9C9D51}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/build.pl b/build.pl index 7842c7e..a765a0b 100755 --- a/build.pl +++ b/build.pl @@ -35,7 +35,6 @@ if ($clean) } } unlink("PerforcePlugin"); - unlink("PlasticSCMPlugin"); exit 0; } @@ -144,7 +143,6 @@ sub BuildWin32 { rmtree("Build"); system("msbuilder.cmd", "VersionControl.sln", "P4Plugin", "Win32") && die ("Failed to build PerforcePlugin.exe"); - system("msbuilder.cmd", "VersionControl.sln", "PlasticSCMPlugin", "Any CPU") && die ("Failed to build PlasticSCMPlugin.exe"); system("msbuilder.cmd", "VersionControl.sln", "TestServer", "Win32") && die ("Failed to build TestServer.exe"); }