From c843b47d6233153fa961c6d0e61edf7cedf255bb Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 8 Nov 2022 14:58:05 -0800 Subject: Separate WixInternal content from official WixToolset namespace --- .../WixBuildTools.TestSupport/DotnetRunner.cs | 57 ---------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/internal/WixBuildTools.TestSupport/DotnetRunner.cs (limited to 'src/internal/WixBuildTools.TestSupport/DotnetRunner.cs') diff --git a/src/internal/WixBuildTools.TestSupport/DotnetRunner.cs b/src/internal/WixBuildTools.TestSupport/DotnetRunner.cs deleted file mode 100644 index 82391178..00000000 --- a/src/internal/WixBuildTools.TestSupport/DotnetRunner.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixBuildTools.TestSupport -{ - using System; - using System.Collections.Generic; - using System.IO; - - public class DotnetRunner : ExternalExecutable - { - private static readonly object InitLock = new object(); - private static bool Initialized; - private static DotnetRunner Instance; - - public static ExternalExecutableResult Execute(string command, string[] arguments = null) => - InitAndExecute(command, arguments); - - private static ExternalExecutableResult InitAndExecute(string command, string[] arguments) - { - lock (InitLock) - { - if (!Initialized) - { - Initialized = true; - var dotnetPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); - if (String.IsNullOrEmpty(dotnetPath) || !File.Exists(dotnetPath)) - { - dotnetPath = "dotnet"; - } - - Instance = new DotnetRunner(dotnetPath); - } - } - - return Instance.ExecuteCore(command, arguments); - } - - private DotnetRunner(string exePath) : base(exePath) { } - - private ExternalExecutableResult ExecuteCore(string command, string[] arguments) - { - var total = new List - { - command, - }; - - if (arguments != null) - { - total.AddRange(arguments); - } - - var args = CombineArguments(total); - var mergeErrorIntoOutput = true; - return this.Run(args, mergeErrorIntoOutput); - } - } -} -- cgit v1.2.3-55-g6feb