Puresharper / NuPack

NuPack .NET 4.0+ produces nuget package at build time
MIT License
12 stars 11 forks source link
automatic automation dotnet net nuget nuget-package nuget-packages package

NuGet

NuPack

NuPack is an easy way to produce a nuget package for .NET 4.0+ based on AssemblyInfo or nuspec when building with Visual Studio. It is materialized as a nuget package.

When NuPack is reference by a project, no dependency is created, there is only a new build step to automatically pack the project output into a nuget package with project name as id.

Features

When a .nuspec file is detected as part of project, NuPack respect the specification and dosen't apply any auto configuration to produce the expected nuget package.

Produce a simple library (lib folder) with nuget package dependencies. This pattern is automatically apply when there is no .nuspec file detected for project of type library.

When package is based on console application and .nuspec is not declared, a build directory is defined with a .targets file to provide a simple way to add a build action step as post build with 5 arguments : $(SolutionPath), $(ProjectPath), $(Configuration), $(PlatformName) and $(TargetPath)

Dependencies can be a nuget packages, project references, etc... They must be include recursively in the generated nuget package with an adequat form.

Nuget process does not propagate xml documentation and resources of dependency in output and cannot be considered in NuPack packaging process. Allow NuPack to propagate them automatically help to keep a clean structure and documentation in each node.

NuPack can provide a library to develop a plugin as nuget package. It will detect plugin from package.config and load it from NuPack folder to add additional behavior to NuPack. Plugin will be called with arguments passed to NuPack and produce a PackageBuilder from original PackageBuilder before save result. Plugin is disposed after nuget creation.

NuPack have to create a specific package to store plugin (library) in NuPack folder when project reference NuPack.Extension.

Roadmap

When NuPack is referenced by a console application named [Library].Optimizer and reference a library named [Library], an optimizer pattern is done. Generated nuget package contains the [Library].dll into lib folder and [Library].Optimizer.exe is placed into build folder with a .targets file to execute optimizer on postbuild with same arguments than standard build action for console application pattern. The nuget package will take [Library] name as id. It means that pattern is not done if [Library] is a nuget producer. Optimizer pattern will be an entry point to rewrite IL for example or prepare something based on [Library].dll usage.

Visual Studio 2017 changed nuget integration template. NuPack have to be updated to support Visual Studio 2017.

One of frustrating thing with nuget is to have a clean and full metadata. Unfortunately, AssemblyInfo does not provide a way to expose all nuget needs. In other hand, it is often necessary to declare in multiple place the same informations that cause synchronization issue and add a maintenance overhead. Using github.com api to automatically complete nuget creation can be a good thing to stay reactive.

More