-
Notifications
You must be signed in to change notification settings - Fork 753
Expand file tree
/
Copy pathcommon.project.props
More file actions
236 lines (206 loc) · 13.2 KB
/
common.project.props
File metadata and controls
236 lines (206 loc) · 13.2 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
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0">
<!-- Helper properties -->
<PropertyGroup>
<IsXPlat>false</IsXPlat>
<IsXPlat Condition=" $(MSBuildProjectFullPath.StartsWith('/')) == 'true' OR $(MSBuildProjectFullPath.StartsWith('\')) == 'true' ">true</IsXPlat>
</PropertyGroup>
<!-- Target Frameworks -->
<PropertyGroup>
<NETFXTargetFrameworkVersion>v4.7.2</NETFXTargetFrameworkVersion>
<NETFXTargetFramework>net472</NETFXTargetFramework>
<NetStandardVersion>netstandard2.0</NetStandardVersion>
<NETCoreTargetFramework>net8.0</NETCoreTargetFramework>
<NETCoreTargetFramework Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildFromVMR)' == 'true'">net10.0</NETCoreTargetFramework>
<LatestNETCoreTargetFramework>net9.0</LatestNETCoreTargetFramework>
<LatestNETCoreTargetFramework Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(DotNetBuildFromVMR)' == 'true'">net10.0</LatestNETCoreTargetFramework>
<!-- Target frameworks for class libraries-->
<TargetFrameworksLibrary>$(NETCoreTargetFramework)</TargetFrameworksLibrary>
<TargetFrameworksLibrary Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(LatestNETCoreTargetFramework)</TargetFrameworksLibrary>
<TargetFrameworksLibrary Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(NETFXTargetFramework);$(TargetFrameworksLibrary)</TargetFrameworksLibrary>
<!-- Target framework for runnable apps -->
<TargetFrameworksExe>$(LatestNETCoreTargetFramework)</TargetFrameworksExe>
<TargetFrameworksExe Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(NETFXTargetFramework);$(TargetFrameworksExe)</TargetFrameworksExe>
<!-- Target frameworks for unit tests -->
<TargetFrameworksUnitTest>$(LatestNETCoreTargetFramework)</TargetFrameworksUnitTest>
<TargetFrameworksUnitTest Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(NETFXTargetFramework);$(TargetFrameworksUnitTest)</TargetFrameworksUnitTest>
</PropertyGroup>
<!-- Common -->
<PropertyGroup>
<RepositoryRootDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\</RepositoryRootDirectory>
<BuildCommonDirectory>$(RepositoryRootDirectory)build\</BuildCommonDirectory>
<SolutionFile>$(RepositoryRootDirectory)$(RepositoryName).sln</SolutionFile>
<ArtifactsDirectory>$(RepositoryRootDirectory)artifacts\</ArtifactsDirectory>
<DotnetExePath>$(RepositoryRootDirectory)cli\dotnet.exe</DotnetExePath>
<DotnetExePath Condition=" '$(IsXPlat)' == 'true' ">$(RepositoryRootDirectory)cli\dotnet</DotnetExePath>
<SharedDirectory>$(BuildCommonDirectory)Shared</SharedDirectory>
<NupkgOutputDirectory>$(ArtifactsDirectory)nupkgs\</NupkgOutputDirectory>
<SolutionPackagesFolder>$(RepositoryRootDirectory)packages\</SolutionPackagesFolder>
<EnlistmentRoot>$(RepositoryRootDirectory)</EnlistmentRoot>
<EnlistmentRootSrc>$(RepositoryRootDirectory)src</EnlistmentRootSrc>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(RepositoryRootDirectory)</SolutionDir>
<ArtifactRoot>$(ArtifactsDirectory)</ArtifactRoot>
<ArtifactTempDirectory>$(ArtifactsDirectory)temp</ArtifactTempDirectory>
<NoWarn>$(NoWarn);NU5105;MSB3277;NETSDK1138</NoWarn>
<!-- additional warnings new in .NET 6 that we need to disable when building with source-build -->
<NoWarn Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(NoWarn);CS1998;CA1416;CS0618;CS1574</NoWarn>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<!-- Defaults -->
<PropertyGroup>
<TreatWarningsAsErrors Condition=" '$(TreatWarningsAsErrors)' == '' ">true</TreatWarningsAsErrors>
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
<!-- Treat all warnings as errors, except on official builds since we don't want new warnings to break servicing branches -->
<!-- MSBuild currently has a bug: https://github.com/dotnet/msbuild/issues/10801 -->
<!-- <MSBuildTreatWarningsAsErrors Condition=" '$(MSBuildTreatWarningsAsErrors)' == '' And '$(IsOfficialBuild)' != 'true' ">true</MSBuildTreatWarningsAsErrors> -->
</PropertyGroup>
<!-- Default project configuration -->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
<NuGetTargets>$(MSBuildExtensionsPath)\Microsoft\NuGet\$(VisualStudioVersion)\Microsoft.NuGet.targets</NuGetTargets>
<ComVisible>false</ComVisible>
</PropertyGroup>
<!-- Common project build settings -->
<PropertyGroup>
<PlatformTarget>$(Platform)</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>$(NoWarn);NU5105</NoWarn>
<!-- Code Analysis is OFF by default -->
<RunCodeAnalysis Condition=" '$(RunCodeAnalysis)' == ''">false</RunCodeAnalysis>
<!--This property ensures that if you build the exact sources twice,
you get exactly the same output, so the .pdb from the second build will match the .dll
from the first build!-->
<Deterministic>true</Deterministic>
<Features>strict</Features>
<!-- Same as SDK default, but without CandidateAssemblyFiles in front, which would search in Content items -->
<AssemblySearchPaths>{HintPathFromItem};{TargetFrameworkDirectory};{RawFileName}</AssemblySearchPaths>
<LangVersion>12</LangVersion>
<LangVersion Condition="'$(DotNetBuildSourceOnly)' == 'true'">latest</LangVersion>
</PropertyGroup>
<!-- NuGet's dev branch always targets the next upcoming version of .NET, so we always use the preview SDK -->
<PropertyGroup Condition=" '$(IsEscrow)' != 'true' ">
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
<!-- DEBUG specific configuration settings -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<!-- RELEASE specific configuration settings -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VsixOutputDirName>VS15</VsixOutputDirName>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnableNETAnalyzers Condition="'$(DotNetBuildSourceOnly)' == 'true'">false</EnableNETAnalyzers>
<AnalysisLevel>8.0-None</AnalysisLevel>
<EnforceCodeStyleInBuild Condition="'$(EnforceCodeStyleInBuild)' == ''">true</EnforceCodeStyleInBuild>
<NoWarn>$(NoWarn);EnableGenerateDocumentationFile</NoWarn>
</PropertyGroup>
<PropertyGroup>
<VsixPublishDestination>$(ArtifactRoot)$(VsixOutputDirName)\</VsixPublishDestination>
</PropertyGroup>
<!-- Write out .XML files for projects all projects, required to enforce IDE0005 on build. -->
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<!-- Set the output location for all non-test projects -->
<!-- Test projects currently fail when the output dir is moved -->
<PropertyGroup Condition=" '$(TestProject)' != 'true' OR '$(Shipping)' == 'true'">
<!-- output paths -->
<BaseIntermediateOutputPath>$(ArtifactsDirectory)$(MSBuildProjectName)\obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<BaseOutputPath>$(ArtifactsDirectory)$(MSBuildProjectName)\bin\</BaseOutputPath>
<OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath>
<AppxPackageDir>$(OutputPath)</AppxPackageDir>
</PropertyGroup>
<PropertyGroup>
<FileVersion>$(SemanticVersion).$(PreReleaseVersion)</FileVersion>
<InformationalVersion Condition="'$(BUILD_SOURCEVERSION)' == ''">$(SemanticVersion)$(PreReleaseInformationVersion)</InformationalVersion>
<InformationalVersion Condition="'$(BUILD_SOURCEVERSION)' != ''">$(SemanticVersion)$(PreReleaseInformationVersion)+$(BUILD_SOURCEVERSION)</InformationalVersion>
<Company>Microsoft Corporation</Company>
<Product>NuGet</Product>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<NeutralLanguage>en-US</NeutralLanguage>
<SchemaVersion>2.0</SchemaVersion>
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
<ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
</PropertyGroup>
<!-- Add symbols to the dll for test dlls -->
<PropertyGroup Condition=" '$(TestProject)' == 'true' ">
<DebugType>full</DebugType>
</PropertyGroup>
<!-- The project that builds the VSIX -->
<PropertyGroup>
<VSIXProject>$(RepositoryRootDirectory)src\NuGet.Clients\NuGet.VisualStudio.Client\NuGet.VisualStudio.Client.csproj</VSIXProject>
</PropertyGroup>
<!-- Find all test projects -->
<ItemGroup Condition=" '$(IsXPlat)' != 'true' ">
<CoreUnitTestProjects Include="$(RepositoryRootDirectory)test\NuGet.Core.Tests\*\*.csproj"
Exclude="$(RepositoryRootDirectory)test\NuGet.Core.Tests\NuGet.PackageManagement.Test\*.csproj"/>
<VSUnitTestProjects Include="$(RepositoryRootDirectory)test\NuGet.Clients.Tests\*\*.csproj"
Exclude="$(RepositoryRootDirectory)test\NuGet.Clients.Tests\NuGet.CommandLine.Test\*.csproj" />
<CoreFuncTestProjects Include="$(RepositoryRootDirectory)test\NuGet.Core.FuncTests\*\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Clients.Tests\NuGet.CommandLine.Test\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Core.Tests\NuGet.PackageManagement.Test\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Clients.FuncTests\*\*.csproj"
Exclude="$(RepositoryRootDirectory)test\NuGet.Core.FuncTests\NuGet.Signing.CrossFramework.Test\*.csproj" />
</ItemGroup>
<!-- start with only nuget.versioning for xplat -->
<ItemGroup Condition=" '$(IsXPlat)' == 'true' ">
<CoreUnitTestProjects Include="$(RepositoryRootDirectory)test\NuGet.Core.Tests\*\*.csproj"
Exclude="$(RepositoryRootDirectory)test\NuGet.Core.Tests\*PackageManagement*\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Core.Tests\*ProjectManagement*\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Core.Tests\*VisualStudio*\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Core.Tests\*.Utility\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Core.Tests\NuGet.Credentials.Test\*.csproj;" />
<CoreFuncTestProjects Include="$(RepositoryRootDirectory)test\NuGet.Core.FuncTests\*\*.csproj"
Exclude="$(RepositoryRootDirectory)test\NuGet.Core.FuncTests\NuGet.Signing.CrossFramework.Test\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Core.FuncTests\Msbuild.Integration.Test\*.csproj" />
</ItemGroup>
<!-- All projects in the repository -->
<ItemGroup Condition=" '$(IsXPlat)' != 'true' ">
<SolutionProjects Include="$(RepositoryRootDirectory)test\*\*\*.csproj"
Exclude="$(RepositoryRootDirectory)test\EndToEnd\*\*.csproj;
$(RepositoryRootDirectory)test\NuGet.Tests.Apex\*\*.csproj"
Condition=" '$(ExcludeTestProjects)' != 'true' " />
<SolutionProjects Include="$(RepositoryRootDirectory)test\NuGet.Tests.Apex\*\*.csproj" Condition="'$(IncludeApex)' == 'true'" />
<SolutionProjects Include="$(RepositoryRootDirectory)src\*\*\*.csproj" />
<SolutionProjectsWithoutVSIX Include="@(SolutionProjects)"
Exclude="$(VSIXProject)" />
</ItemGroup>
<!-- All projects in the repository that support cross platform builds -->
<ItemGroup Condition=" '$(IsXPlat)' == 'true' ">
<SolutionProjects Include="@(CoreUnitTestProjects)" />
<SolutionProjects Include="@(CoreFuncTestProjects)" />
</ItemGroup>
<ItemGroup>
<ProductProjects Include="$(RepositoryRootDirectory)src\*\*\*.csproj" />
</ItemGroup>
<!-- All projects that build assemblies that are inserted into the .NET SDK -->
<ItemGroup>
<CoreProjects Include="$(RepositoryRootDirectory)src\NuGet.Core\*\*.csproj"
Exclude="$(RepositoryRootDirectory)src\NuGet.Core\NuGet.PackageManagement\NuGet.PackageManagement.csproj;
$(RepositoryRootDirectory)src\NuGet.Core\NuGet.Localization\NuGet.Localization.csproj;
$(RepositoryRootDirectory)src\NuGet.Core\NuGet.Resolver\NuGet.Resolver.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(IsXPlat)' != 'true' ">
<ApexProjects Include="$(RepositoryRootDirectory)test\NuGet.Tests.Apex\*\*.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(IsXPlat)' != 'true' ">
<AllRepoProjects Include="@(SolutionProjects)" />
<AllRepoProjects Include="@(ApexProjects)" />
</ItemGroup>
<Import Project="OptProfV2.props"/>
</Project>