Search code examples
filemsbuildconditional-statementsnugetnuspec

Optional or conditional folders in NuGet files tag?


I would like to do something that MsBuild has: set up conditions the files referenced in .nuspec file.

Basically it would look like this:

<files>
  <file src="myFolder/aaa/*.dll" target="lib\net45" condition="!Exists('bestFolder')" />
  <file src="bestFolder/ccc/*.dll" target="lib\net45" condition="Exists('bestFolder')" />
</files>

Is there a way to do this? There can be several more folders and files grouped by a specific condition. Also note that some folders should be scanned if they exist.

Thanks, CssaBee


Solution

  • no, right now this is not supported by NuGet. You can file a feature request for NuGet at https://nuget.codeplex.com/WorkItem/Create.