-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.Default.targets
121 lines (106 loc) · 7.53 KB
/
Directory.Build.Default.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!-- Defines the default metadata for .NET projects (epilog) -->
<Project InitialTargets="TraceDirectoryBuildDefaultTargets">
<Import Project="TargetFramework.targets"/>
<Import Project="Boot.Runtime.props" Condition="'$(BootRuntimeImported)' == ''"/>
<!-- Package default properties -->
<PropertyGroup>
<AssemblyTitle Condition="'$(AssemblyTitle)' == ''">$(AssemblyName)</AssemblyTitle>
<AssemblyTitle>$(AssemblyTitle) ($(RuntimeIdentifier).$(TargetFramework))</AssemblyTitle>
<FirstCopyrightYear Condition="'$(FirstCopyrightYear)' == ''"></FirstCopyrightYear>
<LastCopyrightYear Condition="'$(LastCopyrightYear)' == ''">$([System.DateTime]::Now.ToString(yyyy))</LastCopyrightYear>
<CopyrightYears Condition="'$(CopyrightYears)' == '' And ('$(FirstCopyrightYear)' == '' Or '$(FirstCopyrightYear)' == '$(LastCopyrightYear)')">$(LastCopyrightYear)</CopyrightYears>
<CopyrightYears Condition="'$(CopyrightYears)' == ''">$(FirstCopyrightYear)-$(LastCopyrightYear)</CopyrightYears>
<Copyright Condition="'$(Copyright)' == ''">Copyright © $(CopyrightYears), EPSITEC SA, CH-1400 Yverdon-les-Bains, Switzerland</Copyright>
<Authors Condition="'$(Authors)' == ''">$(Company)</Authors>
<Product Condition="'$(Product)' == ''">$(AssemblyName)</Product>
<Description Condition="'$(Description)' == ''">$(Product)</Description>
<Description>$(Description) - $(Version) $(TargetFramework)</Description>
<Description Condition="'$(RuntimeIdentifier)' != ''">$(Description)-$(RuntimeIdentifier)</Description>
<DefaultLanguage Condition="'$(DefaultLanguage)' == ''">en-US</DefaultLanguage>
</PropertyGroup>
<PropertyGroup Condition="'$(IsPackable)' != 'false'">
<PackageId Condition="'$(PackageId)' == ''">$(ProjectName)</PackageId>
<PackageId Condition="!$(PackageId.StartsWith('$(Company)')) And !$(Company.Contains(' '))">$(Company).$(PackageId)</PackageId>
<DefaultPackageTags>$(PackageId.Replace('.', ';'))</DefaultPackageTags>
<PackageTags Condition="'$(PackageTags)' != ''">$(DefaultPackageTags);$(PackageTags)</PackageTags>
<PackageTags Condition="'$(PackageTags)' == ''">$(DefaultPackageTags)</PackageTags>
<PackageTags >$(PackageTags.ToLower())</PackageTags>
<RepositoryType Condition="'$(RepositoryType)' == ''">git</RepositoryType>
<RepositoryUrl Condition="'$(RepositoryUrl)' == '' And '$(PackageProjectUrl)' != ''">$(PackageProjectUrl).$(RepositoryType)</RepositoryUrl>
</PropertyGroup>
<!-- Disable some warnings -->
<PropertyGroup>
<!-- Suppress following C# warning because we use a subset of the semantic versioning format - major.minor.patch -->
<!-- warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision -->
<NoWarn>$(NoWarn);7035</NoWarn>
<!-- For now, suppress following C# warning due to partial nullability implementation in our code base -->
<!-- warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' context. -->
<NoWarn>$(NoWarn);8632</NoWarn>
<!-- warning CS8981: The type name 'grpc' only contains lower-cased ascii characters. Such names may become reserved for the language. -->
<NoWarn>$(NoWarn);8981</NoWarn>
<!--warning CS0436: The type 'SelfRegisteredExtensions' in ...-->
<!--see https://github.com/microsoft/testfx/issues/3813-->
<NoWarn>$(NoWarn);436</NoWarn>
<!--
=======================================================================
Don't change the suppression list, without talking to [PA] first.
Some of the warnings simply don't make much sense or are too strict
for a real-world code base.
=======================================================================
- S125 = Remove commented out code https://rules.sonarsource.com/csharp/RSPEC-125
- S1075 = URIs should not be hardcoded https://rules.sonarsource.com/csharp/RSPEC-1075
- S1117 = Local variables should not shadow class fields https://rules.sonarsource.com/csharp/RSPEC-1117
- S1125 = Remove unnecessary boolean litteral https://rules.sonarsource.com/csharp/RSPEC-1125
- S3267 = Loops should be simplified with "LINQ" expressions https://rules.sonarsource.com/csharp/RSPEC-3267
- S4457 = Parameter validation in "async"/"await" methods should be wrapped https://rules.sonarsource.com/csharp/RSPEC-4457
- S4663 = Remove empty comments https://rules.sonarsource.com/csharp/RSPEC-4663
- CA1024 = Use properties where appropriate https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1024
- CA1848 = Use the LoggerMessage delegates https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1848
-->
<NoWarn>$(NoWarn);S125;S1075;S1117;S1125;S3267;S4457;S4663;CA1024;CA1848</NoWarn>
<!-- Avoid warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" -->
<!-- and the processor architecture of the reference "...\bin\x64\Release\netstandard2.0\foo.dll", "AMD64" -->
<PlatformTarget Condition="$(TargetFramework.StartsWith('netstandard'))" />
</PropertyGroup>
<!--
Disable NET analysers by default when running outside of VS
-->
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == '' And '$(EnableNETAnalyzers)' == ''">
<EnableNETAnalyzers>false</EnableNETAnalyzers>
</PropertyGroup>
<!-- Exclude git metadata from project -->
<ItemGroup>
<None Remove=".git*" />
</ItemGroup>
<Import Project="Sign.targets" Condition="'$(SignTargetsImported)' == ''" />
<Import Project="Wim.targets" Condition="'$(WimTargetsImported)' == ''" />
<Import Project="Zip.targets" Condition="'$(ZipTargetsImported)' == ''" />
<!--
Make assembly internals visible to test projects (MyProject visible to MyProject.Test[s])
see https://github.com/thomaslevesque/InternalsVisibleTo.MSBuild/blob/master/README.md
Does not support signed assemblies
-->
<ItemGroup Condition="'$(SignAssembly)' != 'true'">
<InternalsVisibleTo Include="$(MSBuildProjectName).Test" />
<InternalsVisibleTo Include="$(MSBuildProjectName).Tests" />
</ItemGroup>
<Target Name="DeleteProjectAssets" BeforeTargets="Clean" Condition="'$(BuildingInsideVisualStudio)' == ''">
<Delete Files="obj\project.assets.json" />
</Target>
<Target Name="TraceDirectoryBuildDefaultTargets"
Condition="'$(ZouTrace)' == 'true' Or '$(ZouDirectoryBuild)' == 'true'">
<Message Importance="high" Text="zou/Directory.Build.Default.targets [$(MSBuildProjectFile)]" />
<Message Importance="high" Text="-----------------------------------" />
<Message Importance="high" Text="MSBuildRuntimeType = $(MSBuildRuntimeType)" />
<Message Importance="high" Text="FullTargetFramework = $(FullTargetFramework)" />
<Message Importance="high" Text="CoreTargetFramework = $(CoreTargetFramework)" />
<Message Importance="high" Text="WindowsTargetFramework = $(WindowsTargetFramework)" />
<Message Importance="high" Text="TargetFrameworkImport = $(TargetFrameworkImport)" />
<Message Importance="high" Text="TargetFrameworkIdentifier = $(TargetFrameworkIdentifier)" />
<Message Importance="high" Text="TargetFrameworkVersion = $(TargetFrameworkVersion)" />
<Message Importance="high" Text=" " />
<Message Importance="high" Text="EnableNETAnalyzers = $(EnableNETAnalyzers)" />
<Message Importance="high" Text="AnalysisMode = $(AnalysisMode)" />
<Message Importance="high" Text="AnalysisLevel = $(AnalysisLevel)" />
</Target>
</Project>