Add AssemblyName to ProjectContext

This commit is contained in:
Prafull Bhosale 2016-10-12 09:10:35 -07:00
parent 8be3b16756
commit 329b65fc69
3 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,7 @@ namespace Microsoft.Extensions.ProjectModel
string PackageLockFile { get; }
string PackagesDirectory { get; }
string TargetDirectory { get; }
string AssemblyName { get; }
string AssemblyFullPath { get; }
IEnumerable<string> CompilationItems { get; }
IEnumerable<string> EmbededItems { get; }

View File

@ -66,7 +66,9 @@ namespace Microsoft.Extensions.ProjectModel
public string RuntimeConfigJson => _paths.RuntimeFiles.RuntimeConfigJson;
public string PackagesDirectory => _projectContext.PackagesDirectory;
public string PackageLockFile => Path.Combine(Path.GetDirectoryName(ProjectFullPath), "project.lock.json");
public string AssemblyName => string.IsNullOrEmpty(AssemblyFullPath)
? ProjectName
: Path.GetFileNameWithoutExtension(AssemblyFullPath);
public string AssemblyFullPath =>
!IsClassLibrary && (_projectContext.IsPortable || TargetFramework.IsDesktop())
? _paths.RuntimeFiles.Executable

View File

@ -73,6 +73,9 @@ namespace Microsoft.Extensions.ProjectModel
return Path.Combine(restoreOutputPath, "project.assets.json");
}
}
public string AssemblyName => string.IsNullOrEmpty(AssemblyFullPath)
? ProjectName
: Path.GetFileNameWithoutExtension(AssemblyFullPath);
public string AssemblyFullPath => FindProperty("TargetPath");
public string Platform => FindProperty("Platform");
public string ProjectFullPath => Project.FullPath;