MyGet Blog

Package management made easier!

NAVIGATION - SEARCH

Build services: support for build.cmd and build.ps1

Using MyGet Build Services, you have the opportunity to control exactly how your project gets built. MyGet Build Services will scan the contents of your source control and look for a file it can work with.

In short, the following files are searched for (in order of precedence):

  • build.bat, build.cmd or build.ps1
  • MyGet.sln
  • Any other *.sln file
  • *.csproj or *.vbproj
  • *.nuspec

Build.bat and build.cmd can be simple batch files which perform builds and packaging. Build.ps1 can be a PowerShell script which will be invoked. Our Build Services overview blog post provides more detail on environment variables and tools that can be used.

Happy packaging!

New documentation site available

We’re proud to have our new documentation site online! This new documentation site can be found at docs.myget.org and will host our FAQ, articles around specific features, reference documentation and so on.

Our documentation is open source and accepting pull requests! To contribute to the docs, just clone our repository and work on the Markdown files in the Docs folder. For more details on the process, read our detailed instructions.

For each accepted Pull Request that closes an issue, you can claim a free one month extension of your current plan. If you're on the free plan you can claim a voucher for a free month on the Starter plan.

Special thanks goes out to gep13, an enthusiast MyGet user who has already contributed several documentation pages.

New documentation website

 

 

 

 

Happy packaging!

New features in MyGet 1.7

We’re happy to announce we’ve completed another sprint. The main focus for this sprint was to start a redesign of our user experience. Next to that, new features have been introduced as well. Let’s have a look at what has changed and which cheese we moved.

A complete change log can be found on our new documentation site.

First steps in redesigning the MyGet experience

One of the first things you will notice when logging in to MyGet is that we’ve drastically changed the look and feel of the homepage. First of all, we decided the header we had earlier was too high and didn’t add much value. We’ve now condensed the header when authenticated. Your gravatar image will be shown and when hovering your username, a list of all feeds you have access to will be shown.

MyGet new design

The initial view you get is an activity stream. This provides the latest information about your feeds as well as the packages on it. On the right side, we’ve added quick navigation to all your feeds.

The feed details page now features a couple of additional buttons: you can clone a feed as well as delete a feed from that page.

Cheese has moved

We’re planning on further improvements in our next sprint!

New features and improvements

The following new features have been deployed:

In the coming days, we will be blogging about these features in more detail.

The page load speed of MyGet has improved as well. We’ve been working on optimizing file sizes, compression and are using CSS sprites for many of our images.

We hope you like this new drop. Let us know your thoughts in the comments below!

Happy packaging!

Create a list of favorite ReSharper plugins

With the latest version of the ReSharper 8 EAP, JetBrains shipped an extension manager for plugins, annotations and settings. Where it previously was a hassle and a suboptimal experience to install plugins into ReSharper, it’s really easy to do now. And what is really nice is that this extension manager is built on top of NuGet! Which means we can do all sorts of tricks…

The first thing that comes to mind is creating a personal NuGet feed containing just those plugins that are of interest to me. And where better to create such feed than MyGet? Create a new feed, navigate to the Package Sources pane and add a new package source. There’s a preset available for using the ReSharper extension gallery!

image_thumb[1]

After adding the ReSharper extension gallery as a package source, we can start adding our favorite plugins, annotations and extensions to our own feed.

image_thumb[3]

Of course there are some other things we can do as well:

  • “Proxy” the plugins from the ReSharper extension gallery and post your project/team/organization specific plugins, annotations and settings to your private feed. Check this post for more information.
  • Push prerelease versions of your own plugins, annotations and settings to a MyGet feed. Once stable, push them “upstream” to the ReSharper extension gallery.

Happy packaging!

Improved search syntax in NuGet client... and on your MyGet feeds

Yesterday, the NuGet team released some improvements to searching the official NuGet package source. Today, you can also use this new syntax on your MyGet feeds!

This new search syntax allows us to narrow our search to a particular attribute of a NuGet package. For example, we want to search for packages which contain “Glimpse” in the Id, we can type “id:glimpse”. We can also search the description of a package and check if it contains any of the given words. For example “description:twitter bootstrap” will yield packages containing either the word “twitter” or “bootstrap” in their description.

