2016-07-15 15:31:50 +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.
|
2016-07-13 00:10:48 +00:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
|
|
|
{
|
|
|
|
|
public class DotNetRestore : DotNetTool
|
|
|
|
|
{
|
|
|
|
|
protected override string Command
|
|
|
|
|
{
|
|
|
|
|
get { return "restore"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string Args
|
|
|
|
|
{
|
2016-07-26 04:29:59 +00:00
|
|
|
|
get { return $"{GetVerbosity()} {GetFallbackSource()} {GetPackages()}"; }
|
2016-07-13 00:10:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string FallbackSource { get; set; }
|
|
|
|
|
|
2016-07-26 04:29:59 +00:00
|
|
|
|
public string Packages { get; set; }
|
|
|
|
|
|
2016-07-13 00:10:48 +00:00
|
|
|
|
public string Verbosity { get; set; }
|
|
|
|
|
|
|
|
|
|
private string GetFallbackSource()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(FallbackSource))
|
|
|
|
|
{
|
|
|
|
|
return $"--fallbacksource {FallbackSource}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-26 04:29:59 +00:00
|
|
|
|
private string GetPackages()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(Packages))
|
|
|
|
|
{
|
|
|
|
|
return $"--packages {Packages}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-13 00:10:48 +00:00
|
|
|
|
private string GetVerbosity()
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(Verbosity))
|
|
|
|
|
{
|
|
|
|
|
return $"--verbosity {Verbosity}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|