2017-01-28 01:13:04 +00:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
using Microsoft.Build.Framework;
|
|
|
|
|
using Microsoft.Build.Utilities;
|
|
|
|
|
|
|
|
|
|
using Microsoft.DotNet.Cli.Build.Framework;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
|
|
|
{
|
|
|
|
|
public abstract class DotNetMSBuildTool : DotNetTool
|
|
|
|
|
{
|
2017-03-09 22:30:29 +00:00
|
|
|
|
public int MaxCpuCount { get; set; } = 0;
|
2017-01-28 01:13:04 +00:00
|
|
|
|
|
2017-03-09 22:30:29 +00:00
|
|
|
|
public string Verbosity { get; set; }
|
|
|
|
|
|
|
|
|
|
protected override string Args
|
|
|
|
|
{
|
2017-01-28 01:13:04 +00:00
|
|
|
|
get
|
|
|
|
|
{
|
2017-03-09 22:30:29 +00:00
|
|
|
|
return $"{GetVerbosityArg()} {GetMaxCpuCountArg()}";
|
|
|
|
|
}
|
2017-01-28 01:13:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string GetMaxCpuCountArg()
|
|
|
|
|
{
|
|
|
|
|
if (MaxCpuCount > 0)
|
|
|
|
|
{
|
|
|
|
|
return $"/m:{MaxCpuCount}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2017-03-09 22:30:29 +00:00
|
|
|
|
|
|
|
|
|
private string GetVerbosityArg()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(Verbosity))
|
|
|
|
|
{
|
|
|
|
|
return $"--verbosity:{Verbosity}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2017-01-28 01:13:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|