NuGet improved search syntax

Some example searches: (taken from the NuGet blog)

Attribute

Example

id

id:jQuery

title

title:Validation

description

description:dependency injection

authors

authors:Outercurve Foundation

tags

tags:silverlight

 

Enjoy, and as always…

Happy packaging!

Build services - an overview

Our 1.6 release shipped a number of interesting new features and enhancements to existing features, including those for MyGet Build Services. In this post, we’ll describe existing and new features and enhancements in a bit more detail.

One important thing to know is that Build Services is intended to make packaging projects easier. We are not aiming to become a full CI server like TeamCity of Team Foundation Server. That said, we do believe Build Services is appropriate for many scenarios and can take a lot of work out of your hands. We found some blog posts you may like: Nico Vermeir is using Build Services to package Windows Phone libraries. We also use it ourselves to push components from GitHub to NuGet.org.

Specify build configuration and platform

When creating or modifying a build source, you can now specify the configuration and platform that should be built. Easily switch between Release (the default configuration) or Debug or any other configuration that exists in your solution. The same goes for platform: if you wish to specifically build for x86, this can now be specified as the target platform.

Build configuration and platform

Note that we also set a %Configuration% and %Platform% environment variable during the build process. This way you can make use of these in your customized builds that are run using a build.bat file.

Package versioning

In earlier versions of MyGet Build Services, we’ve been generating a random incremental version number for packages created during build. From now on, we have support for true incremental build numbers through the build source settings

Specify package version number

The build counter starts with zero and increments with 1 on every build. You can also specify a version format ( Iuse '{0}' as a placeholder for the build counter) which will be generated during build. Note that if you enable the forbid packages which are non-compliant with Semantic Version option ,you should make sure the version format specified follows the Semantic Version rules.

We also set a %BuildCounter% and %PackageVersion% environment variable during the build process. This way you can make use of these in your customized builds that are run using a build.bat file.

Supported project types

We’ve added support for psake builds (use a built.bat file and invoke psake). Building Windows Phone 8 packages is now also supported out of the box. This brings us to the following list of supported frameworks and SDK’s:

  • .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0 and ,NET 4.5
  • PCL support (2012)
  • Windows Azure SDK
  • Windows Identity Foundation SDK
  • Silverlight 4, Silverlight 5
  • TypeScript SDK
  • psake

Regarding test runners, we now support

  • MsTest
  • MbUnit 2, MbUnit 3
  • NBehave
  • NUnit (up to 2.6.2)
  • xUnit.net
  • csUnit
  • RSpec

We believe adding these SDK’s out-of-the-box provides a lot of value to our users and we want to continue investing in expanding the number of supported SDK’s.

Environment variables

As part of the build process, we now set the following environment variables. Note that these are all read-only.

%BuildRunner%

Always "MyGet", can be used to determine if running on MyGet Build Services

%NuGet%

Path to a maintained-by-MyGet NuGet.exe

%SourcesPath%

Path to source code being built

%Configuration%

Build configuration (defaults to Debug)

%Platform%

Platform to build (defaults to blank)

%VersionFormat%

Version format specified in build configuration

%BuildCounter%

Build counter value

%PackageVersion%

%VersionFormat% with %BuildCounter% filled in, used as the auto-generated package version number

%EnableNuGetPackageRestore%

NuGet package restore enabled? Always true.

Other features

Some smaller features have been implemented for version 1.6 as well.

  • When building from GitHub/BitBucket, a link to the changeset that has been built is available from the build services tab.

image

  • Hanging build detection: whenever a build hangs for > 15 minutes, we kill the build process and set the build status to failed.
  • The build log can be copied to clipboard.
  • Build status is refreshed automatically.

Happy packaging!

Support for Package Source Discovery draft

We’re proud to announce support for the NuGet Package Source Discovery (PSD) draft on MyGet. Package Source Discovery (PSD) allows for NuGet-based clients tools to discover the feeds that are hosted by a user or organization by using the blog or website URL. Every feed hosted on MyGet has a discovery endpoint hosted at http://www.myget.org/Discovery/Feed/<yourfeed>.

