KOliver
KOliver

Reputation: 13

Automate NuGet package to include only .js files (not within a csproj or nuspec file)

I'm trying to automate creating a NuGet package to include .js files within my web project via Visual Studio 2013 when builds are run. I have done this using the NuGet Package Explorer but this needs to be automated.

I have used the Nuget package "CreateNewNuGetPackageFromProjectAfterEachBuild" and this seems close but the CreateNuGetPackage.ps1 script restricts to csproj files. Has anyone done this? I have searched and read that a powershell solution may be needed.

Does anyone know if this has been solved yet? At this point I'm ready to learn how to write a powershell script.

Upvotes: 1

Views: 434

Answers (1)

Piotr Stapp
Piotr Stapp

Reputation: 19830

I suggest you to create proper nuspec file with wildchars like below:

<files>
  <file src="bin\Debug\*.dll" target="lib" /> 
  <file src="bin\Debug\*.pdb" target="lib" /> 
  <file src="tools\**\*.*" exclude="**\*.log" />
</files>

and run just: nuget.exe pack yournuspec.nuspec

Upvotes: 1

Related Questions