Piotrp msft/msbuild/incremental test (#3842)

* Incremental Testing - Part 1

* Fix 'clean' bug

* Remove --fallbacksource from TestAssetPackage restore.
This commit is contained in:
Piotr Puszkiewicz 2016-07-12 17:10:48 -07:00 committed by GitHub
parent caa4cf373c
commit 16bedef2c5
7 changed files with 457 additions and 149 deletions

View file

@ -0,0 +1,66 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace Microsoft.DotNet.Cli.Build
{
public class DotNetBuild : DotNetTool
{
protected override string Command
{
get { return "build"; }
}
protected override string Args
{
get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetBuildBasePath()}"; }
}
public string BuildBasePath { get; set; }
public string Configuration { get; set; }
public string Framework { get; set; }
public string ProjectPath { get; set; }
private string GetBuildBasePath()
{
if (!string.IsNullOrEmpty(BuildBasePath))
{
return $"--build-base-path {BuildBasePath}";
}
return null;
}
private string GetConfiguration()
{
if (!string.IsNullOrEmpty(Configuration))
{
return $"--configuration {Configuration}";
}
return null;
}
private string GetFramework()
{
if (!string.IsNullOrEmpty(Framework))
{
return $"--framework {Framework}";
}
return null;
}
private string GetProjectPath()
{
if (!string.IsNullOrEmpty(ProjectPath))
{
return $"{ProjectPath}";
}
return null;
}
}
}