I have a teamcity build configuration with 3 build steps:
- NuGet installer, points to a .sln file
- Build web application - MSBuild runner targeting project1.csproj (for simplicity) where a project1.nuspec file with a sections exists as well
- Build class library - MSBuild runner targeting project2.csproj, again, a project2.nuspec file with a section exists as well
Both project1 and project2 have octopack installed, and are configured with, respectively:
/P:Configuration=Release /p:OctoPackNuGetProperties=suffix=Release /p:OctoPackEnforceAddingFiles=true
and
/P:Configuration=Release /p:OctoPackNuGetProperties=suffix=Release /p:OctoPackEnforceAddingFiles=false
What I want to achieve is:
The web application in step 2) is built with octopacks “default include files” AND the few selected files I have specified in the section - and the output is placed in Project1.nupkg
Secondly, the class library is built without the “default include” - so only the files specified in the sections should be present in the Project2.nupkg package.
What I experience is:
The value of the last OctoPackEnforceAddingFiles=false is applied to BOTH build steps. So either I get both packages with ONLY the files specified in the nuspec files, or I get both packages with “default files” AND the nuspec specified content.
What have I tried?
If i disable the last build step (3), I can get the output in build step 2) the way I want it by toggling the true/false command line parameter. So that part works. As soon as I enable the last build step, it is the value of the command line parameter in that build step, that determines how both build steps behave.
Does anyone have an idea how to proceed? Build step 3) produces output that I dont want in the nupkg file, so I have to set OctoPackEnforceAddingFiles to false. And I want project1 to have everything “default included” as well, so that one needs to have it set to true.
Any help would be very much appreciated
Best regards
Jan Hansen