Add PackageLockFile to IProjectContext (#187)
This commit is contained in:
parent
f9412e7707
commit
c20b9ae894
|
|
@ -58,6 +58,7 @@ namespace Microsoft.Extensions.ProjectModel
|
||||||
public string DepsJson => _paths.RuntimeFiles.DepsJson;
|
public string DepsJson => _paths.RuntimeFiles.DepsJson;
|
||||||
public string RuntimeConfigJson => _paths.RuntimeFiles.RuntimeConfigJson;
|
public string RuntimeConfigJson => _paths.RuntimeFiles.RuntimeConfigJson;
|
||||||
public string PackagesDirectory => _projectContext.PackagesDirectory;
|
public string PackagesDirectory => _projectContext.PackagesDirectory;
|
||||||
|
public string PackageLockFile => Path.Combine(Path.GetDirectoryName(ProjectFullPath), "project.lock.json");
|
||||||
|
|
||||||
public string AssemblyFullPath =>
|
public string AssemblyFullPath =>
|
||||||
!IsClassLibrary && (_projectContext.IsPortable || TargetFramework.IsDesktop())
|
!IsClassLibrary && (_projectContext.IsPortable || TargetFramework.IsDesktop())
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ namespace Microsoft.Extensions.ProjectModel
|
||||||
string Config { get; }
|
string Config { get; }
|
||||||
string DepsJson { get; }
|
string DepsJson { get; }
|
||||||
string RuntimeConfigJson { get; }
|
string RuntimeConfigJson { get; }
|
||||||
|
string PackageLockFile { get; }
|
||||||
string PackagesDirectory { get; }
|
string PackagesDirectory { get; }
|
||||||
string TargetDirectory { get; }
|
string TargetDirectory { get; }
|
||||||
string AssemblyFullPath { get; }
|
string AssemblyFullPath { get; }
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,19 @@ namespace Microsoft.Extensions.ProjectModel
|
||||||
public string Config => AssemblyFullPath + ".config";
|
public string Config => AssemblyFullPath + ".config";
|
||||||
public string DepsJson => Path.Combine(TargetDirectory, Path.GetFileNameWithoutExtension(AssemblyFullPath) + ".deps.json");
|
public string DepsJson => Path.Combine(TargetDirectory, Path.GetFileNameWithoutExtension(AssemblyFullPath) + ".deps.json");
|
||||||
public string RuntimeConfigJson => Path.Combine(TargetDirectory, Path.GetFileNameWithoutExtension(AssemblyFullPath) + ".runtimeconfig.json");
|
public string RuntimeConfigJson => Path.Combine(TargetDirectory, Path.GetFileNameWithoutExtension(AssemblyFullPath) + ".runtimeconfig.json");
|
||||||
|
|
||||||
public string PackagesDirectory => FindProperty("NuGetPackageRoot");
|
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 AssemblyFullPath => FindProperty("TargetPath");
|
||||||
public string Platform => FindProperty("Platform");
|
public string Platform => FindProperty("Platform");
|
||||||
public string ProjectFullPath => _project.FullPath;
|
public string ProjectFullPath => _project.FullPath;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue