Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include directories recursively in NuSpec file

I have a folder structure like this in my project...

Project/Folder1/Folder2
-File1
-File2
-File3

Project/Folder1/Folder3
-File4
-File5
-File6

Project/Folder1/Folder4
-File7
-File8

In a NuSpec definition file, how can I tell it to include everything under Folder1 (folders and files recursively)?

Can I just do this or do I need a double ** or what?

<file src="Project\Folder1\*.*" target="Project/Folder1" />
like image 271
kyleb Avatar asked Jun 16 '14 18:06

kyleb


People also ask

What does Nuspec file do?

A . nuspec file is an XML manifest that contains package metadata. This manifest is used both to build the package and to provide information to consumers. The manifest is always included in a package.

What is add recursively?

It means it will also recurse into subdirectories and add those files.

Where do I put Nuspec files?

A NUSpec file contains package metadata and is used to create a package. A package is created from your project, which is why it would make sense to place the NUSpec file in the project folder.


1 Answers

You can use the wildcard ** which is documented on the NuGet web site. From the NuGet docs:

Using a double wildcard, **, implies a recursive directory search.

<file src="tools\**\*.*" exclude="**\*.log" />
<file src="lib\**" target="lib" />
like image 124
Matt Ward Avatar answered Oct 17 '22 15:10

Matt Ward