Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easy to include NetCore-only and NetFx-only files #10572

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,36 @@
<SupportedPlatform Remove="iOS" />
</ItemGroup>

<!--
We provide a simple mechanism for including NetFx-only files.
If a C# file should only be compiled under NetFx, it can be named with a ".NetFx.cs" extension.
Or, the file can be included in a folder called "NetFx" or has a name that ends in "_NetFx".
-->
<ItemGroup Condition="'$(TargetFramework)' != '$(DefaultNetFxTargetFramework)'">
<Compile Remove="**\*.NetFx.cs" />
<Compile Remove="**\NetFx\**\*.*" />
<Compile Remove="**\*_NetFx\**\*.*" />

<None Include="**\*.NetFx.cs" />
<None Include="**\NetFx\**\*.*" />
<None Include="**\*_NetFx\**\*.*" />
</ItemGroup>

<!--
We provide a simple mechanism for including NetCore-only files.
If a C# file should only be compiled under NetCore, it can be named with a ".NetCore.cs" extension.
Or, the file can be included in a folder called "NetCore" or has a name that ends in "_NetCore".
-->
<ItemGroup Condition="'$(TargetFramework)' != '$(NetCurrent)' AND '$(TargetFramework)' != '$(NetPrevious)'">
<Compile Remove="**\*.NetCore.cs" />
<Compile Remove="**\NetCore\**\*.*" />
<Compile Remove="**\*_NetCore\**\*.*" />

<None Include="**\*.NetCore.cs" />
<None Include="**\NetCore\**\*.*" />
<None Include="**\*_NetCore\**\*.*" />
</ItemGroup>

<!--
Warn consumers until the underlying issue is fixed
https://github.com/dotnet/roslyn/issues/72657
Expand Down
15 changes: 0 additions & 15 deletions src/Razor/Directory.Build.targets

This file was deleted.