-
Notifications
You must be signed in to change notification settings - Fork 534
/
Copy pathXamarin.Android.PCLSupport.targets
60 lines (52 loc) · 3.54 KB
/
Xamarin.Android.PCLSupport.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- PCL Support -->
<PropertyGroup>
<_IsXBuild Condition="'$(MSBuildRuntimeVersion)' == ''">true</_IsXBuild>
<CheckForSystemRuntimeDependency>true</CheckForSystemRuntimeDependency>
<ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades>
<ResolveReferencesDependsOn>
$(ResolveReferencesDependsOn);
ImplicitlyExpandDesignTimeFacades
</ResolveReferencesDependsOn>
<ImplicitlyExpandDesignTimeFacadesDependsOn>
$(ImplicitlyExpandDesignTimeFacadesDependsOn);
GetReferenceAssemblyPaths
</ImplicitlyExpandDesignTimeFacadesDependsOn>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).props"
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).props') And ('$(_IsXBuild)' != 'true' And Exists ('$(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll'))" />
<Target Name="ImplicitlyExpandDesignTimeFacades" Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'" DependsOnTargets="$(ImplicitlyExpandDesignTimeFacadesDependsOn)">
<ItemGroup>
<_XACandidateNETStandardReferences Include="@(Reference);@(_ResolvedProjectReferencePaths)" />
</ItemGroup>
<PropertyGroup>
<_HasReferenceToSystemRuntime Condition="'$(DependsOnSystemRuntime)' == 'true' or '%(_ResolvedProjectReferencePaths.TargetPlatformIdentifier)' == 'Portable'
or '%(ReferenceDependencyPaths.Filename)' == 'System.Runtime'">true</_HasReferenceToSystemRuntime>
<_XANETStandardInbox Condition="'$(XI_NETStandardInbox)' == '' and Exists('%(XI_InboxNETStandardFolders.Identity)\netstandard.dll')">true</_XANETStandardInbox>
</PropertyGroup>
<!--
Facades are expanded if we have a reference that depends on System.Runtime .
XI projects have `$(TargetFrameworkIdentifier) != .NETFramework`, so Microsoft.NET.Build.Extensions (which provides support for ns 2.0 projects) doesn't get
imported. And netstandard.dll reference, even if required, doesn't get added.
So, we need to check if any references depend on `netstandard`. And if so, expand the facades, which include netstandard.dll .
If $(_HasReferenceToSystemRuntime) is true, then the facades are going to be expanded anyway, so don't run this.
-->
<GetDependsOnNETStandard
Condition="'$(_HasReferenceToSystemRuntime)' != 'true' and '$(_IsXBuild)' != 'true' and '$(DependsOnNETStandard)' == '' and '@(_XACandidateNETStandardReferences->Count())' != '0'"
References="@(_XACandidateNETStandardReferences)">
<Output TaskParameter="DependsOnNETStandard" PropertyName="_XADependsOnNETStandard" />
</GetDependsOnNETStandard>
<ItemGroup Condition="'$(_HasReferenceToSystemRuntime)' == 'true' or ('$(_XANETStandardInbox)' == 'true' and '$(_XADependsOnNETStandard)' == 'true')">
<_DesignTimeFacadeAssemblies Include="%(DesignTimeFacadeDirectories.Identity)*.dll"/>
<ReferencePath Remove="@(_DesignTimeFacadeAssemblies)"/>
<ReferencePath Include="%(_DesignTimeFacadeAssemblies.Identity)">
<WinMDFile>false</WinMDFile>
<CopyLocal>false</CopyLocal>
<ResolvedFrom>ImplicitlyExpandDesignTimeFacades</ResolvedFrom>
</ReferencePath>
<ReferenceDependencyPath Include="@(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" />
</ItemGroup>
<Message Importance="Low" Text="Including @(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" />
</Target>
</Project>