Improved package support in Team Build

Alex Mullans

We know that packages are a key way to bring in dependencies and to share your work with your users, and we know many of you are using private package sources (like Package Management, Artifactory, MyGet, and others) to develop packages inside your organization. To improve those workflows, over the past two sprints, we’ve released major improvements to the NuGet, npm, and Maven build tasks in Team Build.

What’s new

  • Better support for Package Management feeds, whether you’re restoring or publishing packages
  • Cleaner workflow, with no risk of clashing parameters between the task configuration and your custom options
  • Improved service endpoint integration for working with external package sources from public sources like NuGet.org to private sources like Artifactory or a VSTS/TFS package feed outside the account/collection running the build

NuGet

NuGet and NuGet Tool Installer tasks in a new build

We’ve combined the old NuGet Installer/NuGet Restore, NuGet Packager, NuGet Publisher, and NuGet Command tasks into a single NuGet task. This brings the NuGet task inline with the rest of the task catalog and reduces the noise when you’re selecting tasks for your build.

We also created a new NuGet Tool Installer task. This is the new way to control the version of NuGet used in your build. By default, the NuGet task uses NuGet 4.0.0; you can use a Tool Installer task to use any version available from dist.nuget.org/tools.json. If you want to use a new pre-release version of NuGet on day one, now you can!

Other highlights:

  • We’ve introduced feed pickers for the restore and push commands – no need to copy/paste a feed URL anymore!
  • You can now provide “Credentials for feeds outside this account/collection” during restore and push, using the new NuGet service endpoint type. These credentials will be matched to package sources in your NuGet.config and provided to the build before your command is run.
  • If you’re pushing to a VSTS feed and using a Windows build agent, you can now “Allow duplicates to be skipped”. This is useful if you want to produce an entire set of packages, but only publish the set of packages for which you incremented the version.

NuGet documentation

npm

npm task in a new build

For npm, we focused mainly on better support for authenticated feeds, and also added a “command” selector to easily set up popular commands like install and publish.

Some top highlights:

  • As with NuGet, we’ve introduced feed pickers for the install and publish commands – again, no need to copy/paste a feed URL anymore!
  • You can now provide “Credentials for registries outside this account/collection”, using the new npm service endpoint type. These credentials will be matched to package sources in your .npmrc and provided to the build before your command is run.

npm documentation

Maven

The Maven task now supports authenticated feeds within the same VSTS account or TFS collection as the current build. Just add a feed to your pom.xml and the Maven step will add credentials automatically (and clean them up when finished).

Maven documentation

dotnet

We’ve made major improvements to the .NET Core task’s support for NuGet. All NuGet operations (e.g. dotnet nuget push, dotnet restore) are now available in the “command” selector in the task.

We also created a new .NET Core Tool Installer task. This is the new way to control the version of dotnet used in your build. 

Other highlights:

  • As with NuGet, we’ve introduced feed pickers for the install and publish commands – again, no need to copy/paste a feed URL anymore!
  • You can now provide “Credentials for feeds outside this account/collection” during restore and push, using the new NuGet service endpoint type. These credentials will be matched to package sources in your NuGet.config and provided to the build before your command is run.

0 comments

Discussion is closed.

Feedback usabilla icon