Jan 30, 2014 at 11:46 AM
Edited Jan 30, 2014 at 1:25 PM
Hi, my project has the following structure:
I'd like to package the project so that it has the following output:
Notice how I don't wish to package the Views and the Assets are within a sub directory. Here's my current .nuspec file
<file src="Assets\**" target="content\Assets\Editor" />
Now when I say:
NuGet.exe pack Editor.csproj -Build -Properties Configuration=Release
It creates a package with the following content directory:
After consulting the
the following line had caught me out:
Note that if you specify any files, the conventions are ignored and only the files listed in the .nuspec file are included in the package.
I realized this is only when you execute the nuget pack command against the .nuspec file. While this will solve my problem I like the idea of doing it against the .csproj file so that the tokens are automatically copied and I don't have to maintain the version,
name description etc in two places.
I was able to change my NuGet command to:
NuGet.exe pack Editor.csproj -Build -Properties Configuration=Release -Exclude "Views\**"
This now ignores the Views directory but if I say:
NuGet.exe pack Editor.csproj -Build -Properties Configuration=Release -Exclude "Assets\**;Views\**"
Then I get no Assets directory at all. I'd really appreciate it if someone could suggest how I can achieve my desired output. Thanks
Please note that I do not wish to change the build action as I find this tedious and I know when I add Assets/Views later I will accidently forget to change the build action.