aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-10-04 21:29:42 -0700
committerRob Mensching <rob@firegiant.com>2022-10-14 20:13:50 -0700
commite2336c921976cb0c222f8b3e7d5be269f028e2cb (patch)
tree9ad5e2b95b66964c33e76963aed4b18e85598299 /src
parent21a0685ef69e9d634600622b19ea970c6f58ef03 (diff)
downloadwix-e2336c921976cb0c222f8b3e7d5be269f028e2cb.tar.gz
wix-e2336c921976cb0c222f8b3e7d5be269f028e2cb.tar.bz2
wix-e2336c921976cb0c222f8b3e7d5be269f028e2cb.zip
Minor code clean up
Diffstat (limited to 'src')
-rw-r--r--src/wix/WixToolset.BuildTasks/ToolsetTask.cs23
-rw-r--r--src/wix/WixToolset.BuildTasks/WixBuild.cs6
-rw-r--r--src/wix/WixToolset.Sdk/tools/wix.targets1
3 files changed, 11 insertions, 19 deletions
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
9 9
10 public abstract partial class ToolsetTask : ToolTask 10 public abstract partial class ToolsetTask : ToolTask
11 { 11 {
12#if NETFRAMEWORK 12#if NETCOREAPP
13 private static readonly string ThisDllPath = new Uri(typeof(ToolsetTask).Assembly.CodeBase).AbsolutePath; 13 private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet";
14#else
15 private static readonly string ThisDllPath = typeof(ToolsetTask).Assembly.Location; 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;
16#endif 17#endif
17 18
18 /// <summary> 19 /// <summary>
@@ -84,19 +85,19 @@ namespace WixToolset.BuildTasks
84 /// </remarks> 85 /// </remarks>
85 protected sealed override string GenerateFullPathToTool() 86 protected sealed override string GenerateFullPathToTool()
86 { 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
88 if (!this.RunAsSeparateProcess) 95 if (!this.RunAsSeparateProcess)
89 { 96 {
90 // 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. 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.
91 return ThisDllPath; 98 return ThisDllPath;
92 } 99 }
93 return this.DefaultToolFullPath; 100 return this.DefaultToolFullPath;
94#else
95 if (IsSelfExecutable(this.DefaultToolFullPath, out var toolFullPath))
96 {
97 return toolFullPath;
98 }
99 return DotnetFullPath;
100#endif 101#endif
101 } 102 }
102 103
@@ -124,8 +125,6 @@ namespace WixToolset.BuildTasks
124 } 125 }
125 126
126#if NETCOREAPP 127#if NETCOREAPP
127 private static readonly string DotnetFullPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet";
128
129 protected override string GenerateCommandLineCommands() 128 protected override string GenerateCommandLineCommands()
130 { 129 {
131 if (IsSelfExecutable(this.ToolFullPath, out var toolFullPath)) 130 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
30 30
31 public ITaskItem[] LibraryFiles { get; set; } 31 public ITaskItem[] LibraryFiles { get; set; }
32 32
33 [Output]
34 [Required] 33 [Required]
35 public ITaskItem OutputFile { get; set; } 34 public ITaskItem OutputFile { get; set; }
36 35
@@ -47,7 +46,6 @@ namespace WixToolset.BuildTasks
47 46
48 public string[] ReferencePaths { get; set; } 47 public string[] ReferencePaths { get; set; }
49 48
50
51 public ITaskItem[] BindInputPaths { get; set; } 49 public ITaskItem[] BindInputPaths { get; set; }
52 50
53 public bool BindFiles { get; set; } 51 public bool BindFiles { get; set; }
@@ -60,9 +58,6 @@ namespace WixToolset.BuildTasks
60 58
61 public string DefaultCompressionLevel { get; set; } 59 public string DefaultCompressionLevel { get; set; }
62 60
63 [Output]
64 public ITaskItem UnreferencedSymbolsFile { get; set; }
65
66 public ITaskItem WixProjectFile { get; set; } 61 public ITaskItem WixProjectFile { get; set; }
67 62
68 public string[] WixVariables { get; set; } 63 public string[] WixVariables { get; set; }
@@ -80,7 +75,6 @@ namespace WixToolset.BuildTasks
80 commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants); 75 commandLineBuilder.AppendArrayIfNotNull("-d ", this.DefineConstants);
81 commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths); 76 commandLineBuilder.AppendArrayIfNotNull("-I ", this.IncludeSearchPaths);
82 commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths); 77 commandLineBuilder.AppendExtensions(this.Extensions, this.ExtensionDirectory, this.ReferencePaths);
83 commandLineBuilder.AppendSwitchIfNotNull("-usf ", this.UnreferencedSymbolsFile);
84 commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath); 78 commandLineBuilder.AppendSwitchIfNotNull("-cc ", this.CabinetCachePath);
85 commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory); 79 commandLineBuilder.AppendSwitchIfNotNull("-intermediatefolder ", this.IntermediateDirectory);
86 commandLineBuilder.AppendSwitchIfNotNull("-trackingfile ", this.BindTrackingFile); 80 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 @@
652 CabinetCreationThreadCount="$(CabinetCreationThreadCount)" 652 CabinetCreationThreadCount="$(CabinetCreationThreadCount)"
653 DefaultCompressionLevel="$(DefaultCompressionLevel)" 653 DefaultCompressionLevel="$(DefaultCompressionLevel)"
654 654
655 UnreferencedSymbolsFile="$(UnreferencedSymbolsFile)"
656 WixProjectFile="$(ProjectPath)" 655 WixProjectFile="$(ProjectPath)"
657 WixVariables="$(WixVariables)" 656 WixVariables="$(WixVariables)"
658 657