forked from meziantou/Meziantou.Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
46 lines (35 loc) · 3.25 KB
/
Directory.Build.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
<Project>
<Import Project="$(MSBuildThisFileDirectory)/eng/npm.targets" />
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<Compile Include="$(MSBuildThisFileDirectory)/common/AssemblyInfo.cs"
Link="Properties/AssemblyInfo.common.cs" />
<Compile Condition="'$(SkipLocalsInit)' == 'true'"
Include="$(MSBuildThisFileDirectory)/common/AssemblyInfo.SkipLocalsInit.cs"
Link="Properties/AssemblyInfo.SkipLocalsInit.cs" />
<Compile Condition="'$(CompatibilityRange)' == 'true'"
Include="$(MSBuildThisFileDirectory)/common/Range.cs"
Link="Properties/Range.cs" />
<Compile Condition="'$(CompatibilityRecord)' == 'true'"
Include="$(MSBuildThisFileDirectory)/common/IsExternalInit.cs"
Link="Properties/IsExternalInit.cs" />
<Compile Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net472'"
Include="$(MSBuildThisFileDirectory)/common/NullableAttributes.cs"
Link="Properties/NullableAttributes.cs" />
<Compile Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net472'"
Include="$(MSBuildThisFileDirectory)/common/PlatformAttributes.cs"
Link="Properties/PlatformAttributes.cs" />
<Compile Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net471' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'net6.0'"
Include="$(MSBuildThisFileDirectory)/common/StringSyntaxAttribute.cs"
Link="Properties/StringSyntaxAttribute.cs" />
</ItemGroup>
<!-- Ensure the latest framework is a target of the project -->
<Target Name="CheckLatestFramework" BeforeTargets="Build" Condition="$(MSBuildProjectFile) != 'build.proj' AND $(ValidateProjectTargets) == true AND $(IsSampleProject) != false AND $(TargetFrameworks.Contains('$(LatestTargetFramework)')) == false">
<Error Text="The project '$(MSBuildProjectFile)' must target $(LatestTargetFramework)" />
</Target>
<Target Name="CheckPreviewFramework" BeforeTargets="Build" Condition="$(LatestTargetFrameworkLts) != '' AND $(MSBuildProjectFile) != 'build.proj' AND $(ValidateProjectTargets) == true AND $(IsSampleProject) != false AND $(TargetFrameworks.Contains('$(LatestTargetFrameworkLts)')) == false">
<Error Text="The project '$(MSBuildProjectFile)' must target $(LatestTargetFrameworkLts)" />
</Target>
<Target Name="CheckPreviewFramework" BeforeTargets="Build" Condition="$(LatestTargetFrameworkPreview) != '' AND $(MSBuildProjectFile) != 'build.proj' AND $(ValidateProjectTargets) == true AND $(IsSampleProject) != false AND $(TargetFrameworks.Contains('$(LatestTargetFrameworkPreview)')) == false">
<Error Text="The project '$(MSBuildProjectFile)' must target $(LatestTargetFrameworkPreview)" />
</Target>
</Project>