Native binaries: visualcpp toolchain creates unwanted directories

When I run simple builds for a NativeLibrarySpec with the visualcpp toolchain (msvc 2013), the build process leaves behind a Debug folder in the project root that contains any generated pdb and obj files from one of the passes.

Other than deleting this folder post-build, is there any way to disable/relocate this output?

What version of Gradle are you using? I have been using Gradle 1.12 extensively, and I don’t think I saw this problem. I know it’s a older version but still. Are you running the build through a Visual Studio generated solution? I know we did some minor tweak that we haven’t open sourced yet to fix some behaviour of running Gradle through Visual Studio.

I’ve run it on both gradle 2.9 and 2.10 rc1. Not using vs solution or project files - 100% all gradle. Visual Studio 2013 update 4 is installed on the system.

The Debug folder comes from Visual Studio. When VS starts a build, it creates an intermediate folder and an output folder for logs and other useless information since we are using Gradle. What I did was to modify the VS project post generation to redirect some path to a single folder (called visualStudio) and add this folder to .gitignore and cleanup task. The added code look like this:

    visualStudio {
      projects.all {
        projectFile.withXml {
          asNode().PropertyGroup.findAll({ it.@Label == 'NMakeConfiguration' }).each { configNode ->
            configNode.appendNode('IntDir', "${project.projectDir}${File.separator}visualStudio")
            configNode.appendNode('OutDir', "${project.projectDir}${File.separator}visualStudio")
          }
          asNode().PropertyGroup.findAll({ it.@Label == 'Configuration' }).each { configNode ->
            configNode.appendNode('BaseIntermediateOutputPath', "${project.projectDir}${File.separator}visualStudio")
          }
        }
      }
    }

I hope this helps.