Vanara/Directory.Build.targets

69 lines
2.8 KiB
XML

<Project>
<!-- Add common settings for all projects -->
<PropertyGroup>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);$(PlatformTarget)</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);ALLOWSPAN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(APPVEYOR)' == 'true' Or '$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<Reference Include="System" />
</ItemGroup>
<!-- Rebuild any x86 platform again with x64 -->
<!--<Target Name="AfterCompile">
<MSBuild Condition=" '$(Platform)' == 'x86' " Projects="$(MSBuildProjectFile)" Properties="Platform=x64;PlatFormTarget=x64" RunEachTargetSeparately="true" />
</Target>
<PropertyGroup Condition=" '$(UseX64)' != '' ">
<NuspecFile>$(MSBuildThisFileDirectory)x64.nuspec</NuspecFile>
<NuspecProperties>packageicon=$(PackageIcon);notes=$(PackageReleaseNotes);tags=$(PackageTags);projdir=$(MSBuildProjectDirectory)</NuspecProperties>
</PropertyGroup>-->
<!-- Establish exclude pattern for files starting with ~ -->
<ItemGroup>
<Compile Remove="**\~*.cs" />
<None Include="**\~*.cs" />
</ItemGroup>
<ItemGroup>
<Compile Remove="**\~*.vb" />
<None Include="**\~*.vb" />
</ItemGroup>
<!-- Establish include pattern for package readme files -->
<ItemGroup>
<None Include="**\pkgreadme.md" Pack="true" PackagePath="\" />
</ItemGroup>
<!-- Define Net5OrAbove variable -->
<PropertyGroup>
<Net5OrAbove>false</Net5OrAbove>
<Net5OrAbove Condition=" $(TargetFramework.StartsWith('net5')) Or $(TargetFramework.StartsWith('net6')) Or $(TargetFramework.StartsWith('net7')) ">true</Net5OrAbove>
</PropertyGroup>
<!-- Explicit target settings for .NET 5 or above -->
<PropertyGroup Condition=" $(Net5OrAbove) ">
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<ImportWindowsDesktopTargets>false</ImportWindowsDesktopTargets>
<UseWindowsForms>false</UseWindowsForms>
<UseWPF>false</UseWPF>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>
<!-- Explicit DEBUG target settings for .NET 5 or above -->
<PropertyGroup Condition=" '$(Configuration)'=='Debug' And $(Net5OrAbove)">
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
</PropertyGroup>
<!-- Explicit FrameworkReference in .NET 5 or above -->
<ItemGroup Condition=" $(Net5OrAbove) ">
<SupportedPlatform Include="windows" />
<FrameworkReference Include="Microsoft.NETCore.App" PrivateAssets="all" />
<FrameworkReference Include="Microsoft.WindowsDesktop.App" PrivateAssets="all" />
</ItemGroup>
</Project>