/MSBuild.MSBNuget

Convention based nuget package creation using MSBuild

Primary LanguageBatchfileGNU Lesser General Public License v3.0LGPL-3.0

MSBuild.MSBNuget

master feature/v20 latest
Build status Build status Build status

Easily create NuGet packages with this collection of MSBuild targets. It uses the method described here: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory

Nuget Package Feed

https://ci.appveyor.com/nuget/msbuild-msbnuget

HOW TO USE

  <PropertyGroup>
    <NugetPublishToReleaseFolder Condition="'$(NugetPublishToReleaseFolder)'==''">false</NugetPublishToReleaseFolder>
    <NugetPublishToLocalNugetFeed Condition="'$(NugetPublishToLocalNugetFeed)'==''">false</NugetPublishToLocalNugetFeed>

    <NugetPublishLocalNugetFeedFolder Condition="'$(NugetPublishLocalNugetFeedFolder)'==''">$(MSBuildProjectDirectory)\..\..\Publish\</NugetPublishLocalNugetFeedFolder>
    <NugetPublishReleaseFolder Condition="'$(NugetPublishReleaseFolder)'==''">$(MSBuildProjectDirectory)\..\..\Releases\</NugetPublishReleaseFolder>
  </PropertyGroup>
  • Use item groups to add additional files, eg: add file 'my.dll' to convention based folder
  <ItemGroup>
    <additionalFiles Include="$(MSBuildThisFileDirectory)\..\..\MSBNuget\my.dll">
      <targetFolder>MSBNuget/content/libs/net45</targetFolder>
    </additionalFiles>
  </ItemGroup>
  • Or use convention folders (libs, tools, content, build), eg:
project  
|-'folder: nuspecname'  
|-|-build  
|-|-content  
|-|-libs  
|-|-tools  
|-|-'file: nuspecname.nuspec'  
|-|-'file: nuspecname.nuspec.props'  

Sample

https://github.com/DanielTheCoder/MSBuild.MSBNuget/tree/master/src/MSBNuget.Nuget

Contributing

If you are interested in contributing,

  1. Get a Github account
  2. Fork the project
  3. Make your feature addition or bugfix. Please also update the changelog.
  4. Send me a pull request via GitHub