Add PackageLockFile to IProjectContext (#187)

This commit is contained in:
Nate McMaster 2016-10-10 11:30:12 -07:00 committed by GitHub
parent f9412e7707
commit c20b9ae894
3 changed files with 14 additions and 1 deletions

View File

@ -58,6 +58,7 @@ namespace Microsoft.Extensions.ProjectModel
public string DepsJson => _paths.RuntimeFiles.DepsJson;
public string RuntimeConfigJson => _paths.RuntimeFiles.RuntimeConfigJson;
public string PackagesDirectory => _projectContext.PackagesDirectory;
public string PackageLockFile => Path.Combine(Path.GetDirectoryName(ProjectFullPath), "project.lock.json");
public string AssemblyFullPath =>
!IsClassLibrary && (_projectContext.IsPortable || TargetFramework.IsDesktop())

View File

@ -18,6 +18,7 @@ namespace Microsoft.Extensions.ProjectModel
string Config { get; }
string DepsJson { get; }
string RuntimeConfigJson { get; }
string PackageLockFile { get; }
string PackagesDirectory { get; }
string TargetDirectory { get; }
string AssemblyFullPath { get; }

View File

@ -54,8 +54,19 @@ namespace Microsoft.Extensions.ProjectModel
public string Config => AssemblyFullPath + ".config";
public string DepsJson => Path.Combine(TargetDirectory, Path.GetFileNameWithoutExtension(AssemblyFullPath) + ".deps.json");
public string RuntimeConfigJson => Path.Combine(TargetDirectory, Path.GetFileNameWithoutExtension(AssemblyFullPath) + ".runtimeconfig.json");
public string PackagesDirectory => FindProperty("NuGetPackageRoot");
public string PackageLockFile
{
get
{
var restoreOutputPath = FindProperty("RestoreOutputPath");
if (string.IsNullOrEmpty(restoreOutputPath))
{
restoreOutputPath = Path.Combine(Path.GetDirectoryName(ProjectFullPath), "obj");
}
return Path.Combine(restoreOutputPath, "project.assets.json");
}
}
public string AssemblyFullPath => FindProperty("TargetPath");
public string Platform => FindProperty("Platform");
public string ProjectFullPath => _project.FullPath;