From 3abf00a71151d1caef6e853a2f330d7691f4abf8 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 24 Apr 2025 21:32:49 -0400 Subject: Remove deprecated Heat. Fixes https://github.com/wixtoolset/issues/issues/9039 --- src/tools/heat/HeatCommandLine.cs | 89 --------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 src/tools/heat/HeatCommandLine.cs (limited to 'src/tools/heat/HeatCommandLine.cs') diff --git a/src/tools/heat/HeatCommandLine.cs b/src/tools/heat/HeatCommandLine.cs deleted file mode 100644 index f299266d..00000000 --- a/src/tools/heat/HeatCommandLine.cs +++ /dev/null @@ -1,89 +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 WixToolset.Harvesters -{ - using System; - using System.Collections.Generic; - using System.Linq; - using WixToolset.Data; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - using WixToolset.Harvesters.Data; - using WixToolset.Harvesters.Extensibility; - - internal class HeatCommandLine : IHeatCommandLine - { - private readonly IServiceProvider serviceProvider; - private readonly List extensions; - - public HeatCommandLine(IServiceProvider serviceProvider, IEnumerable heatExtensions) - { - this.serviceProvider = serviceProvider; - this.extensions = new List { new IIsHeatExtension(), new UtilHeatExtension(serviceProvider), new VSHeatExtension() }; - if (heatExtensions != null) - { - this.extensions.AddRange(heatExtensions); - } - } - - public ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments) - { - ICommandLineCommand command = null; - var parser = arguments.Parse(); - - while (command?.StopParsing != true && - String.IsNullOrEmpty(parser.ErrorArgument) && - parser.TryGetNextSwitchOrArgument(out var arg)) - { - if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. - { - continue; - } - - // First argument must be the command or global switch (that creates a command). - if (command == null) - { - if (!this.TryParseUnknownCommandArg(arg, parser, out command)) - { - parser.ReportErrorArgument(arg, ErrorMessages.HarvestTypeNotFound(arg)); - } - } - else if (!command.TryParseArgument(parser, arg)) - { - parser.ReportErrorArgument(arg); - } - } - - return command ?? new HelpCommand(this.extensions); - } - - public bool TryParseUnknownCommandArg(string arg, ICommandLineParser parser, out ICommandLineCommand command) - { - command = null; - - if (parser.IsSwitch(arg)) - { - var parameter = arg.Substring(1); - switch (parameter.ToLowerInvariant()) - { - case "?": - case "h": - case "help": - command = new HelpCommand(this.extensions); - return true; - } - } - - foreach (var heatExtension in this.extensions) - { - if (heatExtension.CommandLineTypes.Any(o => o.Option == arg)) - { - command = new HeatCommand(arg, this.extensions, this.serviceProvider); - return true; - } - } - - return false; - } - } -} -- cgit v1.2.3-55-g6feb