-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
22 lines (20 loc) · 1.31 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
22 lines (20 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<Project>
<!-- Polyfill source files compile ONLY in AdocNet.Ast (the leaf assembly).
All other multi-targeted projects access polyfill types via InternalsVisibleTo.
This avoids extension method ambiguity when multiple assemblies each define the same types. -->
<ItemGroup Condition="'$(TargetFrameworks)' != '' and '$(RootNamespace)' == 'AdocNet.Ast'">
<Compile Include="$(MSBuildThisFileDirectory)src\Polyfills\*.cs" LinkBase="Polyfills" />
</ItemGroup>
<!-- Global usings for the compatibility namespace — included in ALL multi-targeted projects
so extension methods from the polyfills (compiled in AdocNet.Ast) are accessible. -->
<ItemGroup Condition="'$(TargetFrameworks)' != '' and '$(RootNamespace)' != 'AdocNet.Ast'">
<Compile Include="$(MSBuildThisFileDirectory)src\Polyfills\GlobalUsings.ns20.cs" LinkBase="Polyfills" />
</ItemGroup>
<!-- Suppress CS0436 (type conflicts with imported type) for NS2.0 polyfills.
This is expected when multiple assemblies in the same solution each compile
the same internal polyfill types (Index, Range, IsExternalInit, etc.).
The compiler resolves correctly by using the locally defined type. -->
<PropertyGroup Condition="'$(TargetFrameworks)' != ''">
<NoWarn>$(NoWarn);CS0436;CS1685</NoWarn>
</PropertyGroup>
</Project>