Making ProjectDependenciesCommandResolver handle msbuild projects as well by using the ProjectFactory and IProject.
Moving the CommandResolution classes that depend on msbuild back into Cli.Utils. Updating the src projects to a netstandard compatible with Cli.Utils moving to netstandard1.5
This commit is contained in:
parent
a97d44eded
commit
318c9f3e44
49 changed files with 859 additions and 331 deletions
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||
{
|
||||
public class RepoDirectoriesProvider
|
||||
{
|
||||
private static string s_repoRoot;
|
||||
|
||||
private string _artifacts;
|
||||
private string _builtDotnet;
|
||||
private string _nugetPackages;
|
||||
private string _corehostPackages;
|
||||
private string _corehostDummyPackages;
|
||||
private string _stage2Sdk;
|
||||
private string _testPackages;
|
||||
|
||||
public static string RepoRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s_repoRoot))
|
||||
{
|
||||
return s_repoRoot;
|
||||
}
|
||||
|
||||
#if NET451
|
||||
string directory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
#else
|
||||
string directory = AppContext.BaseDirectory;
|
||||
#endif
|
||||
|
||||
while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null)
|
||||
{
|
||||
directory = Directory.GetParent(directory).FullName;
|
||||
}
|
||||
|
||||
if (directory == null)
|
||||
{
|
||||
throw new Exception("Cannot find the git repository root");
|
||||
}
|
||||
|
||||
s_repoRoot = directory;
|
||||
return s_repoRoot;
|
||||
}
|
||||
}
|
||||
|
||||
public string Artifacts => _artifacts;
|
||||
public string BuiltDotnet => _builtDotnet;
|
||||
public string NugetPackages => _nugetPackages;
|
||||
public string CorehostPackages => _corehostPackages;
|
||||
public string CorehostDummyPackages => _corehostDummyPackages;
|
||||
public string Stage2Sdk => _stage2Sdk;
|
||||
public string TestPackages => _testPackages;
|
||||
|
||||
public RepoDirectoriesProvider(
|
||||
string artifacts = null,
|
||||
string builtDotnet = null,
|
||||
string nugetPackages = null,
|
||||
string corehostPackages = null,
|
||||
string corehostDummyPackages = null)
|
||||
{
|
||||
var currentRid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
||||
|
||||
_artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", currentRid);
|
||||
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
|
||||
_corehostPackages = corehostPackages ?? Path.Combine(_artifacts, "corehost");
|
||||
_corehostDummyPackages = corehostDummyPackages ?? Path.Combine(_artifacts, "corehostdummypackages");
|
||||
_builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish");
|
||||
_stage2Sdk = Directory.EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")).First();
|
||||
_testPackages = Path.Combine(_artifacts, "tests", "packages");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue