Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding files from nuget package while including all

This question is similar but doesn't quite help me.

I'm using the following <file> tag to try to add all files except for one folder, but it's not working.

<file src="**" exclude="BuildConfig" />

** successfully copies all folders and contents, but the exclude isn't working.

I have tried several variations:

<file src="**" exclude="**\BuildConfig" />
<file src="**" exclude="**\BuildConfig\*" />
<file src="**" exclude="**\BuildConfig\*.*" />
// mentioned in the question above, not sure why you would need to .. back if it's a root folder
<file src="**" exclude="..\BuildConfig\*.*" /> 

And basically every combination I could think of.

My output nuget zip looks like this:

- App
- App_Data
- BuildConfig
- Views
- etc

How can I exclude this folder at the root level while doing an include all?

I'm building this using octopack for octopus deploy, if that matters.

like image 842
DLeh Avatar asked Sep 14 '25 23:09

DLeh


1 Answers

Figured it out. I was trying to do BuildConfig\* which wasn't finding files, because they were all in subfolders.

The following script removed all files from the BuildConfig folder and subfolders, causing the folder to not be included:

<file src="**" exclude="**\BuildConfig\**" />
like image 100
DLeh Avatar answered Sep 17 '25 20:09

DLeh