From e2336c921976cb0c222f8b3e7d5be269f028e2cb Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 4 Oct 2022 21:29:42 -0700 Subject: Minor code clean up --- src/wix/WixToolset.BuildTasks/ToolsetTask.cs | 23 +++++++++++------------ src/wix/WixToolset.BuildTasks/WixBuild.cs | 6 ------ src/wix/WixToolset.Sdk/tools/wix.targets | 1 - 3 files changed, 11 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/wix/WixToolset.BuildTasks/ToolsetTask.cs b/src/wix/WixToolset.BuildTasks/ToolsetTask.cs index 05095fb8..7d4a7687 100644 --- a/src/wix/WixToolset.BuildTasks/ToolsetTask.cs +++ b/src/wix/WixToolset.BuildTasks/ToolsetTask.cs @@ -9,10 +9,11 @@ namespace WixToolset.BuildTasks public abstract partial class ToolsetTask : ToolTask { -#if NETFRAMEWORK - private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; -#else +#if NETCOREAPP + private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; private static readonly string ThisDllPath = typeof(ToolsetTask).Assembly.Location; +#else + private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; #endif /// @@ -84,19 +85,19 @@ namespace WixToolset.BuildTasks /// protected sealed override string GenerateFullPathToTool() { -#if !NETCOREAPP +#if NETCOREAPP + if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath)) + { + return toolFullPath; + } + return DotnetFullPath; +#else if (!this.RunAsSeparateProcess) { // We need to return a path that exists, so if we're not actually going to run the tool then just return this dll path. return ThisDllPath; } return this.DefaultToolFullPath; -#else - if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath)) - { - return toolFullPath; - } - return DotnetFullPath; #endif } @@ -124,8 +125,6 @@ namespace WixToolset.BuildTasks } #if NETCOREAPP - private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet"; - protected override string GenerateCommandLineCommands() { if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) diff --git a/src/wix/WixToolset.BuildTasks/WixBuild.cs b/src/wix/WixToolset.BuildTasks/WixBuild.cs index 11de0242..5c3b9a48 100644 --- a/src/wix/WixToolset.BuildTasks/WixBuild.cs +++ b/src/wix/WixToolset.BuildTasks/WixBuild.cs @@ -30,7 +30,6 @@ namespace WixToolset.BuildTasks public ITaskItem[] LibraryFiles { get; set; } - [Output] [Required] public ITaskItem OutputFile { get; set; } @@ -47,7 +46,6 @@ namespace WixToolset.BuildTasks public string[] ReferencePaths { get; set; } - public ITaskItem[] BindInputPaths { get; set; } public bool BindFiles { get; set; } @@ -60,9 +58,6 @@ namespace WixToolset.BuildTasks public string DefaultCompressionLevel { get; set; } - [Output] - public ITaskItem UnreferencedSymbolsFile { get; set; } - public ITaskItem WixProjectFile { get; set; } public string[] WixVariables { get; set; } @@ -80,7 +75,6 @@ namespace WixToolset.BuildTasks commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); - commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile); commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); commandLineBuilder.AppendSwitchIfNotNull("-trackingfile ", this.BindTrackingFile); diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets index f3e04d9a..9d820c9c 100644 --- a/src/wix/WixToolset.Sdk/tools/wix.targets +++ b/src/wix/WixToolset.Sdk/tools/wix.targets @@ -652,7 +652,6 @@ CabinetCreationThreadCount="$(CabinetCreationThreadCount)" DefaultCompressionLevel="$(DefaultCompressionLevel)" - UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)" WixProjectFile="$(ProjectPath)" WixVariables="$(WixVariables)" -- cgit v1.2.3-55-g6feb