-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Directory.Build.Common.props
255 lines (226 loc) · 15.8 KB
/
Directory.Build.Common.props
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Setup project type properties -->
<PropertyGroup>
<IsMgmtLibrary Condition="'$(IsMgmtLibrary)' == '' and $(MSBuildProjectName.StartsWith('Azure.ResourceManager'))">true</IsMgmtLibrary>
<IsMgmtSubLibrary Condition="'$(IsMgmtSubLibrary)' == '' and $(MSBuildProjectName.StartsWith('Azure.ResourceManager.'))">true</IsMgmtSubLibrary>
<MgmtAutorestVersion>3.0.0-beta.20210504.1</MgmtAutorestVersion>
<!-- Enable documentation for all projects unless explicitly disabled. -->
<DocumentationFile>$(IntermediateOutputPath)$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>
<!-- Client in this context is any library that is following the new Azure SDK guidelines -->
<IsClientLibrary Condition="'$(IsClientLibrary)' == '' and $(MSBuildProjectName.StartsWith('Azure.'))">true</IsClientLibrary>
<IsTestProject Condition="'$(IsTestProject)' == '' and $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
<IsSamplesProject Condition="'$(IsSamplesProject)' == '' and $(MSBuildProjectName.EndsWith('.Samples'))">true</IsSamplesProject>
<IsPerfProject Condition="'$(IsPerfProject)' == '' and $(MSBuildProjectName.EndsWith('.Perf'))">true</IsPerfProject>
<IsStressProject Condition="'$(IsStressProject)' == '' and $(MSBuildProjectName.EndsWith('.Stress'))">true</IsStressProject>
<IsTestSupportProject Condition="'$(IsTestSupportProject)' == '' and '$(IsTestProject)' != 'true' and ($(MSBuildProjectDirectory.Contains('/tests/')) or $(MSBuildProjectDirectory.Contains('\tests\')))">true</IsTestSupportProject>
<IsShippingLibrary Condition="'$(IsShippingLibrary)' == '' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '$(IsPerfProject)' != 'true' and '$(IsSamplesProject)' != 'true' and '$(IsStressProject)' != 'true'">true</IsShippingLibrary>
<IsShippingClientLibrary Condition="'$(IsClientLibrary)' == 'true' and '$(IsShippingLibrary)' == 'true'">true</IsShippingClientLibrary>
<TestFrameworkSupportFiles>$(MSBuildThisFileDirectory)/../sdk/core/Azure.Core.TestFramework/src/Shared/*.cs</TestFrameworkSupportFiles>
<IncludeOperationsSharedSource Condition="'$(IncludeOperationsSharedSource)' == '' and '$(IsMgmtLibrary)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsPerfProject)' != 'true'">true</IncludeOperationsSharedSource>
</PropertyGroup>
<!-- Setup default project properties -->
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<!--
Disable NU5105 NuGet Pack warning that the version is SemVer 2.0.
SemVer 2.0 is supported by NuGet since 3.0.0 (July 2015) in some capacity, and fully since 3.5.0 (October 2016).
-->
<NoWarn>$(NoWarn);NU5105</NoWarn>
<!--
https://github.com/dotnet/roslyn-analyzers/issues/5628
-->
<NoWarn>$(NoWarn);CA1812</NoWarn>
<!--
Disable some NetAnalyzers rules
-->
<NoWarn>
$(NoWarn);
CA1716; <!-- avoid using method names that are reserved in other languages -->
CA1308; <!-- prefer ToUpperInvariant -->
CA1819; <!-- Properties should not return arrays -->
CA1710; <!-- Use Collection sufix -->
CA1028; <!-- Enum backing type should be int -->
CA1032; <!-- Add default exception ctors -->
CA1063; <!-- Dispose implementation -->
CA1066; <!-- Implement IEquatable -->
CA1815; <!-- Equality members on structs -->
CA2007; <!-- Do not directly await a Task without calling ConfigureAwait (replaced by AZC0012) -->
CA2231; <!-- Override Equality operators -->
CA2225; <!-- Provide alternative to implicit operators -->
CA1714; <!-- Flags should have plural names -->
CA1062; <!-- Public parameter should be checked for null -->
CA1031; <!-- Don't catch generic exceptions -->
CA2000; <!-- Call dispose on IDisposable objects -->
CA2012; <!-- ValueTask should only be awaited once - conflicts with EnsureCompleted check -->
</NoWarn>
<!--
Disable some MSBuild warnings
-->
<NoWarn>
$(NoWarn);
MSB3245; <!-- Do not warn if a package reference is unavailable -->
</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>symbols.nupkg</SymbolPackageFormat>
<!-- Avoid implicitly added preview feeds -->
<AddDotnetfeedProjectSource>false</AddDotnetfeedProjectSource>
</PropertyGroup>
<PropertyGroup>
<EnableClientSdkAnalyzers Condition="'$(IsShippingClientLibrary)' == 'true'">true</EnableClientSdkAnalyzers>
<EnableMicrosoftCodeAnalysisNetAnalyzers Condition="'$(IsShippingClientLibrary)' == 'true'">true</EnableMicrosoftCodeAnalysisNetAnalyzers>
<EnableStyleCopAnalyzers Condition="'$(EnableStyleCopAnalyzers)' == '' and '$(IsClientLibrary)' == 'true'">true</EnableStyleCopAnalyzers>
<EnableBannedApiAnalyzers Condition="'$(IsShippingClientLibrary)' == 'true'">true</EnableBannedApiAnalyzers>
<GenerateAPIListing Condition="'$(IsShippingClientLibrary)' == 'true'">true</GenerateAPIListing>
<UpdateSourceOnBuild Condition="'$(UpdateSourceOnBuild)' == ''">$(AZURE_DEV_UPDATESOURCESONBUILD)</UpdateSourceOnBuild>
<PowerShellExe Condition="'$(PowerShellExe)' == ''">pwsh</PowerShellExe>
<InheritDocEnabled Condition="'$(InheritDocEnabled)'=='' and '$(DesignTimeBuild)'!='true' and '$(BuildingForLiveUnitTesting)'!='true' and '$(IsShippingClientLibrary)' == true">true</InheritDocEnabled>
<InheritDocTrimLevel>private</InheritDocTrimLevel>
<GenerateAPIListing Condition="'$(GenerateAPIListing)' == '' AND '$(IsShippingClientLibrary)' == 'true'">true</GenerateAPIListing>
<EnableSourceLink Condition="'$(EnableSourceLink)' == ''">true</EnableSourceLink>
<DefineConstants Condition="'$(BuildSnippets)' == 'true'">$(DefineConstants);SNIPPET</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(IsShippingClientLibrary)' == 'true' and '$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<!-- TODO. REVIEW -->
<PropertyGroup Condition="'$(IsMgmtLibrary)' == 'true'">
<NoWarn>
$(NoWarn);
CA1812; <!-- Avoid uninstantiated internal classes. (Result from below including the Azure.Core source) -->
AZC0012; <!-- Single word class names -->
AZC0008;
</NoWarn>
</PropertyGroup>
<!-- CodeAnalysis RuleSet -->
<PropertyGroup Condition="'$(IsClientLibrary)' == 'true'">
<CodeAnalysisRuleSet>$(RepoEngPath)\CodeAnalysis.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<!-- TargetFramework default properties -->
<!-- Update pipelines/templates/steps/install-dotnet.yml as needed, without re-installing SDKs already found on all supported agents -->
<PropertyGroup>
<!-- Client libraries are moving forward to NS 2.0 and Net 4.6.1 as the min supported versions -->
<SupportsNetStandard20 Condition="'$(SupportsNetStandard20)' == '' and '$(IsClientLibrary)' == 'true'">true</SupportsNetStandard20>
<SupportsNetStandard20 Condition="'$(SupportsNetStandard20)' == ''">false</SupportsNetStandard20>
<RequiredTargetFrameworks>net452;netstandard1.4;net461;netstandard2.0</RequiredTargetFrameworks>
<RequiredTargetFrameworks Condition="'$(SupportsNetStandard20)' == 'true'">netstandard2.0</RequiredTargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsSamplesProject)' == 'true' or '$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
<IsPackable>false</IsPackable>
<!-- List newest targets first so that recordings are made with latest, running tests from editor runs latest, etc. -->
<RequiredTargetFrameworks>net7.0;net6.0</RequiredTargetFrameworks>
<!-- Also test net462 on Windows. net461 is out of support as of 4/2022 and is not supported in version 4.4.x and beyond of NUnit3TestAdapter. -->
<RequiredTargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(RequiredTargetFrameworks);net462</RequiredTargetFrameworks>
<!-- But only build snippets for the latest. -->
<RequiredTargetFrameworks Condition="'$(BuildSnippets)' == 'true'">net7.0</RequiredTargetFrameworks>
</PropertyGroup>
<ItemGroup Condition="'$(IsMgmtSubLibrary)' == 'true' and !$(MSBuildProjectName.Equals('Azure.ResourceManager.Tests'))">
<PackageReference Include="Azure.ResourceManager" />
</ItemGroup>
<PropertyGroup>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<IsTargetingNetFx Condition="$(TargetFramework.StartsWith('net4'))">true</IsTargetingNetFx>
<IsTargetingNetStandard Condition="$(TargetFramework.StartsWith('netstandard'))">true</IsTargetingNetStandard>
<IsTargetingNetCoreApp Condition="$(TargetFramework.StartsWith('netcoreapp'))">true</IsTargetingNetCoreApp>
<DefineConstants Condition="'$(IsTargetingNetFx)' == 'true'">$(DefineConstants);FullNetFx</DefineConstants>
</PropertyGroup>
<!-- Common library and package properties -->
<PropertyGroup>
<Company>Microsoft Corporation</Company>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<Authors>Microsoft</Authors>
<Product>Azure .NET SDK</Product>
<PackageIcon>pkgicon.png</PackageIcon>
<PackageIconPath>$(RepoEngPath)/images/$(PackageIcon)</PackageIconPath>
<RepositoryUrl>https://github.com/Azure/azure-sdk-for-net</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<NeutralLanguage>en-US</NeutralLanguage>
</PropertyGroup>
<!-- Signing properties -->
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<!--
In order to be able to run our tests on .NET Framework we should use public signing by default so
we don't have to disable strong name validation for things that are delay signed.
-->
<PublicSign Condition="'$(PublicSign)' == ''">true</PublicSign>
<DelaySign Condition="'$(PublicSign)' == 'true'">false</DelaySign>
<DelaySign Condition="'$(PublicSign)' != 'true'">true</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<!-- Disable documentation for projects that need fixes before this can be enabled. -->
<PropertyGroup Condition="
$(MSBuildProjectName.Equals('Microsoft.Azure.ApplicationInsights.Query')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.AnomalyDetector')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Language.LUIS.Authoring')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Language.SpellCheck')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Language.TextAnalytics')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Personalizer')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingAutoSuggest')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingCustomImageSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingCustomSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingEntitySearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingImageSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingLocalSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingNewsSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingVideoSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingVisualSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Search.BingWebSearch')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Vision.ComputerVision')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Vision.ContentModerator')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Vision.CustomVision.Prediction')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Vision.Face')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.CognitiveServices.Vision.FormRecognizer')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.ContainerRegistry')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.EventGrid')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.HDInsight.Job')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.Graph.RBAC')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.KeyVault')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.KeyVault.Core')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.KeyVault.Cryptography')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.KeyVault.Extensions')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.KeyVault.WebKey')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.OperationalInsights')) or
$(MSBuildProjectName.Equals('Microsoft.Azure.Synapse'))">
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(IsClientLibrary)' == 'true'">
<PackageIcon>azureicon.png</PackageIcon>
<PackageIconPath>$(RepoEngPath)/images/$(PackageIcon)</PackageIconPath>
<!-- Use a full key for the new client libraries and disable delay signing -->
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)AzureSDKClient.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<PublicSign>false</PublicSign>
<ImportDefaultReferences>false</ImportDefaultReferences>
<!-- The set of tags that should be added to the packages -->
<PackageCommonTags>windowsazureofficial;azureofficial</PackageCommonTags>
<AzureCoreSharedSources>$(MSBuildThisFileDirectory)/../sdk/core/Azure.Core/src/Shared/</AzureCoreSharedSources>
<AzureCoreTestFramework>$(MSBuildThisFileDirectory)/../sdk/core/Azure.Core.TestFramework/src/Azure.Core.TestFramework.csproj</AzureCoreTestFramework>
<AzureCoreAmqpSharedSources>$(MSBuildThisFileDirectory)/../sdk/core/Azure.Core.Amqp/src/Shared/</AzureCoreAmqpSharedSources>
</PropertyGroup>
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsSamplesProject)' == 'true' or '$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
<!-- Always fully sign test assemblies since we have a full public/private key -->
<PublicSign>false</PublicSign>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)AzSdkTestLibKey.snk</AssemblyOriginatorKeyFile>
<!-- Disable doc comments for test projects -->
<DocumentationFile></DocumentationFile>
<RunSettingsFilePath Condition="'$(AZURE_SKIP_DEFAULT_RUN_SETTINGS)' != 'true'">$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath>
</PropertyGroup>
<PropertyGroup Condition="'$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>
<!-- Code generation settings -->
<PropertyGroup>
<!-- Don't use code generator bundled Azure.Core shared source for code generation -->
<AzureCoreSharedCodeDirectory>$(AzureCoreSharedSources)</AzureCoreSharedCodeDirectory>
<!-- Don't use code generator bundled Azure.Core shared source when building, projects in this repo include individual sources when needed -->
<IncludeAzureCoreSharedCode>false</IncludeAzureCoreSharedCode>
</PropertyGroup>
</Project>