Extent NuGet Build for folder depending an Configuration

Jan 3, 2015 at 7:34 PM
Hi,

I changed your code NuGetCretor.cs in nuget builder, so that I can define Release and Debug folders in a nuget project. With this change it is possible to add a "Release" or "Debug" Folder and define their the src, lib or tool folders. If you build the project the code finds the folders and use only this one, which match the BuildConfiguration.
I think this feature is missing in all other nuget projects, which I found on Nuget os VS-Gallery.
I don't want 2 projects with nearly the same content, where the difference is only the location of a dll or config file.
public IEnumerable<DependencyInfo> GetContentFiles(
            string nuspecFolder, string projectFolder, string projectPath, bool? isDebug,
            string srcFolder, string destFolder, string folderExtension = "",
            bool flattern = false, ElementType elementType = ElementType.ContentFile)
        {
....            

            if (isDebug.HasValue)
            {
                string dirExtension = isDebug.Value ? @"Debug\" : @"Release\";

                items.AddRange(this.GetContentFiles(nuspecFolder, projectFolder, projectPath, null, srcFolder, destFolder, dirExtension, false, elementType));
            }
....
        }
It could be nice if you can implement this feauture in your code or
I can send you the complete NugetCreator.cs file with all changes.

Greating gclpixel
Coordinator
Jan 3, 2015 at 9:39 PM
Hi,
  1. Do you think that all folders need debug and release versions (i.e. src, tools, sln, build) or only or the lib folder? (BTW, for project reference based libs, this is already supported.)
  2. Could you change this to make it backward compatible, so that if the debug and release sub-folders do not exist, it takes the files from the same (parent) folder it does now.
  3. Can you add tests (+ demo package project(s)) for this to the solution and send me a zip with all the changes (including test and demo projects).
Thanks,
Danny.
Coordinator
Sep 2, 2015 at 2:48 PM
gclpixel wrote:
Hi,

I changed your code NuGetCretor.cs in nuget builder, so that I can define Release and Debug folders in a nuget project. With this change it is possible to add a "Release" or "Debug" Folder and define their the src, lib or tool folders. If you build the project the code finds the folders and use only this one, which match the BuildConfiguration.
I think this feature is missing in all other nuget projects, which I found on Nuget os VS-Gallery.
I don't want 2 projects with nearly the same content, where the difference is only the location of a dll or config file.
public IEnumerable<DependencyInfo> GetContentFiles(
            string nuspecFolder, string projectFolder, string projectPath, bool? isDebug,
            string srcFolder, string destFolder, string folderExtension = "",
            bool flattern = false, ElementType elementType = ElementType.ContentFile)
        {
....            

            if (isDebug.HasValue)
            {
                string dirExtension = isDebug.Value ? @"Debug\" : @"Release\";

                items.AddRange(this.GetContentFiles(nuspecFolder, projectFolder, projectPath, null, srcFolder, destFolder, dirExtension, false, elementType));
            }
....
        }
It could be nice if you can implement this feauture in your code or
I can send you the complete NugetCreator.cs file with all changes.

Greating gclpixel
Hi gclpixel,

I forgot to ask, isn't this already covered by the current feature where the bin folders processed are according to the solution's (the NuGet project's) build configuration (Debug/Release)?

Regards,
Danny.