예제 #1
0
        public static ProjectModel ToProjectModel(this NuGetProject nuGetProject)
        {
            var fullPath           = nuGetProject.GetMetadata <string>(NuGetProjectMetadataKeys.FullPath);
            var nuGetFrameworkName = ((NuGetFramework)nuGetProject.GetMetadataOrNull(NuGetProjectMetadataKeys.TargetFramework))?.GetShortFolderName();

            return(new ProjectModel()
            {
                Name = nuGetProject.GetMetadata <string>(NuGetProjectMetadataKeys.Name),
                FullPath = fullPath,
                FolderPath = Path.GetDirectoryName(fullPath),
                FrameworkName = nuGetFrameworkName,
            });
        }
 public static string GetProjectDirectory(this NuGetProject nuGetProject)
 {
     return(nuGetProject.GetMetadataOrNull("Directory")?.ToString());
 }
 public static string GetProjectFilePath(this NuGetProject nuGetProject)
 {
     return(nuGetProject.GetMetadataOrNull(NuGetProjectMetadataKeys.FullPath)?.ToString());
 }
 public static string GetProjectName(this NuGetProject nuGetProject)
 {
     return(nuGetProject.GetMetadataOrNull(NuGetProjectMetadataKeys.Name)?.ToString());
 }