public void ToNugetManifest(NuGet.ManifestMetadata manifestMeta) { manifestMeta.Id = this.Name; manifestMeta.Version = this.Version.ToString(); manifestMeta.Title = this.Title.SafeTrim(); manifestMeta.Authors = string.Join(",", this.Authors); manifestMeta.Owners = string.Join(",", Owners.Count == 0 ? Authors : Owners); manifestMeta.Tags = String.IsNullOrEmpty(this.Tags) ? null : this.Tags.SafeTrim(); manifestMeta.LicenseUrl = ConvertUrlToStringSafe(this.LicenseUrl); manifestMeta.ProjectUrl = ConvertUrlToStringSafe(this.ProjectUrl); manifestMeta.IconUrl = ConvertUrlToStringSafe(this.IconUrl); manifestMeta.RequireLicenseAcceptance = this.RequireLicenseAcceptance; manifestMeta.DevelopmentDependency = false; manifestMeta.Description = this.Description.SafeTrim(); manifestMeta.Copyright = this.Copyright.SafeTrim(); manifestMeta.Summary = this.Summary.SafeTrim(); manifestMeta.ReleaseNotes = this.ReleaseNotes.SafeTrim(); manifestMeta.Language = this.Language.SafeTrim(); manifestMeta.DependencySets = new List<NuGet.ManifestDependencySet>(); manifestMeta.FrameworkAssemblies = new List<NuGet.ManifestFrameworkAssembly>(); manifestMeta.ReferenceSets = new List<NuGet.ManifestReferenceSet>(); var dependencySet = new NuGet.ManifestDependencySet(); foreach (var dependency in Dependencies) { if (manifestMeta.DependencySets.Count == 0) manifestMeta.DependencySets.Add(dependencySet); dependencySet.Dependencies.Add(new NuGet.ManifestDependency() { Id = dependency.Name, Version = dependency.Version.ToString() }); } }
public static NuGet.ManifestMetadata ToManifestMetadata([NotNull] this ManifestMetadata meta) { if (meta == null) { throw new ArgumentNullException(nameof(meta)); } var nugetMeta = new NuGet.ManifestMetadata() { Id = meta.Id, Authors = meta.Authors, Description = meta.Description, Copyright = meta.Copyright, DevelopmentDependency = meta.DevelopmentDependency, Version = meta.Version, Owners = meta.Owners, IconUrl = meta.IconUrl, Language = meta.Language, LicenseUrl = meta.LicenseUrl, MinClientVersionString = meta.MinClientVersionString, ProjectUrl = meta.ProjectUrl, ReleaseNotes = meta.ReleaseNotes, RequireLicenseAcceptance = meta.RequireLicenseAcceptance, Summary = meta.Summary, Tags = meta.Tags, Title = meta.Title }; if (meta.Dependencies.Count > 0) { // Copy list of dependencies in the first slot of ManifestDependencySet, and create // it if it doesn't exist nugetMeta.DependencySets = new List <NuGet.ManifestDependencySet>(); var dependencySet = new NuGet.ManifestDependencySet(); nugetMeta.DependencySets.Add(dependencySet); foreach (var deps in meta.Dependencies) { dependencySet.Dependencies.Add(new NuGet.ManifestDependency() { Id = deps.Id, Version = deps.Version }); } } return(nugetMeta); }
internal void ToNugetManifest(NuGet.ManifestMetadata manifestMeta) { manifestMeta.Id = this.Name; manifestMeta.Version = this.Version.ToString(); manifestMeta.Title = this.Title.SafeTrim(); manifestMeta.Authors = string.Join(",", this.Authors); manifestMeta.Owners = string.Join(",", Owners.Count == 0 ? Authors : Owners); manifestMeta.Tags = String.IsNullOrEmpty(this.Tags) ? null : this.Tags.SafeTrim(); manifestMeta.LicenseUrl = ConvertUrlToStringSafe(this.LicenseUrl); manifestMeta.ProjectUrl = ConvertUrlToStringSafe(this.ProjectUrl); manifestMeta.IconUrl = ConvertUrlToStringSafe(this.IconUrl); manifestMeta.RequireLicenseAcceptance = this.RequireLicenseAcceptance; manifestMeta.DevelopmentDependency = false; manifestMeta.Description = this.Description.SafeTrim(); manifestMeta.Copyright = this.Copyright.SafeTrim(); manifestMeta.Summary = this.Summary.SafeTrim(); manifestMeta.ReleaseNotes = this.ReleaseNotes.SafeTrim(); manifestMeta.Language = this.Language.SafeTrim(); manifestMeta.DependencySets = new List<NuGet.ManifestDependencySet>(); manifestMeta.FrameworkAssemblies = new List<NuGet.ManifestFrameworkAssembly>(); manifestMeta.ReferenceSets = new List<NuGet.ManifestReferenceSet>(); var dependencySet = new NuGet.ManifestDependencySet(); foreach (var dependency in Dependencies) { if (manifestMeta.DependencySets.Count == 0) manifestMeta.DependencySets.Add(dependencySet); dependencySet.Dependencies.Add(new NuGet.ManifestDependency() { Id = dependency.Name, Version = dependency.Version.ToString() }); } }