Minor code clean up
Rob Mensching committed
Oct 4, 2022 at 21:29 UTC
e2336c921976cb0c222f8b3e7d5be269f028e2cb
3 files changed
+11
-19
src/wix/WixToolset.BuildTasks/ToolsetTask.cs
+11
-12
@@ -9,10 +9,11 @@ namespace WixToolset.BuildTasks
9
10
public abstract partial class ToolsetTask : ToolTask
11
{
12
-#if NETFRAMEWORK
13
- private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath;
14
-#else
12
+#if NETCOREAPP
13
+ private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet";
14
private static readonly string ThisDllPath = typeof(ToolsetTask).Assembly.Location;
15
+#else
16
+ private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath;
17
#endif
18
19
/// <summary>
@@ -84,19 +85,19 @@ namespace WixToolset.BuildTasks
85
/// </remarks>
86
protected sealed override string GenerateFullPathToTool()
87
{
87
-#if !NETCOREAPP
88
+#if NETCOREAPP
89
+ if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath))
90
+ {
91
+ return toolFullPath;
92
+ }
93
+ return DotnetFullPath;
94
+#else
95
if (!this.RunAsSeparateProcess)
96
{
97
// 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.
98
return ThisDllPath;
99
}
100
return this.DefaultToolFullPath;
94
-#else
95
- if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath))
96
- {
97
- return toolFullPath;
98
- }
99
- return DotnetFullPath;
101
#endif
102
}
103
@@ -124,8 +125,6 @@ namespace WixToolset.BuildTasks
125
}
126
127
#if NETCOREAPP
127
- private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet";
128
-
128
protected override string GenerateCommandLineCommands()
129
{
130
if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath))
src/wix/WixToolset.BuildTasks/WixBuild.cs
-6
@@ -30,7 +30,6 @@ namespace WixToolset.BuildTasks
30
31
public ITaskItem[] LibraryFiles { get; set; }
32
33
- [Output]
33
[Required]
34
public ITaskItem OutputFile { get; set; }
35
@@ -47,7 +46,6 @@ namespace WixToolset.BuildTasks
46
47
public string[] ReferencePaths { get; set; }
48
50
-
49
public ITaskItem[] BindInputPaths { get; set; }
50
51
public bool BindFiles { get; set; }
@@ -60,9 +58,6 @@ namespace WixToolset.BuildTasks
58
59
public string DefaultCompressionLevel { get; set; }
60
63
- [Output]
64
- public ITaskItem UnreferencedSymbolsFile { get; set; }
65
-
61
public ITaskItem WixProjectFile { get; set; }
62
63
public string[] WixVariables { get; set; }
@@ -80,7 +75,6 @@ namespace WixToolset.BuildTasks
75
commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants);
76
commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths);
77
commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths);
83
- commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile);
78
commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath);
79
commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory);
80
commandLineBuilder.AppendSwitchIfNotNull("-trackingfile ", this.BindTrackingFile);
src/wix/WixToolset.Sdk/tools/wix.targets
-1
@@ -652,7 +652,6 @@
652
CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
653
DefaultCompressionLevel="$(DefaultCompressionLevel)"
654
655
- UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)"
655
WixProjectFile="$(ProjectPath)"
656
WixVariables="$(WixVariables)"
657