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> /// <summary>
/// Represents an MSBuild project. /// 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> /// </summary>
public class MSBuildProjectDescription : TargetLibraryWithAssets public class MSBuildProjectDescription : TargetLibraryWithAssets
{ {
public MSBuildProjectDescription( public MSBuildProjectDescription(
string path, string path,
LockFileProjectLibrary projectLibrary, string msbuildProjectPath,
LockFileTargetLibrary lockFileLibrary, LockFileProjectLibrary projectLibrary,
Project projectFile, LockFileTargetLibrary lockFileLibrary,
IEnumerable<LibraryRange> dependencies, IEnumerable<LibraryRange> dependencies,
bool compatible, bool compatible,
bool resolved) bool resolved)
: base( : base(
new LibraryIdentity(projectLibrary.Name, projectLibrary.Version, LibraryType.MSBuildProject), new LibraryIdentity(projectLibrary.Name, projectLibrary.Version, LibraryType.MSBuildProject),
@ -31,12 +33,11 @@ namespace Microsoft.DotNet.ProjectModel
compatible: compatible, compatible: compatible,
framework: null) framework: null)
{ {
ProjectFile = projectFile;
ProjectLibrary = projectLibrary; ProjectLibrary = projectLibrary;
MsbuildProjectPath = msbuildProjectPath;
} }
public LockFileProjectLibrary ProjectLibrary { get; } public LockFileProjectLibrary ProjectLibrary { get; }
public string MsbuildProjectPath { get; set; }
public Project ProjectFile { get; }
} }
} }

View file

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