gradle-msbuild-plugin icon indicating copy to clipboard operation
gradle-msbuild-plugin copied to clipboard

Bad handling of path parameters in a Linux environment

Open ghost opened this issue 8 years ago • 2 comments

Under Msbuild.groovy we have the code

        ['OutDir', 'OutputPath', 'BaseIntermediateOutputPath', 'IntermediateOutputPath', 'PublishDir'].each {
            if (cmdParameters[it] && !cmdParameters[it].endsWith('\\')) {
                cmdParameters[it] += '\\'
            }
        }

which doesn't look right on a Unix environment. I have a case similar to the documented help:

// overrides project OutputPath destinationDir = 'build/msbuild/bin' // overrides project IntermediaryOutputPath intermediateDir = 'build/msbuild/obj'

These paths will be modified to contain a '' in the end, causing the output to be copied to the wrong directory with the wrong name, e.g. (file 'bin\some_lib.dll' will be placed under build/ instead of build/bin/some_lib.dll)

ghost avatar Jan 26 '16 14:01 ghost

I have this problem as well. What is the intention behind adding \\ to the output paths?

novabyte avatar May 06 '16 10:05 novabyte

as far as I remember this was required because msbuild tasks on windows didn't append the separator automatically (and generated paths using string concat were completely off). One would have to check if mono msbuild also requires this, and either add the proper sep for mono, or not add it at all.

Any idea which case it is ?

gluck avatar May 06 '16 12:05 gluck