MSBuildProjectDescriptions has dedicated property for the csproj path

This commit is contained in:
Mihai Codoban 2016-03-30 14:00:45 -07:00
parent ec5f88e994
commit 9cc3d088f0
2 changed files with 14 additions and 13 deletions

View file

@ -9,17 +9,19 @@ namespace Microsoft.DotNet.ProjectModel
{
/// <summary>
/// Represents an MSBuild project.
/// It has been invisibly built by MSBuild, so it behaves like a package: can provide all assets up front
/// It has been built by MSBuild, so it behaves like a package: can provide all assets up front
///
/// The Path represents the path to the project.json, if there is one near the csproj file.
/// </summary>
public class MSBuildProjectDescription : TargetLibraryWithAssets
{
public MSBuildProjectDescription(
string path,
LockFileProjectLibrary projectLibrary,
LockFileTargetLibrary lockFileLibrary,
Project projectFile,
IEnumerable<LibraryRange> dependencies,
bool compatible,
string path,
string msbuildProjectPath,
LockFileProjectLibrary projectLibrary,
LockFileTargetLibrary lockFileLibrary,
IEnumerable<LibraryRange> dependencies,
bool compatible,
bool resolved)
: base(
new LibraryIdentity(projectLibrary.Name, projectLibrary.Version, LibraryType.MSBuildProject),
@ -31,12 +33,11 @@ namespace Microsoft.DotNet.ProjectModel
compatible: compatible,
framework: null)
{
ProjectFile = projectFile;
ProjectLibrary = projectLibrary;
MsbuildProjectPath = msbuildProjectPath;
}
public LockFileProjectLibrary ProjectLibrary { get; }
public Project ProjectFile { get; }
public string MsbuildProjectPath { get; set; }
}
}

View file

@ -36,12 +36,12 @@ namespace Microsoft.DotNet.ProjectModel.Resolution
var projectFile = projectLibrary.Path == null ? null : _projectResolver(projectLibrary.Path);
var msbuildPackageDescription = new MSBuildProjectDescription(
projectLibrary.Path,
msbuildProjectPath,
projectLibrary,
targetLibrary,
projectFile,
dependencies,
compatible,
dependencies,
compatible,
resolved: compatible && exists);
return msbuildPackageDescription;