diff options
| author | Bob Arnson <bob@firegiant.com> | 2025-04-24 21:32:49 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2025-06-12 08:54:41 -0400 |
| commit | 3abf00a71151d1caef6e853a2f330d7691f4abf8 (patch) | |
| tree | 0e6145c8038905aec81ecccaea4c6968cf73d392 /src/tools/heat/HeatCommandLine.cs | |
| parent | 796fed6b2623ec29b126238d97becfef71badfbc (diff) | |
| download | wix-bob/HeatCremation.tar.gz wix-bob/HeatCremation.tar.bz2 wix-bob/HeatCremation.zip | |
Remove deprecated Heat.bob/HeatCremation
Fixes https://github.com/wixtoolset/issues/issues/9039
Diffstat (limited to '')
| -rw-r--r-- | src/tools/heat/HeatCommandLine.cs | 89 |
1 files changed, 0 insertions, 89 deletions
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 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Harvesters | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using System.Linq; | ||
| 8 | using WixToolset.Data; | ||
| 9 | using WixToolset.Extensibility.Data; | ||
| 10 | using WixToolset.Extensibility.Services; | ||
| 11 | using WixToolset.Harvesters.Data; | ||
| 12 | using WixToolset.Harvesters.Extensibility; | ||
| 13 | |||
| 14 | internal class HeatCommandLine : IHeatCommandLine | ||
| 15 | { | ||
| 16 | private readonly IServiceProvider serviceProvider; | ||
| 17 | private readonly List<IHeatExtension> extensions; | ||
| 18 | |||
| 19 | public HeatCommandLine(IServiceProvider serviceProvider, IEnumerable<IHeatExtension> heatExtensions) | ||
| 20 | { | ||
| 21 | this.serviceProvider = serviceProvider; | ||
| 22 | this.extensions = new List<IHeatExtension> { new IIsHeatExtension(), new UtilHeatExtension(serviceProvider), new VSHeatExtension() }; | ||
| 23 | if (heatExtensions != null) | ||
| 24 | { | ||
| 25 | this.extensions.AddRange(heatExtensions); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | public ICommandLineCommand ParseStandardCommandLine(ICommandLineArguments arguments) | ||
| 30 | { | ||
| 31 | ICommandLineCommand command = null; | ||
| 32 | var parser = arguments.Parse(); | ||
| 33 | |||
| 34 | while (command?.StopParsing != true && | ||
| 35 | String.IsNullOrEmpty(parser.ErrorArgument) && | ||
| 36 | parser.TryGetNextSwitchOrArgument(out var arg)) | ||
| 37 | { | ||
| 38 | if (String.IsNullOrWhiteSpace(arg)) // skip blank arguments. | ||
| 39 | { | ||
| 40 | continue; | ||
| 41 | } | ||
| 42 | |||
| 43 | // First argument must be the command or global switch (that creates a command). | ||
| 44 | if (command == null) | ||
| 45 | { | ||
| 46 | if (!this.TryParseUnknownCommandArg(arg, parser, out command)) | ||
| 47 | { | ||
| 48 | parser.ReportErrorArgument(arg, ErrorMessages.HarvestTypeNotFound(arg)); | ||
| 49 | } | ||
| 50 | } | ||
| 51 | else if (!command.TryParseArgument(parser, arg)) | ||
| 52 | { | ||
| 53 | parser.ReportErrorArgument(arg); | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | return command ?? new HelpCommand(this.extensions); | ||
| 58 | } | ||
| 59 | |||
| 60 | public bool TryParseUnknownCommandArg(string arg, ICommandLineParser parser, out ICommandLineCommand command) | ||
| 61 | { | ||
| 62 | command = null; | ||
| 63 | |||
| 64 | if (parser.IsSwitch(arg)) | ||
| 65 | { | ||
| 66 | var parameter = arg.Substring(1); | ||
| 67 | switch (parameter.ToLowerInvariant()) | ||
| 68 | { | ||
| 69 | case "?": | ||
| 70 | case "h": | ||
| 71 | case "help": | ||
| 72 | command = new HelpCommand(this.extensions); | ||
| 73 | return true; | ||
| 74 | } | ||
| 75 | } | ||
| 76 | |||
| 77 | foreach (var heatExtension in this.extensions) | ||
| 78 | { | ||
| 79 | if (heatExtension.CommandLineTypes.Any(o => o.Option == arg)) | ||
| 80 | { | ||
| 81 | command = new HeatCommand(arg, this.extensions, this.serviceProvider); | ||
| 82 | return true; | ||
| 83 | } | ||
| 84 | } | ||
| 85 | |||
| 86 | return false; | ||
| 87 | } | ||
| 88 | } | ||
| 89 | } | ||
