[msbuild][mac] Fix regression in facade paths for Full/Modern projects (#2655)

Regression from:
----------------
commit e5d012c5b8
Author: Chris Hamons <chris.hamons@xamarin.com>
Date:   Mon Aug 14 13:17:10 2017 -0500

[macos] System mono should resolve non-XM libraries from system (#2480)
----------------

The way this manifests is that for (eg.) a `TargetFrameworkName=Full` project,
after the `FixTargetFrameworkDirectory`(X.M.Common.targets) target we end up with
`$(TargetFrameworkDirectory)` having value of:

    /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5
    /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/4.6.1-api/Facades/

.. and the second path is incorrect. It should have been:

    /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/Facades

This path fixup is done by `FixDesignTimeFacades` (X.M.msbuild.targets)
target, but this target is running *after*
`FixTargetFrameworkDirectory`, so it doesn't see the fixed facade path!

Both `FixTargetFrameworkDirectory` and `FixDesignTimeFacades` have
`AfterTargets="GetReferenceAssemblyPaths`. But since
`FixTargetFrameworkDirectory` is defined before the
`Xamarin.Mac.msbuild.targets` import, so it gets executed before
`FixDesignTimeFacades`.
This commit is contained in:
Ankit Jain 2017-09-13 09:33:33 -04:00 коммит произвёл Chris Hamons
Родитель ef423c1bab
Коммит 866c65468d
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -95,8 +95,10 @@ Copyright (C) 2014 Xamarin. All rights reserved.
<AssemblySearchPaths Condition="'$(MSBuildRuntimeVersion)' != ''">$(AssemblySearchPaths.Split(';'))</AssemblySearchPaths>
</PropertyGroup>
<Target Name="FixDesignTimeFacades" AfterTargets="GetReferenceAssemblyPaths" Condition="'$(OS)' != 'Windows_NT'" />
<!-- Location of Libraries -->
<Target Name="FixTargetFrameworkDirectory" AfterTargets="GetReferenceAssemblyPaths" Condition="('$(OS)' != 'Windows_NT')">
<Target Name="FixTargetFrameworkDirectory" AfterTargets="FixDesignTimeFacades" Condition="('$(OS)' != 'Windows_NT')">
<PropertyGroup>
<!-- For Modern / Full we overwrite TargetFrameworkDirectory to resolve non XM assemblies from our location only -->
<TargetFrameworkDirectory Condition="'$(TargetFrameworkName)' != 'System'">$(MacBclPath);@(DesignTimeFacadeDirectories)</TargetFrameworkDirectory>