In its simplest form, you can place a simple HTML tag on your website or blog and use that for discovering all feeds you own, whether on MyGet or another NuGet package repository such as TeamCity or the NuGet gallery.

Package Source Discovery

NuGet Package Source Discovery is an attempt to remove friction from the following scenarios:

  • An individual user may have several NuGet feeds spread across the Internet. Some may be on NuGet.org (including curated feeds), some on MyGet and maybe some on my corporate network. How do I easily point my Visual Studio to all my feeds accross different machines? And how do I maintain this configuration?
  • An organization may have several feeds internally as well as one on MyGet and some CI packages on TeamCity. How can this organization tell his developers what feeds they can/should use?
  • An organization may have a NuGet server containing multiple feeds. How will developers in this organization get a list of available feeds and services?

For all scenarios, a simple feed discovery mechanism could facilitate this. Such feed discovery mechanism could be any URL out there (even multiple per host).

As an example, open Visual Studio and open any solution. Then issue the following in the Package Manager Console:

Install-Package DiscoverPackageSources
Discover-PackageSources -Url "http://www.myget.org/gallery"

Close and re-open Visual Studio and check your package sources. The URL has been verified for a PSD manifest URL and the manifest has been parsed. Matching feeds have been installed into the NuGet.config file, in this case all feeds listed in the MyGet gallery.

Discovery for your feed(s)

By default, we’ve enabled discovery on your profile page. For example, http://www.myget.org/users/maartenba provides discovery for all my (public) feeds. Of course, you can also create your own discovery URL on your blog or website: simply add a <link /> element to the HTML code. From then on, you or your users can use the following command to discover feeds from your website or blog:

Install-Package DiscoverPackageSources
Discover-PackageSources -Url http://<your website>

On your feed’s discovery page, we’ve added the HTML you have to add to your website to enable this scenario.

image

Discovery for gallery feeds

We’ve added a discovery on the MyGet gallery. When using http://www.myget.org/gallery as the discovery URL, all gallery feeds will be registered in your NuGet.config file. Every feed on the gallery in itself also provides discovery, for example ScriptCS has a discovery endpoint at http://www.myget.org/gallery/scriptcsnightly.

Please provide feedback on the Package Source Discovery specification. Comments on the MyGet implementation are also welcome!

Happy packaging!

Require semantic versioning for packages pushed to your feed

By default, feeds on MyGet can contain any package that is added or pushed to them. Starting MyGet 1.6, we’ve added support for blocking certain packages from being added to your feed. To configure this, we’ve added a new tab on every feed.

Package settings semantic version

This new tab currently features two options: “forbid overwriting of existing packages” and “forbid packages which are non-compliant with Semantic Version”. The first one is obvious: when enabled, MyGet will refuse overwriting existing packages on your feed. This makes it possible to achieve an important goal: have a guarantee that a given, known package is always exactly the same package in the future.

Enabling the “forbid packages which are non-compliant with Semantic Version” option allows you to block uploading of packages that are not SemVer compatible. Version numbers like 1.0.0 and 1.5.12559 will be allowed as well as 1.0.0-PRE. Package versions like 1.0.0.0 and 1.5.1.13369 will be blocked.

Happy packaging!

Download feed as ZIP

What do you do if you want to download all packages on your feed? We can do it using the Package Manager Console or by calling nuget.exe, but wouldn’t it be great if we were able to download an entire feed with the click of a button? That’s exactly what our 1.6 release added: support for downloading a feed as a ZIP file.

The feed list gives us a new button: “Download packages as ZIP”.

Download all packages from MyGet feed

Depending on the amount of packages on our feed and the size of them, a ZIP file is download containing all packages in our feed:

ZIP file download of NuGet feed packages

There’s a lot of contents in this package. The readme.txt file contains some information about the moment the ZIP file was created and which packages are included.

Readme file

Call it a convenience, but we also generate a packages.config file which can be used with nuget.exe to download directly from our feed in the future:

Packages.config

And of course, all packages on our feed are included in the ZIP file as well:

NuGet packages in ZIP

