From 7558404a7e853aa98344e52ecffd2bf92d0b0afd Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 15 Mar 2022 14:03:38 -0700 Subject: Removal of dead scenarios/code The only reason to have "compile" command was to allow different compilation used to build the same code that would be included in the final output. This scenario is now supported by combining multiple compiles into .wixlibs and, optionally, including those .wixlibs into a single .wixlib. --- src/wix/WixToolset.Core/CommandLine/CommandLine.cs | 7 -- .../WixToolset.Core/CommandLine/CompileCommand.cs | 99 ---------------------- src/wix/WixToolset.Core/SourceFile.cs | 17 ---- 3 files changed, 123 deletions(-) delete mode 100644 src/wix/WixToolset.Core/CommandLine/CompileCommand.cs delete mode 100644 src/wix/WixToolset.Core/SourceFile.cs (limited to 'src') diff --git a/src/wix/WixToolset.Core/CommandLine/CommandLine.cs b/src/wix/WixToolset.Core/CommandLine/CommandLine.cs index 8913828b..cd3b2fe4 100644 --- a/src/wix/WixToolset.Core/CommandLine/CommandLine.cs +++ b/src/wix/WixToolset.Core/CommandLine/CommandLine.cs @@ -14,9 +14,6 @@ namespace WixToolset.Core.CommandLine Unknown, Build, Preprocess, - Compile, - Link, - Bind, Decompile, } @@ -165,10 +162,6 @@ namespace WixToolset.Core.CommandLine command = new BuildCommand(this.ServiceProvider); break; - case CommandTypes.Compile: - command = new CompileCommand(this.ServiceProvider); - break; - case CommandTypes.Decompile: command = new DecompileCommand(this.ServiceProvider); break; diff --git a/src/wix/WixToolset.Core/CommandLine/CompileCommand.cs b/src/wix/WixToolset.Core/CommandLine/CompileCommand.cs deleted file mode 100644 index 73e5bcbe..00000000 --- a/src/wix/WixToolset.Core/CommandLine/CompileCommand.cs +++ /dev/null @@ -1,99 +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.Core.CommandLine -{ - using System; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - - internal class CompileCommand : ICommandLineCommand - { - public CompileCommand(IServiceProvider serviceProvider) - { - this.ServiceProvider = serviceProvider; - this.Messaging = serviceProvider.GetService(); - this.ExtensionManager = serviceProvider.GetService(); - } - - public CompileCommand(IServiceProvider serviceProvider, IEnumerable sources, IDictionary preprocessorVariables, Platform platform) - { - this.ServiceProvider = serviceProvider; - this.Messaging = serviceProvider.GetService(); - this.ExtensionManager = serviceProvider.GetService(); - this.SourceFiles = sources; - this.PreprocessorVariables = preprocessorVariables; - this.Platform = platform; - } - - public bool ShowHelp { get; set; } - - public bool ShowLogo { get; set; } - - public bool StopParsing { get; } - - private IServiceProvider ServiceProvider { get; } - - private IMessaging Messaging { get; } - - private IExtensionManager ExtensionManager { get; } - - private IEnumerable SourceFiles { get; } - - private IDictionary PreprocessorVariables { get; } - - private Platform Platform { get; } - - public IReadOnlyCollection IncludeSearchPaths { get; } - - public bool TryParseArgument(ICommandLineParser parseHelper, string argument) - { - throw new NotImplementedException(); - } - - public Task ExecuteAsync(CancellationToken _) - { - foreach (var sourceFile in this.SourceFiles) - { - var context = this.ServiceProvider.GetService(); - context.Extensions = this.ExtensionManager.GetServices(); - context.Platform = this.Platform; - context.IncludeSearchPaths = this.IncludeSearchPaths; - context.SourcePath = sourceFile.SourcePath; - context.Variables = this.PreprocessorVariables; - - IPreprocessResult result = null; - try - { - var preprocessor = this.ServiceProvider.GetService(); - result = preprocessor.Preprocess(context); - } - catch (WixException e) - { - this.Messaging.Write(e.Error); - } - - if (this.Messaging.EncounteredError) - { - continue; - } - - var compileContext = this.ServiceProvider.GetService(); - compileContext.Extensions = this.ExtensionManager.GetServices(); - compileContext.Platform = this.Platform; - compileContext.Source = result?.Document; - - var compiler = this.ServiceProvider.GetService(); - var intermediate = compiler.Compile(compileContext); - - intermediate.Save(sourceFile.OutputPath); - } - - return Task.FromResult(0); - } - } -} diff --git a/src/wix/WixToolset.Core/SourceFile.cs b/src/wix/WixToolset.Core/SourceFile.cs deleted file mode 100644 index d7ea7a50..00000000 --- a/src/wix/WixToolset.Core/SourceFile.cs +++ /dev/null @@ -1,17 +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.Core -{ - internal class SourceFile - { - public SourceFile(string sourcePath, string outputPath) - { - this.SourcePath = sourcePath; - this.OutputPath = outputPath; - } - - public string OutputPath { get; } - - public string SourcePath { get; } - } -} -- cgit v1.2.3-55-g6feb