I recently posted this idea on Twitter:
@kevinobee @kayeenl Btw, I was thinking that it shouldn’t be too hard to make a cmd line util that converts #Sitecore packages into #NuGet
— Robin Hermanussen (@knifecore) May 6, 2013
And it didn’t take me that long to actually implement it. Follow these steps to turn any Sitecore package into a NuGet package and share it with the world.
- Download the CreateSitecoreNuGetPackage.exe file here or build it yourself with the code from GitHub.
- Put the files “Sitecore.Kernel.dll” and “Sitecore.Zip.dll” in the same folder.
- Create your package in the Package Manager and export the ZIP file.
- Run the following command from the command line:
CreateSitecoreNuGetPackage [PATH_TO_SITECORE_PACKAGE] - Use the NuGet Package Explorer to open the generated .nuspec file and improve the metadata if needed.
- Publish the package to a repository, like nuget.org.
Now, everyone will be able to install/uninstall your package through NuGet. Remember that you need to install Sitecore Rocks and attach your project before installing the package.
Some links to pages that helped me creating this:
- http://blog.velir.com/index.php/2012/12/04/create-and-deploy-sitecore-modules-with-nuget/
- http://vsplugins.sitecore.net/Sitecore-NuGet.ashx
- http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/06/Attach-a-Sitecore-Rocks-Connection-to-a-Visual-Studio-Project.aspx
I will be very interested to hear your feedback, as I haven’t been able to test this very well. If this utility catches on, I might make a version that you can use from the package manager directly.
Happy NuGetting