Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appveyor nuget analyser

I'm trying to invent good way to pack my Roslyn analyzer projects into NuGet. It requires specific NuGet package structure with .dll put into \analyzer\, not \lib\.

For this to work, I have to call nuget pack <name>.nuspec, not nuget pack <name>.csproj. But if I use nuspec, than $version$ tag gets ignored.

Seems that my only option is to manually update version in .nuspec on every rebuild. What is correct and right way to accomplish this?

like image 279
Leotsarev Avatar asked Apr 25 '17 12:04

Leotsarev


1 Answers

I just had the same problem. I don't like the idea of adding an after-build instruction to my csproj file (I don't want to build the nuget package every time I compile), so instead I configured an "after build script" in AppVeyor:

nuget pack "yournuspecfile.nuspec" -Version %APPVEYOR_BUILD_VERSION%

The nuspec contains a dummy <version> tag, the actual version is specified in the nuget pack command using the %APPVEYOR_BUILD_VERSION% environment variable which is provided by AppVeyor

like image 186
Markus Hastreiter Avatar answered Nov 12 '22 08:11

Markus Hastreiter