From 98089880a4e2bc0fa6e361dd027f1b6cedb43296 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 7 Nov 2023 11:53:34 -0500 Subject: [PATCH] [build] Trim Xamarin.Android.sln (#8487) Removes a handful of project references from Xamarin.Android.sln that are no longer needed. Sources for a couple of obsolete build tools have also been removed. --- Configuration.props | 1 - Documentation/building/configuration.md | 6 - Xamarin.Android.sln | 44 ---- build-tools/proprietary/proprietary.csproj | 11 - build-tools/proprietary/proprietary.projitems | 46 ---- build-tools/proprietary/proprietary.targets | 16 -- tools/setup-windows/SetupWindows.cs | 209 ------------------ tools/setup-windows/setup-windows.csproj | 13 -- 8 files changed, 346 deletions(-) delete mode 100644 build-tools/proprietary/proprietary.csproj delete mode 100644 build-tools/proprietary/proprietary.projitems delete mode 100644 build-tools/proprietary/proprietary.targets delete mode 100644 tools/setup-windows/SetupWindows.cs delete mode 100644 tools/setup-windows/setup-windows.csproj diff --git a/Configuration.props b/Configuration.props index a65752bbe2e..46fbf558151 100644 --- a/Configuration.props +++ b/Configuration.props @@ -139,7 +139,6 @@ 34.0.0 34.0.1 - False 1.15.1 $(NUGET_PACKAGES) $(userprofile)\.nuget\packages diff --git a/Documentation/building/configuration.md b/Documentation/building/configuration.md index 630e27407d0..bd363b08271 100644 --- a/Documentation/building/configuration.md +++ b/Documentation/building/configuration.md @@ -148,12 +148,6 @@ Overridable MSBuild properties include: * `4`: Mono 4.6 support. * `5`: Mono 4.8 and above support. This is the default. - * `$(XAIncludeProprietaryBits)`: Defaults to `False`. When enabled, this flag - signals `proprietary.csproj` to copy proprietary assemblies from your system's - Xamarin.Android install to the local build output. This enables proprietary - features such as debugging and fast deployment. Since a "normal" OSS build would - not include proprietary files, this flag also emits a warning when enabled. - * `$(AndroidEnableAssemblyCompression)`: Defaults to `True`. When enabled, all the assemblies placed in the APK will be compressed in `Release` builds. `Debug` builds are not affected. diff --git a/Xamarin.Android.sln b/Xamarin.Android.sln index 0e6838a8ab1..af81dc76da7 100644 --- a/Xamarin.Android.sln +++ b/Xamarin.Android.sln @@ -63,14 +63,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "logcat-parse", "external\Ja EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "api-xml-adjuster", "build-tools\api-xml-adjuster\api-xml-adjuster.csproj", "{8A6CB07C-E493-4A4F-AB94-038645A27118}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Android.Tools.JavadocImporter", "src\Xamarin.Android.Tools.JavadocImporter\Xamarin.Android.Tools.JavadocImporter.csproj", "{E0890301-F75F-40E7-B008-54C28B3BA542}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "javadoc2mdoc", "tools\javadoc2mdoc\javadoc2mdoc.csproj", "{A87352E6-CE7F-4346-B6B1-586AE931C0A7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "create-vsix", "build-tools\create-vsix\create-vsix.csproj", "{94756FEB-1F64-411D-A18E-81B5158F776A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "setup-windows", "tools\setup-windows\setup-windows.csproj", "{73DF9E10-E933-4222-B8E1-F4536FFF9FAD}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Android", "src\Mono.Android\Mono.Android.csproj", "{66CF299A-CE95-4131-BCD8-DB66E30C4BF7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Android.Export", "src\Mono.Android.Export\Mono.Android.Export.csproj", "{B8105878-D423-4159-A3E7-028298281EC6}" @@ -91,12 +83,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aapt2", "src\aapt2\aapt2.cs EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bundletool", "src\bundletool\bundletool.csproj", "{A0AEF446-3368-4591-9DE6-BC3B2B33337D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "proprietary", "build-tools\proprietary\proprietary.csproj", "{D93CAC27-3893-42A3-99F1-2BCA72E186F4}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "jit-times", "tools\jit-times\jit-times.csproj", "{F3CFF31C-037B-450F-B22D-1D6E529B2DCC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vswhere", "tools\vswhere\vswhere.csproj", "{DBDC804F-8406-4F5E-83C6-720CB0CB6C6F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSBuildDeviceIntegration", "tests\MSBuildDeviceIntegration\MSBuildDeviceIntegration.csproj", "{16DB2680-399B-4111-AA26-6CDBBFA334D8}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "external", "external", "{05C3B1D6-A4CE-4534-A9E4-E9117591ADF7}" @@ -241,22 +229,6 @@ Global {8A6CB07C-E493-4A4F-AB94-038645A27118}.Debug|AnyCPU.Build.0 = Debug|Any CPU {8A6CB07C-E493-4A4F-AB94-038645A27118}.Release|AnyCPU.ActiveCfg = Release|Any CPU {8A6CB07C-E493-4A4F-AB94-038645A27118}.Release|AnyCPU.Build.0 = Release|Any CPU - {E0890301-F75F-40E7-B008-54C28B3BA542}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {E0890301-F75F-40E7-B008-54C28B3BA542}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {E0890301-F75F-40E7-B008-54C28B3BA542}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {E0890301-F75F-40E7-B008-54C28B3BA542}.Release|AnyCPU.Build.0 = Release|Any CPU - {A87352E6-CE7F-4346-B6B1-586AE931C0A7}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {A87352E6-CE7F-4346-B6B1-586AE931C0A7}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {A87352E6-CE7F-4346-B6B1-586AE931C0A7}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {A87352E6-CE7F-4346-B6B1-586AE931C0A7}.Release|AnyCPU.Build.0 = Release|Any CPU - {94756FEB-1F64-411D-A18E-81B5158F776A}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {94756FEB-1F64-411D-A18E-81B5158F776A}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {94756FEB-1F64-411D-A18E-81B5158F776A}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {94756FEB-1F64-411D-A18E-81B5158F776A}.Release|AnyCPU.Build.0 = Release|Any CPU - {73DF9E10-E933-4222-B8E1-F4536FFF9FAD}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {73DF9E10-E933-4222-B8E1-F4536FFF9FAD}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {73DF9E10-E933-4222-B8E1-F4536FFF9FAD}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {73DF9E10-E933-4222-B8E1-F4536FFF9FAD}.Release|AnyCPU.Build.0 = Release|Any CPU {66CF299A-CE95-4131-BCD8-DB66E30C4BF7}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU {66CF299A-CE95-4131-BCD8-DB66E30C4BF7}.Debug|AnyCPU.Build.0 = Debug|Any CPU {66CF299A-CE95-4131-BCD8-DB66E30C4BF7}.Release|AnyCPU.ActiveCfg = Release|Any CPU @@ -297,18 +269,10 @@ Global {A0AEF446-3368-4591-9DE6-BC3B2B33337D}.Debug|AnyCPU.Build.0 = Debug|Any CPU {A0AEF446-3368-4591-9DE6-BC3B2B33337D}.Release|AnyCPU.ActiveCfg = Release|Any CPU {A0AEF446-3368-4591-9DE6-BC3B2B33337D}.Release|AnyCPU.Build.0 = Release|Any CPU - {D93CAC27-3893-42A3-99F1-2BCA72E186F4}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {D93CAC27-3893-42A3-99F1-2BCA72E186F4}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {D93CAC27-3893-42A3-99F1-2BCA72E186F4}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {D93CAC27-3893-42A3-99F1-2BCA72E186F4}.Release|AnyCPU.Build.0 = Release|Any CPU {F3CFF31C-037B-450F-B22D-1D6E529B2DCC}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU {F3CFF31C-037B-450F-B22D-1D6E529B2DCC}.Debug|AnyCPU.Build.0 = Debug|Any CPU {F3CFF31C-037B-450F-B22D-1D6E529B2DCC}.Release|AnyCPU.ActiveCfg = Release|Any CPU {F3CFF31C-037B-450F-B22D-1D6E529B2DCC}.Release|AnyCPU.Build.0 = Release|Any CPU - {DBDC804F-8406-4F5E-83C6-720CB0CB6C6F}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {DBDC804F-8406-4F5E-83C6-720CB0CB6C6F}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {DBDC804F-8406-4F5E-83C6-720CB0CB6C6F}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {DBDC804F-8406-4F5E-83C6-720CB0CB6C6F}.Release|AnyCPU.Build.0 = Release|Any CPU {16DB2680-399B-4111-AA26-6CDBBFA334D8}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU {16DB2680-399B-4111-AA26-6CDBBFA334D8}.Debug|AnyCPU.Build.0 = Debug|Any CPU {16DB2680-399B-4111-AA26-6CDBBFA334D8}.Release|AnyCPU.ActiveCfg = Release|Any CPU @@ -419,10 +383,6 @@ Global {38C762AB-8FD1-44DE-9855-26AAE7129DC3} = {864062D3-A415-4A6F-9324-5820237BA058} {7387E151-48E3-4885-B2CA-A74434A34045} = {864062D3-A415-4A6F-9324-5820237BA058} {8A6CB07C-E493-4A4F-AB94-038645A27118} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62} - {E0890301-F75F-40E7-B008-54C28B3BA542} = {864062D3-A415-4A6F-9324-5820237BA058} - {A87352E6-CE7F-4346-B6B1-586AE931C0A7} = {864062D3-A415-4A6F-9324-5820237BA058} - {94756FEB-1F64-411D-A18E-81B5158F776A} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62} - {73DF9E10-E933-4222-B8E1-F4536FFF9FAD} = {864062D3-A415-4A6F-9324-5820237BA058} {66CF299A-CE95-4131-BCD8-DB66E30C4BF7} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {B8105878-D423-4159-A3E7-028298281EC6} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {43564FB3-0F79-4FF4-A2B0-B1637072FF01} = {04E3E11E-B47D-4599-8AFC-50515A95E715} @@ -433,9 +393,7 @@ Global {AF8AC493-40AC-4195-82F6-B08EE4B4E49E} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {0C31DE30-F9DF-4312-BFFE-DCAD558CCF08} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {A0AEF446-3368-4591-9DE6-BC3B2B33337D} = {04E3E11E-B47D-4599-8AFC-50515A95E715} - {D93CAC27-3893-42A3-99F1-2BCA72E186F4} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62} {F3CFF31C-037B-450F-B22D-1D6E529B2DCC} = {864062D3-A415-4A6F-9324-5820237BA058} - {DBDC804F-8406-4F5E-83C6-720CB0CB6C6F} = {864062D3-A415-4A6F-9324-5820237BA058} {16DB2680-399B-4111-AA26-6CDBBFA334D8} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483} {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} = {05C3B1D6-A4CE-4534-A9E4-E9117591ADF7} {53DCA265-3C3C-42F9-B647-F72BA678122B} = {05C3B1D6-A4CE-4534-A9E4-E9117591ADF7} @@ -466,8 +424,6 @@ Global src\Xamarin.Android.NamingCustomAttributes\Xamarin.Android.NamingCustomAttributes.projitems*{74598f5c-b8cc-4ce6-8ee2-ab9ca1400076}*SharedItemsImports = 13 external\Java.Interop\src\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems*{d1295a8f-4f42-461d-a046-564476c10002}*SharedItemsImports = 5 external\Java.Interop\src\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems*{d18fcf91-8876-48a0-a693-2dc1e7d3d80a}*SharedItemsImports = 5 - external\Java.Interop\src\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems*{e0890301-f75f-40e7-b008-54c28b3ba542}*SharedItemsImports = 5 - external\Java.Interop\src\Java.Interop.Tools.TypeNameMappings\Java.Interop.Tools.TypeNameMappings.projitems*{e0890301-f75f-40e7-b008-54c28b3ba542}*SharedItemsImports = 5 external\Java.Interop\src\Java.Interop.NamingCustomAttributes\Java.Interop.NamingCustomAttributes.projitems*{fe789f04-5e95-42c5-aef1-e33f8df06b3f}*SharedItemsImports = 13 EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution diff --git a/build-tools/proprietary/proprietary.csproj b/build-tools/proprietary/proprietary.csproj deleted file mode 100644 index 30b027fde38..00000000000 --- a/build-tools/proprietary/proprietary.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - netstandard2.0 - False - False - ..\..\bin\$(Configuration) - - - - - diff --git a/build-tools/proprietary/proprietary.projitems b/build-tools/proprietary/proprietary.projitems deleted file mode 100644 index 9789a987630..00000000000 --- a/build-tools/proprietary/proprietary.projitems +++ /dev/null @@ -1,46 +0,0 @@ - - - - <_SourceDir Condition=" '$(HostOS)' == 'Darwin' ">\Library\Frameworks\Xamarin.Android.framework\Versions\Current\lib\xamarin.android\xbuild\Xamarin\Android\ - <_SourceDir Condition=" !Exists('$(_SourceDir)') ">$(MSBuildExtensionsPath)\Xamarin\Android\ - <_DestinationDir>lib\xamarin.android\xbuild\Xamarin\Android\ - - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(Filename)%(Extension) - PreserveNewest - - - $(_DestinationDir)%(RecursiveDir)%(Filename)%(Extension) - PreserveNewest - - - \ No newline at end of file diff --git a/build-tools/proprietary/proprietary.targets b/build-tools/proprietary/proprietary.targets deleted file mode 100644 index c139ff414fe..00000000000 --- a/build-tools/proprietary/proprietary.targets +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - <_FilesToDelete Include="@(Content->'$(OutputPath)\%(Link)')" /> - - - - diff --git a/tools/setup-windows/SetupWindows.cs b/tools/setup-windows/SetupWindows.cs deleted file mode 100644 index ac6713bedc9..00000000000 --- a/tools/setup-windows/SetupWindows.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; - -namespace Xamarin.Android.Tools -{ - enum SymbolLinkFlag { - File = 0, - Directory = 1, - } - - class SymbolicLink - { - public string Source { get; set; } - - public string Target { get; set; } - - public bool IsFile { get; set; } - - public SymbolLinkFlag Flag => IsFile ? SymbolLinkFlag.File : SymbolLinkFlag.Directory; - } - - class SetupWindows - { - static string AppName; - - public static int Main (string [] args) - { - // appPath is expected to be similar to: oss-xamarin.anroid-*/bin/Debug/bin/setup-windows.exe - var appPath = typeof (SetupWindows).Assembly.Location; - AppName = Path.GetFileName (appPath); - var appDir = Path.GetDirectoryName (appPath); - if (Path.GetFileName (appDir) != "bin") { - Console.Error.WriteLine ($"{AppName}: This program must be run from the `bin` directory."); - return 1; - } - // prefix should be: oss-xamarin.anroid-*/bin/Debug - var prefix = Path.GetDirectoryName (appDir); - var hash = XAZipFolderNameToHash (Path.GetFileName (Path.GetDirectoryName (Path.GetDirectoryName (prefix)))); - var newAssemblies = Path.Combine (prefix, "lib", "xamarin.android", "xbuild-frameworks", "MonoAndroid"); - - var links = new List (); - var progFiles = Environment.GetEnvironmentVariable ("ProgramFiles(x86)"); - var vsInstall = Environment.GetEnvironmentVariable ("VSINSTALLDIR"); - - if (string.IsNullOrEmpty (vsInstall)) { - vsInstall = progFiles; - } else { - links.Add (new SymbolicLink { - Source = Path.Combine (vsInstall, "Common7", "IDE", "ReferenceAssemblies", "Microsoft", "Framework", "MonoAndroid"), - Target = newAssemblies, - }); - } - - links.Add (new SymbolicLink { - Source = Path.Combine (progFiles, "Reference Assemblies", "Microsoft", "Framework", "MonoAndroid"), - Target = newAssemblies, - }); - links.Add (new SymbolicLink { - Source = Path.Combine (vsInstall, "MSBuild", "Xamarin", "Android"), - Target = Path.Combine (prefix, "lib", "xamarin.android", "xbuild", "Xamarin", "Android"), - }); - links.Add (new SymbolicLink { - Source = Path.Combine (vsInstall, "MSBuild", "Xamarin", "Xamarin.Android.Sdk.props"), - Target = Path.Combine (prefix, "lib", "xamarin.android", "xbuild", "Xamarin", "Xamarin.Android.Sdk.props"), - IsFile = true, - }); - links.Add (new SymbolicLink { - Source = Path.Combine (vsInstall, "MSBuild", "Xamarin", "Xamarin.Android.Sdk.targets"), - Target = Path.Combine (prefix, "lib", "xamarin.android", "xbuild", "Xamarin", "Xamarin.Android.Sdk.targets"), - IsFile = true, - }); - - if (Path.DirectorySeparatorChar != '\\') { - Console.Error.WriteLine ($"{AppName}: This program is for use on Windows."); - return 1; - } - - if (args.Length == 0 || args.Any (v => string.Equals (v, "install", StringComparison.OrdinalIgnoreCase) || string.Equals (v, "/install", StringComparison.OrdinalIgnoreCase))) { - return Install (hash, links); - } - if (args.Any (v => string.Equals (v, "uninstall", StringComparison.OrdinalIgnoreCase) || string.Equals (v, "/uninstall", StringComparison.OrdinalIgnoreCase))) { - return Uninstall (hash, links); - } - Console.Error.WriteLine ($"{AppName}: Invalid command `{string.Join (" ", args)}`."); - return 1; - } - - static int Install (string hash, List links) - { - try { - foreach (var link in links) { - var backup = GetNewBackupName (link.Source, hash); - Directory.CreateDirectory (Path.GetDirectoryName (link.Source)); - if (!CreateSymbolicLink (link, backup)) { - return 1; - } - } - - Console.WriteLine ("Success!"); - return 0; - } - catch (UnauthorizedAccessException e) { - Console.Error.WriteLine ($"{AppName}: {e.Message}"); - Console.Error.WriteLine (e.ToString ()); - return 1; - } - catch (Exception e) { - Console.Error.WriteLine ($"{AppName}: {e.Message}"); - Console.Error.WriteLine (e); - return 1; - } - } - - // XAZipFolderName is build-tools/scripts/BuildEverything.mk!$(ZIP_OUTPUT_BASENAME), - // oss-xamarin.android_v$(PRODUCT_VERSION).$(-num-commits-since-version-change)_$(OS)-$(OS_ARCH)_$(GIT_BRANCH)_$(GIT_COMMIT) - static string XAZipFolderNameToHash (string folderName) - { - var r = new Regex (@"^oss-xamarin.android_v(?[^_]+)_(?[^-]+)-(?[^_]+)_(?.*)_(?[A-Za-z0-9]+)$"); - var m = r.Match (folderName); - if (!m.Success) - return "Unknown"; - return m.Groups ["commit"].Value; - } - - static string GetNewBackupName (string folder, string hash) - { - return GetBackupNames (folder, hash).First (d => !Directory.Exists (d)); - } - - static IEnumerable GetBackupNames (string folder, string hash) - { - folder = GetBackupNamePrefix (folder, hash); - yield return folder; - int count = 1; - while (true) { - yield return $"{folder}+{count}"; - count++; - } - } - - static string GetBackupNamePrefix (string folder, string hash) - { - return folder + ".pre-" + hash; - } - - static bool CreateSymbolicLink (SymbolicLink link, string backup) - { - if (link.IsFile) { - Console.WriteLine ($"Executing: MKLINK \"{link.Source}\" \"{link.Target}\""); - if (File.Exists (link.Source)) { - File.Move (link.Source, backup); - } - } else { - Console.WriteLine ($"Executing: MKLINK /D \"{link.Source}\" \"{link.Target}\""); - if (Directory.Exists (link.Source)) { - Directory.Move (link.Source, backup); - } - } - if (!CreateSymbolicLink (link.Source, link.Target, link.Flag)) { - var error = new Win32Exception (Marshal.GetLastWin32Error ()).Message; - Console.Error.WriteLine ($"{AppName}: Unable to create symbolic link from `{link.Source}` to `{link.Target}`: {error}"); - if (link.IsFile) { - File.Move (backup, link.Source); - } else { - Directory.Move (backup, link.Source); - } - return false; - } - return true; - } - - static int Uninstall (string hash, List links) - { - foreach (var link in links) { - var backup = GetExistingBackupName (link.Source, hash); - if (link.IsFile) { - File.Delete (link.Source); - if (backup != null && File.Exists (backup)) { - File.Move (backup, link.Source); - } - } else { - Directory.Delete (link.Source); - if (backup != null && Directory.Exists (backup)) { - Directory.Move (backup, link.Source); - } - } - } - return 0; - } - - static string GetExistingBackupName (string folder, string hash) - { - var prefix = GetBackupNamePrefix (folder, hash); - var path = Path.GetDirectoryName (prefix); - var pattern = Path.GetFileName (prefix) + "*.*"; - return Directory.EnumerateFileSystemEntries (path, pattern, SearchOption.TopDirectoryOnly) - .FirstOrDefault (); - } - - [DllImport ("kernel32.dll")] - [return: MarshalAs (UnmanagedType.I1)] - static extern bool CreateSymbolicLink (string lpSymlinkFileName, string lpTargetFileName, SymbolLinkFlag dwFlags); - } -} diff --git a/tools/setup-windows/setup-windows.csproj b/tools/setup-windows/setup-windows.csproj deleted file mode 100644 index 970eb7629fc..00000000000 --- a/tools/setup-windows/setup-windows.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - $(DotNetStableTargetFramework) - false - Exe - setupwindows - setup-windows - $(XamarinAndroidSourcePath)bin\$(Configuration)\bin\ - -