Itiviti / gradle-msbuild-plugin

Gradle plugin for msbuild execution, supports C# project files for now
Apache License 2.0
102 stars 57 forks source link

Bad handling of path parameters in a Linux environment #55

Open ghost opened 8 years ago

ghost commented 8 years ago

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)

novabyte commented 8 years ago

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

gluck commented 8 years ago

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 ?