Easily create NuGet packages with this template.
It uses the method described here: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory
Found a bug or have a feature request?
Post it at https://bitbucket.org/azzlack/nugetpackager/issues
HOW TO USE:
- Add a new project to your solution by using the installed template
- Open NuGet.config and add your repositories to the "packageSources" element.
The script will then publish your package to all the listed repositories. - Edit the sample "Package.nuspec" file according to http://docs.nuget.org/docs/reference/nuspec-reference
- Add the assemblies you want to add as references in the "lib" folder before building the project
See http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Package_Conventions - Add the files you want to copy to the project folder in the "content" folder before building the project
Remember that you can also do config and file transforms. http://docs.nuget.org/docs/creating-packages/configuration-file-and-source-code-transformations - Edit one or more of the files in the "tools" folder if you want to run some script on package install, uninstall or init.
See http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Automatically_Running_PowerShell_Scripts_During_Package_Installation_and_Removal - Build the project.
- If in release mode, the packager will try to push your package to the repository using the NuGet API Keys configuration.
If no valid API key for the specified package source exists, it will prompt you to add it before automatically trying again. - If in debug mode, it will only create the packages.
If there are .pdb files located in the lib folder, a symbols package will automatically be made and published together with the package.
Please note that when publishing a symbol package, all source files need to be present in the "src" folder, with the same structure as in the actual project.
Make sure all the files you want to include in the package are present in the "lib", "content" and "tools" folders before building the NuGet Packager project.
To publish a new version of your package, bump the version number in the .nuspec file.
NOTE:
This package auto-updates to the latest version of NuGet when building. This means your target repository also needs to be the latest version. (Should only be a problem if you’re running a custom version of the NuGet Gallery)
Version History
2.1.1
2.1.0
- Updated to work with Visual Studio 2013
2.0.4
- Fixed typo reported by Colin Mackay
2.0.3
- Fixed bugs reported in comments
2.0.2
- Fixed bugs reported in comments
2.0
- New dialog for entering package repository api keys
- Better error handling and logging
- Support for pushing to multiple package repositories
- Now only uses info from package.nuspec when generating package. (No more AssemblyInfo.cs editing)
1.0
Please visit my blog for more tutorials and posts about development in general, C#, JavaScript, SharePoint and Umbraco.