Creating a NuGet package using the SDK/csproj properties is now really easy by using dotnet pack. This uses the Pack MSBuild target underneath and we can already piggyback on this by adding the following target to your csproj:
This does however also require UmbPack to be installed as global dotnet tool. It's possible to write a native MSBuild task that can be included into your project by simply installing a single NuGet package, which removes this requirement, but can also automatically add the above target to your project.
We can also re-use a lot of the existing package properties to automatically populate the package.xml and introduce extra input properties to specify the path to the XML file, e.g.:
IsUmbPackable - A boolean value that specifies whether the project can be packed. The default value is true.
UmbPackFile - Relative or absolute path to the .xml file being use for packaging.
UmbPackBasePath - Base path for the .xml file.
UmbPackProperties - Semicolon separated list of key=value pairs.
We can start by first requiring the path to the package.xml to be set, but eventually might be able to auto-generate it.
Creating a NuGet package using the SDK/csproj properties is now really easy by using
dotnet pack
. This uses thePack
MSBuild target underneath and we can already piggyback on this by adding the following target to your csproj:This does however also require UmbPack to be installed as global dotnet tool. It's possible to write a native MSBuild task that can be included into your project by simply installing a single NuGet package, which removes this requirement, but can also automatically add the above target to your project.
We can also re-use a lot of the existing package properties to automatically populate the package.xml and introduce extra input properties to specify the path to the XML file, e.g.:
IsUmbPackable
- A boolean value that specifies whether the project can be packed. The default value is true.UmbPackFile
- Relative or absolute path to the .xml file being use for packaging.UmbPackBasePath
- Base path for the .xml file.UmbPackProperties
- Semicolon separated list of key=value pairs.We can start by first requiring the path to the package.xml to be set, but eventually might be able to auto-generate it.