When we develop libraries (whether internal or public), it helps to have a rapid ability to make changes and test them in a consuming application.
Building
- Setup the library with automatic versioning and a nuspec
- Setup library assembly version to auto increment build and revision
- AssemblyInfo –> [assembly: AssemblyVersion("1.0.*")]
- This autoincrements build and revision based on time of build
- Major & Minor
- Major should be changed when you have breaking changes
- Minor should be changed once you have a solid new release
- During development I don’t increment these
- Create a nuspec, version this with the code
- nuspec - set version to <version>$version$</version>
- This uses the assembly’s version, which is auto-incrementing
- Make changes to code
- Run automated build (ruby/rake)
- Setup the local nuget feed as a nuget package source (this is only required once per machine)
- Go to the consuming project
- Update the package
- Update-Package Library
- or Install-Package
- TLDR
- change library code
- run “rake nuget”
- run “Update-Package library” in the consuming application
- build/test!
If you manually execute any of this process, especially copying files, you will find it a burden to develop the library and will find yourself dreading it, and even worse, making changes downstream instead of updating the shared library for everyone’s sake.
Publishing
- Once you have a set of changes that you want to release, consider versioning and possibly increment the minor version if needed.
- Pick the package out of your local feed, and copy it to a public / shared feed!
- Note: helps to prune all the unnecessary versions during testing from your local feed once you are done and ready to publish
- TLDR
- consider version number
- run command to copy to public feed