Skip to content

Commit 807149c

Browse files
committed
PR feedback
1 parent 9bb1c29 commit 807149c

49 files changed

Lines changed: 202 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.build/azure-templates/run-tests-on-os.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,31 @@ steps:
132132
displayName: 'Use .NET SDK 8.0.404 (x86)'
133133
condition: and(succeeded(), contains('${{ parameters.framework }}', 'net8.'), eq('${{ parameters.vsTestPlatform }}', 'x86'))
134134

135+
- task: UseDotNet@2
136+
displayName: 'Use .NET SDK 9.0.308'
137+
inputs:
138+
packageType: 'sdk'
139+
version: '9.0.308'
140+
performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}'
141+
condition: and(succeeded(), contains('${{ parameters.framework }}', 'net9.'))
142+
143+
# Hack: .NET 8+ no longer installs the x86 bits and they must be installed separately. However, it is not
144+
# trivial to get it into the path and to get it to pass the minimum SDK version check in runbuild.ps1.
145+
# So, we install it afterward and set the environment variable so the above SDK can delegate to it.
146+
# This code only works on Windows.
147+
- pwsh: |
148+
$sdkVersion = '9.0.308'
149+
$architecture = '${{ parameters.vsTestPlatform }}'
150+
$installScriptPath = "${env:AGENT_TEMPDIRECTORY}/dotnet-install.ps1"
151+
$installScriptUrl = "https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1"
152+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
153+
Invoke-WebRequest $installScriptUrl -OutFile $installScriptPath -TimeoutSec 60
154+
$installPath = "${env:ProgramFiles(x86)}/dotnet"
155+
& $installScriptPath -Version $sdkVersion -Architecture $architecture -InstallDir $installPath
156+
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT_X86;]$installPath"
157+
displayName: 'Use .NET SDK 9.0.308 (x86)'
158+
condition: and(succeeded(), contains('${{ parameters.framework }}', 'net9.'), eq('${{ parameters.vsTestPlatform }}', 'x86'))
159+
135160

136161
#- template: 'show-all-files.yml' # Uncomment for debugging
137162
- pwsh: |

Directory.Build.props

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,24 @@
2626
</PropertyGroup>
2727

2828
<PropertyGroup>
29-
<LangVersion>14.0</LangVersion>
29+
<LangVersion>11.0</LangVersion>
3030
<GitHubOrganization>apache</GitHubOrganization>
3131
<GitHubProject>lucenenet</GitHubProject>
3232
</PropertyGroup>
3333

34+
<PropertyGroup Label="Centralized Target Frameworks">
35+
<!-- Base frameworks without net10.0 -->
36+
<LibraryTargetFrameworksBase>net8.0;netstandard2.0;net462</LibraryTargetFrameworksBase>
37+
<NetCoreOnlyTargetFrameworksBase>net8.0</NetCoreOnlyTargetFrameworksBase>
38+
39+
<!-- Add net10.0 conditionally based on VS version (VS2024+ = 18.0) -->
40+
<LibraryTargetFrameworks Condition=" '$(VisualStudioVersion)' &gt;= '18.0' ">net10.0;$(LibraryTargetFrameworksBase)</LibraryTargetFrameworks>
41+
<LibraryTargetFrameworks Condition=" '$(VisualStudioVersion)' &lt; '18.0' Or '$(VisualStudioVersion)' == '' ">$(LibraryTargetFrameworksBase)</LibraryTargetFrameworks>
42+
43+
<NetCoreOnlyTargetFrameworks Condition=" '$(VisualStudioVersion)' &gt;= '18.0' ">net10.0;$(NetCoreOnlyTargetFrameworksBase)</NetCoreOnlyTargetFrameworks>
44+
<NetCoreOnlyTargetFrameworks Condition=" '$(VisualStudioVersion)' &lt; '18.0' Or '$(VisualStudioVersion)' == '' ">$(NetCoreOnlyTargetFrameworksBase)</NetCoreOnlyTargetFrameworks>
45+
</PropertyGroup>
46+
3447
<!-- IMPORTANT: When these values are changed, the CI counter number should also be reset. -->
3548
<PropertyGroup Label="Version of Builds">
3649
<!-- IMPORTANT: VersionPrefix must always be the same as the Lucene version this is based on.

TestTargetFramework.props

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
<!--<TargetFramework>net472</TargetFramework>-->
3030
<!--<TargetFramework>net48</TargetFramework>-->
3131
<!--<TargetFramework>net8.0</TargetFramework>-->
32-
<TargetFramework>net10.0</TargetFramework>
32+
<!-- Default for local development - conditional based on VS version (VS2024+ = 18.0) -->
33+
<TargetFramework Condition=" '$(VisualStudioVersion)' &gt;= '18.0' ">net10.0</TargetFramework>
34+
<TargetFramework Condition=" '$(VisualStudioVersion)' &lt; '18.0' Or '$(VisualStudioVersion)' == '' ">net8.0</TargetFramework>
3335

