|
35 | 35 | </PropertyGroup> |
36 | 36 |
|
37 | 37 | <PropertyGroup Label="Solution-level Publish to Project-specific Directory"> |
38 | | - <PublishDir Condition="'$(AlternatePublishRootDirectory)' != ''"> |
39 | | - $(AlternatePublishRootDirectory)/$(TargetFramework)/$(MSBuildProjectName)/</PublishDir> |
| 38 | + <PublishDir Condition="'$(AlternatePublishRootDirectory)' != ''">$(AlternatePublishRootDirectory)/$(TargetFramework)/$(MSBuildProjectName)/</PublishDir> |
40 | 39 | </PropertyGroup> |
41 | 40 |
|
42 | 41 | <!-- Features in .NET 9.x+ only --> |
|
51 | 50 |
|
52 | 51 | <DefineConstants>$(DefineConstants);FEATURE_ASPNETCORE_TESTHOST</DefineConstants> |
53 | 52 | <DefineConstants>$(DefineConstants);FEATURE_CANCELLATIONTOKENSOURCE_CANCELASYNC</DefineConstants> |
| 53 | + <DefineConstants>$(DefineConstants);FEATURE_HTTPCONTENT_READASSTREAM</DefineConstants> |
| 54 | + <DefineConstants>$(DefineConstants);FEATURE_HTTPCONTENT_READASSTREAM_CANCELLATIONTOKEN</DefineConstants> |
54 | 55 |
|
55 | 56 | </PropertyGroup> |
56 | 57 |
|
|
90 | 91 | <DebugType>portable</DebugType> |
91 | 92 | </PropertyGroup> |
92 | 93 |
|
93 | | - <!-- Features in .NET 8.x+ only --> |
94 | | - <PropertyGroup |
95 | | - Condition=" $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net9.')) Or $(TargetFramework.StartsWith('net10.')) "> |
96 | | - <DefineConstants>$(DefineConstants);FEATURE_HTTPCONTENT_READASSTREAM</DefineConstants> |
97 | | - <DefineConstants>$(DefineConstants);FEATURE_HTTPCONTENT_READASSTREAM_CANCELLATIONTOKEN</DefineConstants> |
98 | | - </PropertyGroup> |
99 | | - |
100 | 94 | <!-- Features in .NET Standard 2.1, .NET Core 3.x, and .NET 5.x+ only --> |
101 | 95 | <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' Or $(TargetFramework.StartsWith('netcoreapp3.')) Or $(TargetFramework.StartsWith('net5.')) Or $(TargetFramework.StartsWith('net6.')) Or $(TargetFramework.StartsWith('net7.')) Or $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net9.')) Or $(TargetFramework.StartsWith('net10.')) "> |
102 | 96 |
|
|
142 | 136 | </PropertyGroup> |
143 | 137 |
|
144 | 138 | <!-- Features in .NET Framework 4.5+ and .NET Standard 2.x only (No .NET Core support) --> |
145 | | - <PropertyGroup |
146 | | - Condition=" $(TargetFramework.StartsWith('net4')) Or $(TargetFramework.StartsWith('netstandard2.')) "> |
| 139 | + <PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or $(TargetFramework.StartsWith('netstandard2.')) "> |
147 | 140 |
|
148 | 141 | <!-- NOTE: The API for this exists in .NET Core, but it throws a PlatformNotSupportedException. |
149 | 142 | We simply don't override this to get the same behavior. --> |
|
152 | 145 | </PropertyGroup> |
153 | 146 |
|
154 | 147 | <!-- Features in .NET Framework 4.6.1+ only --> |
155 | | - <PropertyGroup |
156 | | - Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or $(TargetFramework.StartsWith('net47')) Or $(TargetFramework.StartsWith('net48'))"> |
| 148 | + <PropertyGroup Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net462' Or $(TargetFramework.StartsWith('net47')) Or $(TargetFramework.StartsWith('net48'))"> |
157 | 149 |
|
158 | 150 | <DefineConstants>$(DefineConstants);FEATURE_ICONFIGURATIONROOT_PROVIDERS</DefineConstants> |
159 | 151 |
|
|
163 | 155 | <PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))"> |
164 | 156 |
|
165 | 157 | <DefineConstants>$(DefineConstants);NETFRAMEWORK</DefineConstants> |
166 | | - <!-- Although code access security is available in .NET Standard 2.0+ via platform extensions, |
167 | | - we are excluding |
| 158 | + <!-- Although code access security is available in .NET Standard 2.0+ via platform extensions, we are excluding |
168 | 159 | it due to the fact it is not a primary feature of Lucene.NET and it is supported in .NET Framework --> |
169 | 160 | <DefineConstants>$(DefineConstants);FEATURE_CODE_ACCESS_SECURITY</DefineConstants> |
170 | 161 | <DefineConstants>$(DefineConstants);FEATURE_MEMORYMAPPEDFILESECURITY</DefineConstants> |
|
185 | 176 |
|
186 | 177 | <PropertyGroup> |
187 | 178 | <!-- NuGet.org only supports portable debug symbol format: |
188 | | - https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg#nugetorg-symbol-package-constraints --> |
| 179 | + https://docs.microsoft.com/en-us/nuget/create-packages/symbol-packages-snupkg#nugetorg-symbol-package-constraints --> |
189 | 180 | <DebugType Condition=" '$(PortableDebugTypeOnly)' == 'true' ">portable</DebugType> |
190 | 181 | </PropertyGroup> |
191 | 182 |
|
192 | | - <Target Name="AddInternalsVisibleTo" BeforeTargets="BeforeCompile" |
193 | | - Label="Adds InternalsVisibleTo Attribute and PublicKey (if supplied)"> |
| 183 | + <Target Name="AddInternalsVisibleTo" BeforeTargets="BeforeCompile" Label="Adds InternalsVisibleTo Attribute and PublicKey (if supplied)"> |
194 | 184 | <ItemGroup Condition="'@(InternalsVisibleTo->Count())' > 0 "> |
195 | 185 | <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> |
196 | 186 | <_Parameter1>%(InternalsVisibleTo.Identity)</_Parameter1> |
197 | | - <_Parameter1 Condition=" '$(SignAssembly)' == 'true' And '$(PublicKey)' != '' ">%(InternalsVisibleTo.Identity), |
198 | | - PublicKey=$(PublicKey)</_Parameter1> |
| 187 | + <_Parameter1 Condition=" '$(SignAssembly)' == 'true' And '$(PublicKey)' != '' ">%(InternalsVisibleTo.Identity), PublicKey=$(PublicKey)</_Parameter1> |
199 | 188 | </AssemblyAttribute> |
200 | 189 | </ItemGroup> |
201 | 190 | </Target> |
202 | 191 |
|
203 | | - <Target Name="PrintTargetFrameworks" |
204 | | - Label="Prints the value for the $(TargetFrameworks) property or 'none' if no frameworks apply. Pass TestProjectsOnly=true to get results only if this is a test project."> |
| 192 | + <Target Name="PrintTargetFrameworks" Label="Prints the value for the $(TargetFrameworks) property or 'none' if no frameworks apply. Pass TestProjectsOnly=true to get results only if this is a test project."> |
205 | 193 | <PropertyGroup> |
206 | | - <DoOutputTargetFrameworks |
207 | | - Condition=" '$(TestProjectsOnly)' != 'true' Or ('$(TestProjectsOnly)' == 'true' And '$(IsTestProject)' == 'true')"> |
208 | | - true</DoOutputTargetFrameworks> |
209 | | - <OutputTargetFrameworks Condition=" '$(DoOutputTargetFrameworks)' == 'true' "> |
210 | | - $(TargetFramework)</OutputTargetFrameworks> |
| 194 | + <DoOutputTargetFrameworks Condition=" '$(TestProjectsOnly)' != 'true' Or ('$(TestProjectsOnly)' == 'true' And '$(IsTestProject)' == 'true')">true</DoOutputTargetFrameworks> |
| 195 | + <OutputTargetFrameworks Condition=" '$(DoOutputTargetFrameworks)' == 'true' ">$(TargetFramework)</OutputTargetFrameworks> |
211 | 196 | <!-- Fallback to TargetFrameworks field if TargetFramework is empty --> |
212 | | - <OutputTargetFrameworks |
213 | | - Condition=" '$(DoOutputTargetFrameworks)' == 'true' And '$(OutputTargetFrameworks)' == '' "> |
214 | | - $(TargetFrameworks)</OutputTargetFrameworks> |
| 197 | + <OutputTargetFrameworks Condition=" '$(DoOutputTargetFrameworks)' == 'true' And '$(OutputTargetFrameworks)' == '' ">$(TargetFrameworks)</OutputTargetFrameworks> |
215 | 198 | <OutputTargetFrameworks Condition=" '$(OutputTargetFrameworks)' == '' ">none</OutputTargetFrameworks> |
216 | 199 | </PropertyGroup> |
217 | 200 | <Message Text="SupportedTargetFrameworks=$(OutputTargetFrameworks)" Importance="high"/> |
218 | 201 | </Target> |
219 | 202 |
|
220 | 203 |
|
221 | | - <!-- Disable Json Source Generator from being added to projects. This is being done to work around |
222 | | - a bug in VS 2022 |
223 | | - which appeared around VS2022 7.3.6 which causes StackOverflowExceptions when compiling the |
224 | | - solution. |
225 | | - see: |
226 | | - https://developercommunity.visualstudio.com/t/VS-2022-1736-Process-is-terminated-due/10173885#T-ND10184855 |
| 204 | + <!-- Disable Json Source Generator from being added to projects. This is being done to work around a bug in VS 2022 |
| 205 | + which appeared around VS2022 7.3.6 which causes StackOverflowExceptions when compiling the solution. |
| 206 | + see: https://developercommunity.visualstudio.com/t/VS-2022-1736-Process-is-terminated-due/10173885#T-ND10184855 |
227 | 207 | for more details. Once a fix is rolled out for VS2022, this block can be removed --> |
228 | 208 | <Target Name="RemoveJsonSourceGenerator" BeforeTargets="CoreCompile"> |
229 | 209 | <ItemGroup> |
|
234 | 214 | </ItemGroup> |
235 | 215 |
|
236 | 216 | <ItemGroup> |
237 | | - <AnalyzersToRemove Include="@(AnalyzersByFileName)" |
238 | | - Condition="'@(AnalyzersToRemoveByFileName)' == '@(AnalyzersByFileName)' and '%(Identity)' != ''" /> |
| 217 | + <AnalyzersToRemove Include="@(AnalyzersByFileName)" Condition="'@(AnalyzersToRemoveByFileName)' == '@(AnalyzersByFileName)' and '%(Identity)' != ''" /> |
239 | 218 | <Analyzer Remove="%(AnalyzersToRemove.OriginalIdentity)" /> |
240 | 219 | </ItemGroup> |
241 | 220 | </Target> |
242 | 221 |
|
243 | 222 |
|
244 | 223 | <!-- Global PackageReferences --> |
245 | 224 | <ItemGroup> |
246 | | - <!-- This is to allow the .NET Framework references to be machine-indepenedent so builds can |
247 | | - happen without installing prerequisites --> |
248 | | - <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" |
249 | | - Version="$(MicrosoftNETFrameworkReferenceAssembliesPackageReferenceVersion)" |
250 | | - PrivateAssets="All" /> |
| 225 | + <!-- This is to allow the .NET Framework references to be machine-indepenedent so builds can happen without installing prerequisites --> |
| 226 | + <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="$(MicrosoftNETFrameworkReferenceAssembliesPackageReferenceVersion)" PrivateAssets="All" /> |
251 | 227 | </ItemGroup> |
252 | 228 |
|
253 | 229 | <!-- This is for testing only, we use SourceLink from any Azure DevOps git repo --> |
254 | | - <ItemGroup Condition=" '$(BUILD_REPOSITORY_PROVIDER)' == 'TfsGit' " |
255 | | - Label="SourceLink Packages (experimental Azure Repos)"> |
256 | | - <PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" |
257 | | - Version="$(MicrosoftSourceLinkAzureReposGitPackageReferenceVersion)" PrivateAssets="All" /> |
| 230 | + <ItemGroup Condition=" '$(BUILD_REPOSITORY_PROVIDER)' == 'TfsGit' " Label="SourceLink Packages (experimental Azure Repos)"> |
| 231 | + <PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkAzureReposGitPackageReferenceVersion)" PrivateAssets="All"/> |
258 | 232 | </ItemGroup> |
259 | 233 |
|
260 | | - <ItemGroup Condition=" '$(BUILD_REPOSITORY_PROVIDER)' == 'GitHub' " |
261 | | - Label="SourceLink Packages (main repo)"> |
262 | | - <PackageReference Include="Microsoft.SourceLink.GitHub" |
263 | | - Version="$(MicrosoftSourceLinkGitHubPackageReferenceVersion)" PrivateAssets="All" /> |
| 234 | + <ItemGroup Condition=" '$(BUILD_REPOSITORY_PROVIDER)' == 'GitHub' " Label="SourceLink Packages (main repo)"> |
| 235 | + <PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageReferenceVersion)" PrivateAssets="All"/> |
264 | 236 | </ItemGroup> |
265 | 237 |
|
266 | 238 | <ItemGroup> |
|
0 commit comments