aboutsummaryrefslogtreecommitdiff
path: root/src/heat/Program.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-06-10 08:11:09 -0700
committerRob Mensching <rob@firegiant.com>2020-06-10 08:16:55 -0700
commit74e57bee9f6d9029cbbb2977c18f02d8ec18c50c (patch)
treef8cb65b4868e4a366d19053d173aa181512e9a4e /src/heat/Program.cs
parent5edb291f102959e993123ee402d364df450206cf (diff)
downloadwix-74e57bee9f6d9029cbbb2977c18f02d8ec18c50c.tar.gz
wix-74e57bee9f6d9029cbbb2977c18f02d8ec18c50c.tar.bz2
wix-74e57bee9f6d9029cbbb2977c18f02d8ec18c50c.zip
Update MSBuild task to support async commands and push heat out of proc
Diffstat (limited to 'src/heat/Program.cs')
-rw-r--r--src/heat/Program.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/heat/Program.cs b/src/heat/Program.cs
index 38d6d401..30a82511 100644
--- a/src/heat/Program.cs
+++ b/src/heat/Program.cs
@@ -4,6 +4,8 @@ namespace WixToolset.Tools.Heat
4{ 4{
5 using System; 5 using System;
6 using System.Runtime.InteropServices; 6 using System.Runtime.InteropServices;
7 using System.Threading;
8 using System.Threading.Tasks;
7 using WixToolset.Core; 9 using WixToolset.Core;
8 using WixToolset.Data; 10 using WixToolset.Data;
9 using WixToolset.Extensibility; 11 using WixToolset.Extensibility;
@@ -23,7 +25,7 @@ namespace WixToolset.Tools.Heat
23 /// <param name="args">Commandline arguments for the application.</param> 25 /// <param name="args">Commandline arguments for the application.</param>
24 /// <returns>Returns the application error code.</returns> 26 /// <returns>Returns the application error code.</returns>
25 [MTAThread] 27 [MTAThread]
26 public static int Main(string[] args) 28 public static async Task<int> Main(string[] args)
27 { 29 {
28 var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider(); 30 var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider();
29 var listener = new ConsoleMessageListener("HEAT", "heat.exe"); 31 var listener = new ConsoleMessageListener("HEAT", "heat.exe");
@@ -31,7 +33,7 @@ namespace WixToolset.Tools.Heat
31 try 33 try
32 { 34 {
33 var program = new Program(); 35 var program = new Program();
34 return program.Run(serviceProvider, listener, args); 36 return await program.Run(serviceProvider, listener, args);
35 } 37 }
36 catch (WixException e) 38 catch (WixException e)
37 { 39 {
@@ -58,7 +60,7 @@ namespace WixToolset.Tools.Heat
58 /// <param name="serviceProvider">Service provider to use throughout this execution.</param> 60 /// <param name="serviceProvider">Service provider to use throughout this execution.</param>
59 /// <param name="args">The commandline arguments.</param> 61 /// <param name="args">The commandline arguments.</param>
60 /// <returns>Returns the application error code.</returns> 62 /// <returns>Returns the application error code.</returns>
61 public int Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args) 63 public Task<int> Run(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string[] args)
62 { 64 {
63 var messaging = serviceProvider.GetService<IMessaging>(); 65 var messaging = serviceProvider.GetService<IMessaging>();
64 messaging.SetListener(listener); 66 messaging.SetListener(listener);
@@ -68,7 +70,7 @@ namespace WixToolset.Tools.Heat
68 70
69 var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider); 71 var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider);
70 var command = commandLine.ParseStandardCommandLine(arguments); 72 var command = commandLine.ParseStandardCommandLine(arguments);
71 return command?.Execute() ?? 1; 73 return command?.ExecuteAsync(CancellationToken.None) ?? Task.FromResult(1);
72 } 74 }
73 } 75 }
74} 76}