-
Notifications
You must be signed in to change notification settings - Fork 1
/
Directory.Build.targets
86 lines (65 loc) · 4.4 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<Project>
<Import Sdk="PostSharp.Engineering.Sdk" Project="AssemblyMetadata.targets"/>
<Import Sdk="PostSharp.Engineering.Sdk" Project="TeamCity.targets"/>
<Import Sdk="PostSharp.Engineering.Sdk" Project="CodeQuality.targets"/>
<Import Sdk="PostSharp.Engineering.Sdk" Project="CleanXmlDoc.targets" Condition="'$(EngineeringConfiguration)'=='Public'"/>
<PropertyGroup Condition="'$(DisableCodeQuality)'=='True'">
<!--
CS8600: Converting null literal or possible null value to non-nullable type.
CS8601: Possible null reference assignment.
CS8602: Dereference of a possibly null reference.
CS8603: Possible null reference return.
CS8604: Possible null reference argument for parameter 'x' in 'y'.
CS8605: Unboxing possibly null value.
CS8619:
CS8620: Argument of type 'x' cannot be used for parameter 'y' of type 'x due to differences in the nullability of reference types.
CS8767:Nullability of reference types in type of parameter 'x' of 'y' doesn't match implicitly implemented member 'x'.
IDE0079: Unnecessary suppression.
-->
<NoWarn>$(NoWarn),CS8600,CS8601,CS8602,CS8603,CS8604,CS8605,CS8619,CS8620,CS8767,IDE0079</NoWarn>
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn),SA0001</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Metalama.Compiler" PrivateAssets="all" Condition="'$(UseMetalamaCompiler)'=='Private'" />
<PackageReference Include="Metalama.Compiler" Condition="'$(UseMetalamaCompiler)'=='Public'"/>
</ItemGroup>
<PropertyGroup>
<!-- When debugging the release build, disable optimizations. -->
<!-- <Optimize>False</Optimize> -->
</PropertyGroup>
<!-- Handles the inclusion of Metalama.SystemTypes in projects. The full version is included automatically for projects that target frameworks that need it.
Newer TFMs get a version of the assembly that forwards the necessary types to system assemblies.
To disable, use the ReferenceMetalamaSystemTypes property. -->
<PropertyGroup>
<_RequiresSystemTypes Condition="'$(TargetFramework)'=='netstandard2.0' OR '$(TargetFramework)'=='net472' OR '$(TargetFramework)'=='netframework4.8'">True</_RequiresSystemTypes>
</PropertyGroup>
<ItemGroup Condition="'$(ReferenceMetalamaSystemTypes)'!='False'">
<ProjectReference Include="$(MSBuildThisFileDirectory)/Metalama.SystemTypes/Metalama.SystemTypes.csproj" ReferenceOutputAssembly="false" />
<Reference Include="$(MSBuildThisFileDirectory)/Metalama.SystemTypes/bin/$(Configuration)/netstandard2.0/Metalama.SystemTypes.dll" Condition="'$(_RequiresSystemTypes)'=='True'" />
<Reference Include="$(MSBuildThisFileDirectory)/Metalama.SystemTypes/bin/$(Configuration)/net6.0/Metalama.SystemTypes.dll" Condition="'$(_RequiresSystemTypes)'!='True'" />
</ItemGroup>
<PropertyGroup Condition="'$(PackMetalamaSystemTypes)'=='True'">
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);MetalamaFrameworkSetLibAssembliesInPackage</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
<Target Name="MetalamaFrameworkSetLibAssembliesInPackage" DependsOnTargets="ResolveReferences">
<ItemGroup>
<TfmSpecificPackageFile Include="$(MSBuildThisFileDirectory)/Metalama.SystemTypes/bin/$(Configuration)/netstandard2.0/Metalama.SystemTypes.dll" PackagePath="lib/$(TargetFramework)" Condition="'$(_RequiresSystemTypes)'=='True'" />
<TfmSpecificPackageFile Include="$(MSBuildThisFileDirectory)/Metalama.SystemTypes/bin/$(Configuration)/net6.0/Metalama.SystemTypes.dll" PackagePath="lib/$(TargetFramework)" Condition="'$(_RequiresSystemTypes)'!='True'" />
</ItemGroup>
</Target>
<!-- Include the package version in metadata. -->
<Target Name="AddAssemblyMetadata"
BeforeTargets="GenerateAdditionalSources"
DependsOnTargets="RunResolvePackageDependencies"
Condition="'$(AddAssemblyMetadataAttributes)'!='False'">
<ItemGroup>
<!-- Add all package versions to metadata -->
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Package:%(PackageDefinitions.Name)</_Parameter1>
<_Parameter2>%(PackageDefinitions.Version)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>
</Project>