-
-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
65 lines (54 loc) · 4.44 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
65 lines (54 loc) · 4.44 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<Project>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net11.0'))">
<Features>$(Features);runtime-async=on</Features>
</PropertyGroup>
<!-- Trimming is not supported on the older targets, so a multi-targeting project can set IsTrimmable unconditionally -->
<PropertyGroup Condition="'$(TargetFramework)' != '' AND '$(IsTrimmable)' == 'true' AND !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsTrimmable>false</IsTrimmable>
</PropertyGroup>
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<Compile Include="$(MSBuildThisFileDirectory)/common/AssemblyInfo.cs"
Link="Properties/AssemblyInfo.common.cs"
Visible="false" />
</ItemGroup>
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj' and '@(ProjectReference->WithMetadataValue(`Filename`, `Meziantou.Framework.FullPath`))' != '' and '@(ProjectReference->WithMetadataValue(`Filename`, `Meziantou.Framework.FullPath.Analyzer`))' == ''">
<ProjectReference Include="$(MSBuildThisFileDirectory)src/Meziantou.Framework.FullPath.Analyzer/Meziantou.Framework.FullPath.Analyzer.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
PrivateAssets="all"
SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup>
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj' and '@(ProjectReference->WithMetadataValue(`Filename`, `Meziantou.Framework.Assertions`))' != '' and '@(ProjectReference->WithMetadataValue(`Filename`, `Meziantou.Framework.Assertions.Analyzer`))' == ''">
<ProjectReference Include="$(MSBuildThisFileDirectory)src/Meziantou.Framework.Assertions.Analyzer/Meziantou.Framework.Assertions.Analyzer.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
PrivateAssets="all"
SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="$(MSBuildThisFileDirectory)src/Meziantou.Framework.Assertions.CodeFix/Meziantou.Framework.Assertions.CodeFix.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
PrivateAssets="all"
SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup>
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj' and '@(ProjectReference->WithMetadataValue(`Filename`, `Meziantou.Framework.Yaml`))' != '' and '@(ProjectReference->WithMetadataValue(`Filename`, `Meziantou.Framework.Yaml.SourceGenerator`))' == ''">
<ProjectReference Include="$(MSBuildThisFileDirectory)src/Meziantou.Framework.Yaml.SourceGenerator/Meziantou.Framework.Yaml.SourceGenerator.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
PrivateAssets="all"
SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup>
<!-- Compile the Meziantou.Framework.Roslyn sources and configure the ROSLYN_* constants -->
<ItemGroup Condition="'$(IncludeRoslynHelpers)' == 'true'">
<Compile Include="$(MSBuildThisFileDirectory)src/Meziantou.Framework.Roslyn/**/*.cs" LinkBase="Roslyn" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)src/Meziantou.Framework.Roslyn/buildTransitive/Meziantou.Framework.Roslyn.targets" Condition="'$(IncludeRoslynHelpers)' == 'true'" />
<Target Name="ConfigurePolyfill" AfterTargets="ResolveLockFileAnalyzers" BeforeTargets="CoreCompile">
<PropertyGroup>
<MeziantouPolyfill_ExcludedPolyfills Condition="@(Analyzer->AnyHaveMetadataValue('NuGetPackageId', 'Microsoft.Windows.CsWin32'))">T:System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute|T:System.Diagnostics.CodeAnalysis.UnscopedRefAttribute</MeziantouPolyfill_ExcludedPolyfills>
</PropertyGroup>
</Target>
<!-- Ensure the latest framework is a target of the project -->
<Target Name="CheckLatestFramework" BeforeTargets="Build" Condition="'$(MSBuildProjectExtension)' != '.proj' AND '$(ValidateProjectTargets)' == 'true' AND '$(IsSampleProject)' != 'true' AND $(TargetFrameworks.Contains('$(LatestTargetFramework)')) == false AND $(TargetFramework.Contains('$(LatestTargetFramework)')) == false">
<Error Text="The project '$(MSBuildProjectFile)' must target $(LatestTargetFramework)" />
</Target>
</Project>