From: Alexander Köplinger Date: Sat, 13 May 2017 15:26:35 +0000 (+0200) Subject: [csproj] Update generator to handle platform-specific assemblies (#4847) X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=291a32febcc78ff5b9c01fd9da7c5ef776795523 [csproj] Update generator to handle platform-specific assemblies (#4847) After https://github.com/mono/mono/pull/4837 was merged the csproj update bot started sending PRs which hardcoded net_4_x-linux as the OutputPath. Updated the csproj generator to detect this and use a variable in the OutputPath instead. It'll autodetect based on the current OS and can be overriden by passing /p:HostPlatform=foobar to msbuild. Ideally we'd have configurations for each platform in the csproj since in the future the file lists will be different but this is a first step. --- diff --git a/mcs/.gitignore b/mcs/.gitignore index ac21fbc31e5..03dd1654820 100644 --- a/mcs/.gitignore +++ b/mcs/.gitignore @@ -21,7 +21,7 @@ class/RabbitMQ.Client/docs/specs/autogenerated-api-qpid-0-8.cs class/System.Web.Mvc/System.Web.Mvc/Resources/MvcResources.resources class/System.Web.Mvc2/System.Web.Mvc/Resources/MvcResources.resources XmlWriter -obj-net_4_x +obj-net_4_x* obj-bare obj-plainweb obj-Facades @@ -30,3 +30,4 @@ obj-plaindesign obj-plainservice obj-secxml obj-mcs-net_4_x +obj-legacy diff --git a/msvc/scripts/csproj.tmpl b/msvc/scripts/csproj.tmpl index 4c7e1dba137..1b2e850e5e3 100644 --- a/msvc/scripts/csproj.tmpl +++ b/msvc/scripts/csproj.tmpl @@ -9,6 +9,9 @@ @PROJECTGUID@ @OUTPUTTYPE@ @DISABLEDWARNINGS@ + win32 + darwin + linux @OUTPUTDIR@ obj-@OUTPUTSUFFIX@ false diff --git a/msvc/scripts/genproj.cs b/msvc/scripts/genproj.cs index bf450539688..378d1c00db7 100644 --- a/msvc/scripts/genproj.cs +++ b/msvc/scripts/genproj.cs @@ -900,6 +900,12 @@ class MsbuildGenerator { else build_output_dir = "bin\\Debug\\" + library; + if (build_output_dir.Contains ("-linux") || build_output_dir.Contains ("-darwin") || build_output_dir.Contains ("-win32")) + build_output_dir = build_output_dir + .Replace ("-linux", "-$(HostPlatform)") + .Replace ("-darwin", "-$(HostPlatform)") + .Replace ("-win32", "-$(HostPlatform)"); + bool basic_or_build = (library.Contains ("-basic") || library.Contains ("-build")); //