aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.BuildTasks/HeatTask_InProc.cs
blob: eb6feafc2c717b0d5c364a2cf079db0800c4e91e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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.

#if !NETCOREAPP
namespace WixToolset.BuildTasks
{
    using WixToolset.Extensibility;
    using WixToolset.Extensibility.Data;
    using WixToolset.Extensibility.Services;
    using WixToolset.Harvesters;

    public partial class HeatTask
    {
        protected sealed override string TaskShortName => "HEAT";

        protected sealed override int ExecuteCore(IWixToolsetServiceProvider serviceProvider, IMessageListener listener, string commandLineString)
        {
            var messaging = serviceProvider.GetService<IMessaging>();
            messaging.SetListener(listener);

            var arguments = serviceProvider.GetService<ICommandLineArguments>();
            arguments.Populate(commandLineString);

            var commandLine = HeatCommandLineFactory.CreateCommandLine(serviceProvider, true);
            var command = commandLine.ParseStandardCommandLine(arguments);
            return command?.Execute() ?? -1;
        }
    }
}
#endif