3436
<!-- Allow the build script to pass in the test frameworks to build for.
3537
This overrides the above TargetFramework setting.
@@ -43,7 +45,9 @@
4345
net472 | netstandard2.0
4446
-->
4547

46-
<TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' ">net10.0;net8.0</TargetFrameworks>
48+
<!-- CI builds - conditional based on VS version -->
49+
<TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' And '$(VisualStudioVersion)' &gt;= '18.0' ">net10.0;net8.0</TargetFrameworks>
50+
<TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' And ('$(VisualStudioVersion)' &lt; '18.0' Or '$(VisualStudioVersion)' == '') ">net8.0</TargetFrameworks>
4751
<TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' AND $([MSBuild]::IsOsPlatform('Windows')) ">$(TargetFrameworks);net48;net472</TargetFrameworks>
4852
<TargetFramework Condition=" '$(TargetFrameworks)' != '' "></TargetFramework>
4953
</PropertyGroup>

src/Lucene.Net.Analysis.Common/Lucene.Net.Analysis.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Import Project="$(SolutionDir).build/nuget.props" />
3131

3232
<PropertyGroup>
33-
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>
33+
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
3434

3535
<AssemblyTitle>Lucene.Net.Analysis.Common</AssemblyTitle>
3636
<PackageTags>$(PackageTags);analysis</PackageTags>

src/Lucene.Net.Analysis.Kuromoji/Lucene.Net.Analysis.Kuromoji.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Import Project="$(SolutionDir).build/nuget.props" />
3131

3232
<PropertyGroup>
33-
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>
33+
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
3434

3535
<AssemblyTitle>Lucene.Net.Analysis.Kuromoji</AssemblyTitle>
3636
<PackageTags>$(PackageTags);analysis;japanese</PackageTags>

src/Lucene.Net.Analysis.Morfologik/Lucene.Net.Analysis.Morfologik.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Import Project="$(SolutionDir).build/nuget.props" />
3131

3232
<PropertyGroup>
33-
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>
33+
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
3434

3535
<AssemblyTitle>Lucene.Net.Analysis.Morfologik</AssemblyTitle>
3636
<RootNamespace>Lucene.Net.Analysis</RootNamespace>

src/Lucene.Net.Analysis.OpenNLP/Lucene.Net.Analysis.OpenNLP.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
<PropertyGroup>
3333
<!-- Currently, IKVM doesn't officially support building NetFX on anything but Windows, so we skip it for contributors who may be on various platforms.
3434
We can remove the condition once that has been addressed. See: https://github.com/ikvmnet/ikvm-maven/issues/49 -->
35-
<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
35+
<!-- net10.0 is conditional on VS version (VS2024+ = 18.0) -->
36+
<TargetFrameworks Condition=" '$(VisualStudioVersion)' &gt;= '18.0' ">net10.0;net8.0</TargetFrameworks>
37+
<TargetFrameworks Condition=" '$(VisualStudioVersion)' &lt; '18.0' Or '$(VisualStudioVersion)' == '' ">net8.0</TargetFrameworks>
3638
<TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('Windows'))">$(TargetFrameworks);net472</TargetFrameworks>
3739

3840
<AssemblyTitle>Lucene.Net.Analysis.OpenNLP</AssemblyTitle>

src/Lucene.Net.Analysis.Phonetic/Lucene.Net.Analysis.Phonetic.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Import Project="$(SolutionDir).build/nuget.props" />
3131

3232
<PropertyGroup>
33-
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>
33+
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
3434

3535
<AssemblyTitle>Lucene.Net.Analysis.Phonetic</AssemblyTitle>
3636
<PackageTags>$(PackageTags);analysis;soundex;double;metaphone;sounds;like;beider;morse;cologne;caverphone;nysiis;match;rating</PackageTags>

src/Lucene.Net.Analysis.SmartCn/Lucene.Net.Analysis.SmartCn.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Import Project="$(SolutionDir).build/nuget.props" />
3131

3232
<PropertyGroup>
33-
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>
33+
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
3434

3535
<AssemblyTitle>Lucene.Net.Analysis.SmartCn</AssemblyTitle>
3636
<PackageTags>$(PackageTags);analysis;chinese;smart</PackageTags>

src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<Import Project="$(SolutionDir).build/nuget.props" />
3131

3232
<PropertyGroup>
33-
<TargetFrameworks>net10.0;net8.0;netstandard2.0;net462</TargetFrameworks>
33+
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
3434

3535
<AssemblyTitle>Lucene.Net.Analysis.Stempel</AssemblyTitle>
3636
<PackageTags>$(PackageTags);analysis;polish</PackageTags>

0 commit comments

Comments
 (0)