Vanara/Directory.Build.targets

43 lines
1.8 KiB
XML

<Project>
<PropertyGroup>
<Net5OrAbove>false</Net5OrAbove>
<Net5OrAbove Condition=" $(TargetFramework.StartsWith('net5')) Or $(TargetFramework.StartsWith('net6')) Or $(TargetFramework.StartsWith('net7')) ">true</Net5OrAbove>
</PropertyGroup>
<!-- Explicit FrameworkReference in .NET 5 or above -->
<PropertyGroup Condition=" $(Net5OrAbove) ">
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<ImportWindowsDesktopTargets>false</ImportWindowsDesktopTargets>
<UseWindowsForms>false</UseWindowsForms>
<UseWPF>false</UseWPF>
</PropertyGroup>
<!-- Explict framework reference for .NET 5 or above -->
<ItemGroup Condition=" $(Net5OrAbove) ">
<FrameworkReference Include="Microsoft.NETCore.App" PrivateAssets="all" />
<FrameworkReference Include="Microsoft.WindowsDesktop.App" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);$(PlatformTarget)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $(TargetFramework.StartsWith('netstandard')) Or $(TargetFramework.StartsWith('netcore')) Or '$(TargetFramework)' == 'net45' Or $(TargetFramework.StartsWith('net5')) ">
<DefineConstants>$(DefineConstants);ALLOWSPAN</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('net2')) Or $(TargetFramework.StartsWith('net3')) Or $(TargetFramework.StartsWith('net4')) ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Remove="**\~*.cs" />
<None Include="**\~*.cs" />
<SupportedPlatform Include="windows" />
</ItemGroup>
<ItemGroup>
<Compile Remove="**\~*.vb" />
<None Include="**\~*.vb" />
<SupportedPlatform Include="windows" />
</ItemGroup>
</Project>