public void Populate(ManifestMetadata manifestMetadata) { IPackageMetadata metadata = manifestMetadata; Id = metadata.Id; Version = metadata.Version; Title = metadata.Title; Authors.AddRange(metadata.Authors); Owners.AddRange(metadata.Owners); IconUrl = metadata.IconUrl; LicenseUrl = metadata.LicenseUrl; ProjectUrl = metadata.ProjectUrl; RequireLicenseAcceptance = metadata.RequireLicenseAcceptance; // DevelopmentDependency = metadata.DevelopmentDependency; Description = metadata.Description; Summary = metadata.Summary; ReleaseNotes = metadata.ReleaseNotes; Language = metadata.Language; Copyright = metadata.Copyright; MinClientVersion = metadata.MinClientVersion; if (metadata.Tags != null) { Tags.AddRange(ParseTags(metadata.Tags)); } DependencySets.AddRange(metadata.DependencySets); FrameworkReferences.AddRange(metadata.FrameworkAssemblies); if (manifestMetadata.ReferenceSets != null) { PackageAssemblyReferences.AddRange(manifestMetadata.ReferenceSets.Select(r => new PackageReferenceSet(r))); } }
private void ReadManifest(Stream stream, string basePath) { // Deserialize the document and extract the metadata Manifest manifest = Manifest.ReadFrom(stream); IPackageMetadata metadata = manifest.Metadata; Id = metadata.Id; Version = metadata.Version; Title = metadata.Title; Authors.AddRange(metadata.Authors); Owners.AddRange(metadata.Owners); IconUrl = metadata.IconUrl; LicenseUrl = metadata.LicenseUrl; ProjectUrl = metadata.ProjectUrl; RequireLicenseAcceptance = metadata.RequireLicenseAcceptance; Description = metadata.Description; Summary = metadata.Summary; ReleaseNotes = metadata.ReleaseNotes; Language = metadata.Language; Copyright = metadata.Copyright; Serviceable = metadata.Serviceable; MinClientVersion = metadata.MinClientVersion; DevelopmentDependency = metadata.DevelopmentDependency; if (metadata.Tags != null) { Tags.AddRange(ParseTags(metadata.Tags)); } DependencySets.AddRange(metadata.DependencySets); FrameworkReferences.AddRange(metadata.FrameworkAssemblies); if (metadata.PackageAssemblyReferences != null) { PackageAssemblyReferences.AddRange(metadata.PackageAssemblyReferences); } // If there's no base path then ignore the files node if (basePath != null) { if (manifest.Files == null) { AddFiles(basePath, @"**\*.*", null); } else { foreach (ManifestFile file in manifest.Files) { AddFiles(basePath, file.Source, file.Target, file.Exclude); } } } }
public void Populate(ManifestMetadata manifestMetadata) { IPackageMetadata metadata = manifestMetadata; Id = metadata.Id; Version = metadata.Version; Title = metadata.Title; Authors.AddRange(metadata.Authors); Owners.AddRange(metadata.Owners); IconUrl = metadata.IconUrl; LicenseUrl = metadata.LicenseUrl; ProjectUrl = metadata.ProjectUrl; RequireLicenseAcceptance = metadata.RequireLicenseAcceptance; DevelopmentDependency = metadata.DevelopmentDependency; Description = metadata.Description; Summary = metadata.Summary; ReleaseNotes = metadata.ReleaseNotes; Language = metadata.Language; Copyright = metadata.Copyright; MinClientVersion = metadata.MinClientVersion; ContentFiles = new Collection <ManifestContentFiles>(manifestMetadata.ContentFiles); ProjectSourceUrl = metadata.ProjectSourceUrl; PackageSourceUrl = metadata.PackageSourceUrl; DocsUrl = metadata.DocsUrl; WikiUrl = metadata.WikiUrl; MailingListUrl = metadata.MailingListUrl; BugTrackerUrl = metadata.BugTrackerUrl; Replaces.AddRange(metadata.Replaces); Provides.AddRange(metadata.Provides); Conflicts.AddRange(metadata.Conflicts); SoftwareDisplayName = metadata.SoftwareDisplayName; SoftwareDisplayVersion = metadata.SoftwareDisplayVersion; if (metadata.Tags != null) { Tags.AddRange(ParseTags(metadata.Tags)); } DependencySets.AddRange(metadata.DependencySets); FrameworkReferences.AddRange(metadata.FrameworkAssemblies); if (manifestMetadata.ReferenceSets != null) { PackageAssemblyReferences.AddRange(manifestMetadata.ReferenceSets.Select(r => new PackageReferenceSet(r))); } }