Happy packaging!

MyGet Build Services - Package Versioning Explained

At MyGet, we do everything possible to reduce friction. It's in our DNA! Package versioning is currently the biggest roadblock you'll encounter when setting up a solution to automate package creation.

Versioning semantics

A NuGet package is uniquely identified by its package identifier and its version. This implicit requirement is often overlooked upfront and requires some thinking to define a proper versioning strategy. Luckily for us, some smart people already came up with something called Semantic Versioning (SemVer). We strongly believe in SemVer's pragmatic approach towards API versioning and the benefits that come with it.

Even though NuGet does not fully support the entire specification yet (the SemVer specification is still RC), it already has some features that allow you to benefit from using SemVer. An example of that is the Update-Package -Safe command option, which allows you to update your consumed packages to the latest safe package version: updates are constrained to the same Major and Minor package version. The only drawback of this feature is that you have to count on a safe versioning scheme applied by the package author. This is not guaranteed on the NuGet Gallery.

Build Source Configuration

If you set up MyGet Build Services for your feed, you'll get automatically created packages pushed to your feed. This implies automatic versioning. We've added some new capabilities to our Build Services in our recent MyGet v1.6 release. For one, we've added a UI to define the versioning scheme to be used.

You are in control

The biggest improvement is the fact that the build source now remembers the build counter for you, so you don't have to deal with maintaining a version.txt file or anything similar in your source repository. Of course, if you really want to, you still can: we're removing friction, not features! The build counter can easily be reset using the reset link. Similar to what popular build servers do (and any decent build server should do), you'll be able to define a versioning scheme using a placeholder for the build counter. You've now gained more control over the versioning "magic" we applied before.

In addition, you can gain full control by hooking into the build process. MyGet Build Services scans for the following source artifacts (in order of precedence):

If you provide your own build.bat script or MyGet.sln, you specifically instruct MyGet Build Services how to act on your sources. This also means you'll need to take care of versioning yourself. That's why we provide you with the following set of parameters so you can benefit from using the versioning scheme you already defined, as well as the build-counter attached to your build source. Note that these environment variables are read-only and are reset to the initial values at the start of the build process.

%BuildRunner% Always "MyGet", can be used to determine if running on MyGet Build Services
%NuGet% Path to a maintained-by-MyGet NuGet.exe
%SourcesPath% Path to source code being built
%Configuration% Build configuration (defaults to Debug)
%Platform% Platform to build (defaults to blank)
%VersionFormat% Version format specified in build configuration
%BuildCounter% Build counter value
%PackageVersion% %VersionFormat% with %BuildCounter% filled in, used as the auto-generated package version number
%EnableNuGetPackageRestore% NuGet package restore enabled? Always true.

 

Package Source Configuration

We've also pulled Package Sources out of beta for everyone to enjoy, including our Free users! Package sources play a key role in the MyGet Build Services workflow. By default, the NuGet Gallery is configured as an upstream package source. You could obviously also configure Chocolatey, an Orchard feed, or your own MyGet feed, or all of them! These upstream package sources allow you to reference or mirror packages onto your own feed. It also allows you to easily push packages from your feed to the the upstream package source, given you configured your API key in the package source configuration.

When you want to push a package upstream, you'll be prompted with a dialog asking you which upstream feed should be used. In addition, you'll also get the opportunity to modify the package version as it should appear on the upstream package source. Note that no compilation is happening, we're simply adjusting the package version if you changed it. Because semantically nothing changed to the package, you'll only be able to change the -PreRelease tag, or simply remove it and make your upstream package a full release.

Without enforcing them

We won't enforce you in using SemVer as this would introduce friction for those who don't want to use it. It's not up to the repository host to define your versioning approach: this is the responsibility of the feed owner. This is impossible on NuGet.org as the feed is owned by the Community, which is definitely not organized around a single common versioning scheme.

However, if you - as a MyGet feed owner - want to enforce it, then you can by simply checking the appropriate checkbox in your feed settings. We try to find a balance between removing friction and providing freedom in your choices, so we hope you like it! Don't hesitate to send us your feedback or log them on our UserVoice.

Happy Packaging!