Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Octopack to use custom .nuspec file?

The documentation seems to be really incomplete. All it says is that you can use your own .nuspec file, but it makes no mention of where you're supposed to put it, or how to get octopack to use it.

http://docs.octopusdeploy.com/display/OD/Using+OctoPack

I've tried naming the .nuspec file the same thing that my solution is named and having it in the same directory. That didn't work.

I've tried modifying the .nuspec file that Octopack generates, but those changes just get overwritten every time I run it.

Everything else I try is just a shot in the dark.

Has anyone gotten this to work?

like image 261
matthew_360 Avatar asked Jan 22 '15 01:01

matthew_360


3 Answers

If you want to use a custom nuspec file (something different than your.project.name.nuspec, there is a msbuild property OctoPackNuSpecFileName, through wich you can specify your nuspec file, like this:

msbuild yoursolution.sln /p:RunOctoPack=true p:OctoPackNuSpecFileName=Dev.nuspec
like image 138
qbik Avatar answered Nov 16 '22 21:11

qbik


Another way to use a custom or conditional .nuspec file with OctoPack is by adding a PropertyGroup to your .csproj file, like this:

<PropertyGroup>
  <RunOctoPack>true</RunOctoPack>
</PropertyGroup>
<PropertyGroup>
  <OctoPackNuSpecFileName Condition="'$(Configuration)' == 'Release'">MyApp.nuspec</OctoPackNuSpecFileName>
  <OctoPackNuSpecFileName Condition="'$(Configuration)' != 'Release'">MyApp.Debug.nuspec</OctoPackNuSpecFileName>
</PropertyGroup>

Put the files MyApp.nuspec and MyApp.Debug.nuspec in the same directory as your .csproj file and you are good to go.

like image 44
eskimwier Avatar answered Nov 16 '22 23:11

eskimwier


blerg.

I'm a dummy.

The .nuspec file needs to be in the same directory as the .csproj file. This actually makes sense because it allows you to have a different nuspec file for each project in your solution.

Hopefully this post helps someone else.

like image 4
matthew_360 Avatar answered Nov 16 '22 23:11

matthew_360