Skip to content

Instantly share code, notes, and snippets.

@yishaigalatzer
Created October 26, 2015 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yishaigalatzer/f94003b399d4fd28091c to your computer and use it in GitHub Desktop.
Save yishaigalatzer/f94003b399d4fd28091c to your computer and use it in GitHub Desktop.
AppVeyor-GettingOffNuGetCore
Hi Feodor,
Code change is still in progress, but you may want to look at this commit: https://github.com/NuGet/NuGetGallery/commit/7f06ba9171328af3acfb0790584af5c518d3afe2
It uses these NuGet packages:
* NuGet.Frameworks (has compaitibility info)
* NuGet.Packaging (has a package reader, which from the below e-mail seems to be what would be your starting point)
Here’s an example of opening a package for reading. I created an extension method to read the NuSpec stream, but that is a very simple one calling into “new NuspecReader(stream)”.
https://github.com/NuGet/NuGetGallery/commit/7f06ba9171328af3acfb0790584af5c518d3afe2#diff-645a21b27c26500fcb04ecf496609bb8R52
Let me know if this works for you,
Best regards,
Maarten
From: Yishai Galatzer
Sent: zondag 25 oktober 2015 22:47
To: Feodor Fitsner ; Maarten Balliauw
Subject: RE: NuGet.Core for 3.x
Supported frameworks is where it falls apart.
Maarten can point you to the code change he did last week.
Sent from my Windows Phone
________________________________________
From: Feodor Fitsner
Sent: ‎10/‎25/‎2015 2:36 PM
To: Yishai Galatzer
Subject: Re: NuGet.Core for 3.x
I see.
This is it. "pkg" is ZipPackage from NuGet.Core assembly.
package.PackageId = packageId;
package.Version = pkg.Version.ToString();
package.VersionNumber = versionNumber;
package.VersionSpecial = specialVersion;
// other properties
package.IsPrerelease = !String.IsNullOrEmpty(pkg.Version.SpecialVersion);
package.Title = pkg.Title;
package.Authors = String.Join(",", pkg.Authors);
package.Owners = String.Join(",", pkg.Owners);
if (pkg.IconUrl != null)
{
package.IconUrl = pkg.IconUrl.GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped);
}
if (pkg.LicenseUrl != null)
{
package.LicenseUrl = pkg.LicenseUrl.GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped);
}
if (pkg.ProjectUrl != null)
{
package.ProjectUrl = pkg.ProjectUrl.GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped);
}
package.RequireLicenseAcceptance = pkg.RequireLicenseAcceptance;
package.Description = pkg.Description;
package.Summary = pkg.Summary;
package.ReleaseNotes = pkg.ReleaseNotes;
package.Tags = pkg.Tags;
package.Dependencies = String.Join("|", pkg.DependencySets.SelectMany(ConvertDependencySetToStrings));
package.SupportedFrameworks = String.Join("|", pkg.GetSupportedFrameworks().Select(f => f.FullName));
package.LastUpdated = DateTime.UtcNow;
package.Published = DateTime.UtcNow;
package.IsAbsoluteLatestVersion = package.IsAbsoluteLatestVersion;
package.IsLatestVersion = package.IsLatestVersion;
package.MinClientVersion = package.MinClientVersion == null ? null : package.MinClientVersion.ToString();
-Feodor
On Sun, Oct 25, 2015 at 2:31 PM, Yishai Galatzer wrote:
Hey Feodor,
We are slowly deprecating nuget.core codebase, there are a few functionalities required in nuget.core (like pack) that we depend on.
We stopped publishing versions of nuget.core (which might have been a mistake, I'll have a chat with the team on Monday). We currently work on 2.10 while 2.9 is the latest but is only available on myget.
For the new codebase we use nuget.packagemanagement or you can use nuget.exe directly.
On my phone, and can't recall exact classes or method names. Another place is lol at the nugetgallery project.
What metadata are you trying to get?
Yishai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment