Appveyor nuget analyser
Asked Answered
S

2

7

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?

Straightout answered 25/4, 2017 at 12:31 Comment(3)
Is <name> the same and both .nuspec and .csproj are in the same folder?Amblyoscope
<name> is same, files in same folder BEFORE compilation. (it's same project that you helped me before).Straightout
@ilyaf I secretly hope on help from you :-)Straightout
S
0

Correct way is:

  1. Call nuget pack .nuspec from .csproj
  2. Pass Version extracted from Assembly as parameters.
  3. Make Appveyor update version on rebuild
  4. Configure Appveyor to capture .nupkg`s to artifacts and push it.

See https://github.com/leotsarev/hardcode-analyzer as example

Straightout answered 21/7, 2017 at 13:55 Comment(0)
M
1

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

Monosyllable answered 26/5, 2018 at 10:58 Comment(0)
S
0

Correct way is:

  1. Call nuget pack .nuspec from .csproj
  2. Pass Version extracted from Assembly as parameters.
  3. Make Appveyor update version on rebuild
  4. Configure Appveyor to capture .nupkg`s to artifacts and push it.

See https://github.com/leotsarev/hardcode-analyzer as example

Straightout answered 21/7, 2017 at 13:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.