Using NuPack as a package repository in OpenWrap

NuPack came out a short while ago. While NuPack is only a subset of what OpenWrap was built to solve, a lot of libraries have already been added to their repositories, probably for the sole reason that it’s Microsoft and some people get excited about them doing anything having to do with Visual Studio.

But in the OpenWrap team, we think that packages are good, that’s why we’ve worked hard on our system for so many months. And we think you should, as a dedicated OpenWrap users, be able to import those packages until such a time the world adopt OpenWrap as the main way to deliver dependencies to you.

So you can do this now. At a command line, add nupack as a repository through the usual remote command.

PS C:\src\demo> o add-remote nu nupack://
# OpenWrap v1.0.0.0 ['C:\src\demo\wraps\_cache\openwrap-\bin-net35\OpenWrap.dll'] Remote repository 'nu' added.

From now on, any nupack will be downloaded and converted to the OpenWrap native format and be usable as usual in OpenWrap. Note that we only support things that do not have dependencies on PowerShell, so while you get command support out of the box with OpenWrap packages, we will do nothing with the PowerShell scripts at all.

You can query packages on that new server using the list-wrap –query command.

PS C:\src\demo> o list-wrap -query *castle* -remote nu
# OpenWrap v1.0.0.0 ['C:\src\demo\wraps\_cache\openwrap-\bin-net35\OpenWrap.dll'] - Castle.Components.Validator Versions: 1.1.0 - Castle.Core-log4net Versions: 2.5.1 - Castle.Core-NLog Versions: 2.5.1 - Castle.Core Versions: 1.1.0, 1.2.0, 2.5.1 - Castle.DynamicProxy Versions: 2.1.0, 2.2.0 - Castle.Windsor-log4net Versions: 2.5.1 - Castle.Windsor-NLog Versions: 2.5.1 - Castle.Windsor Versions: 2.1.1, 2.5.1 - SNAP.CastleWindsor Versions: 1.0

And add one to the package, say the latest castle.core version:

PS C:\src\demo> o add-wrap castle.core
# OpenWrap v1.0.0.0 ['C:\src\demo\wraps\_cache\openwrap-\bin-net35\OpenWrap.dll'] Wrap descriptor found. Project repository present. Dependency added to descriptor. Copying 'Castle.Core-2.5.1' from 'nu' to 'System repository' Copying 'Castle.Core-2.5.1' from 'nu' to 'Project repository' Making sure the cache is up-to-date...

And you’re done. On a side-note, the NuPack project will shift to the horrendous OData protocol, but provided they don’t break the examples they’ve shown of what atrocities introducing the EDM will do to their xml documents, we already support that too.

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Ryan Riley

    Nevermind. This should have been obvious, but I haven’t initialized a project yet.

  • Ryan Riley

    Seb, when I try to run `o add-wrap castle.core` as described above, I get the following message:

    No wrap descriptor found, installing locally.
    Project repository not found.
    ‘System repository’ up-to-date as ‘Castle.Core-2.5.1′ <= ‘Castle.Core-2.5.1′.
    Making sure the cache is up-to-date…
    Object reference not set to an instance of an object.

    I can’t tell if castle.core was installed or not. How do I interrogate my local repository for installed wraps? I tried `o wrap list`, but I get another error that the “Selected repository wasn’t found….”