Bump net6.0 target to net8.0.
This commit is contained in:
Jonathan Tims 2024-09-05 00:51:09 +01:00 коммит произвёл GitHub
Родитель 55ef60d9a8
Коммит e4ca47a7d8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
35 изменённых файлов: 81 добавлений и 58 удалений

Просмотреть файл

@ -76,7 +76,7 @@ There are three test assemblies in the solution:
- **TestPublic.dll** in the folder `test/TestPublic`.
- **Microsoft.ML.Probabilistic.Learners.Tests.dll** in the folder `test/Learners/LearnersTests`.
Depending on the build configuration and targeted framework, the assemblies will be located in the `bin/Debug<Core|Full>/<net6.0|net472>` or `bin/Release<Core|Full>/<net6.0|net472>` subdirectories
Depending on the build configuration and targeted framework, the assemblies will be located in the `bin/Debug<Core|Full>/<net8.0|net472>` or `bin/Release<Core|Full>/<net8.0|net472>` subdirectories
of the test project.
Runner executes tests in parallel by default. However, some test category must be run

Просмотреть файл

@ -8,7 +8,7 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\..\Infer.snk</AssemblyOriginatorKeyFile>
<!-- By default we do not want projects to be packaged using NuGet. -->
<IsPackable>false</IsPackable>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)\..\CodeAnalysis.ruleset</CodeAnalysisRuleSet>

Просмотреть файл

@ -51,6 +51,14 @@ mkdir "${out}/net6.0-windows"
dst="${out}/net6.0-windows"
src="bin/${configuration}/net6.0-windows"
cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.dll ${dst}
cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.pdb ${dst}
cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.xml ${dst}
mkdir "${out}/net8.0-windows"
dst="${out}/net8.0-windows"
src="bin/${configuration}/net8.0-windows"
cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.dll ${dst}
cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.pdb ${dst}
cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.xml ${dst}

Просмотреть файл

@ -14,6 +14,6 @@ steps:
inputs:
targetType: 'inline'
script: dotnet Evaluator.dll InferNetRunsOnly.xml
workingDirectory: ${{ format('src/Learners/Runners/Evaluator/bin/{0}/net6.0', parameters.Configuration) }}
workingDirectory: ${{ format('src/Learners/Runners/Evaluator/bin/{0}/net8.0', parameters.Configuration) }}
displayName: Running Evaluator
continueOnError: true

Просмотреть файл

@ -19,7 +19,7 @@ steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
version: '8.x'
- script: |
dotnet build /p:DisableImplicitNuGetFallbackFolder=true --configuration $(BuildConfiguration)Core Infer.sln

Просмотреть файл

@ -14,7 +14,7 @@ steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
version: '8.x'
- script: |
echo Checking $(Build.Repository.LocalPath)\src\Runtime\Factors\FactorDocs.xml...

Просмотреть файл

@ -11,7 +11,7 @@ steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
version: '8.x'
- script: |
dotnet build /p:DisableImplicitNuGetFallbackFolder=true --configuration $(buildConfiguration)Core Infer.sln

Просмотреть файл

@ -22,7 +22,7 @@ jobs:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
version: '8.x'
- script: |
dotnet build --configuration $(BuildConfiguration)Core Infer.sln
@ -37,7 +37,7 @@ jobs:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
version: '8.x'
- script: |
dotnet build --configuration $(BuildConfiguration)Core Infer.sln

Просмотреть файл

@ -17,12 +17,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -18,12 +18,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -17,12 +17,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -16,12 +16,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -16,12 +16,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -18,12 +18,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -18,12 +18,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -17,12 +17,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -20,18 +20,18 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup Condition="'$(IsWindows)'=='true'">
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindows)'!='true'">
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="'$(IsWindows)'=='true'">
<TargetFrameworks>net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net472</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(IsWindows)'!='true'">
<TargetFramework>net6.0;net472</TargetFramework>
<TargetFramework>net8.0;net472</TargetFramework>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -19,23 +19,23 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-windows;net472</TargetFrameworks>
<!-- No need to generate code twice -->
<IgnorePostBuildNetCore>true</IgnorePostBuildNetCore>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<RunPostBuildNetCore Condition="$(IgnorePostBuildNetCore) != 'true'">true</RunPostBuildNetCore>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0-windows' OR '$(TargetFramework)' == 'net472'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-windows' OR '$(TargetFramework)' == 'net472'">
<RunPostBuildNetFull>true</RunPostBuildNetFull>
</PropertyGroup>

Просмотреть файл

@ -19,19 +19,19 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<!-- No need to generate code twice -->
<IgnorePostBuildNetCore>true</IgnorePostBuildNetCore>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<RunPostBuildNetCore Condition="$(IgnorePostBuildNetCore) != 'true'">true</RunPostBuildNetCore>
</PropertyGroup>

Просмотреть файл

@ -18,12 +18,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -20,12 +20,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -40,6 +40,7 @@ namespace Microsoft.ML.Probabilistic.Learners.Runners
{
}
#if NET472
/// <summary>
/// Initializes a new instance of the <see cref="ExternalCommandExecutionException"/> class.
/// </summary>
@ -49,5 +50,6 @@ namespace Microsoft.ML.Probabilistic.Learners.Runners
: base(info, context)
{
}
#endif
}
}

Просмотреть файл

@ -122,6 +122,12 @@ namespace Microsoft.ML.Probabilistic.Serialization
foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly))
{
// In .NET8.0 we now have certain compiler generated fields without a proper type.
if (field.FieldType.FullName == null)
{
continue;
}
RecursivelyAddTypes(field.FieldType, types);
}

Просмотреть файл

@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Microsoft.ML.Probabilistic.Tools.BuildFactorDoc</RootNamespace>
<AssemblyName>Microsoft.ML.Probabilistic.Tools.BuildFactorDoc</AssemblyName>
</PropertyGroup>

Просмотреть файл

@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Microsoft.ML.Probabilistic.Tools.PrepareSource</AssemblyName>
<RootNamespace>Microsoft.ML.Probabilistic.Tools.PrepareSource</RootNamespace>
</PropertyGroup>

Просмотреть файл

@ -19,12 +19,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-windows;net472</TargetFrameworks>
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
</PropertyGroup>
</Otherwise>
@ -52,7 +52,7 @@
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<Choose>
<When Condition="$(TargetFramework) == 'net472' OR $(TargetFramework) == 'net6.0-windows'">
<When Condition="$(TargetFramework) == 'net472' OR $(TargetFramework) == 'net8.0-windows'">
<ItemGroup>
<ProjectReference Include="..\Visualizers\Windows\Visualizers.Windows.csproj" />
<Compile Update="ExamplesViewer.cs">

Просмотреть файл

@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Infer.NET is a framework for running Bayesian inference in graphical models. It can also be used for probabilistic programming. This package contains visualization tools for exploring and analyzing models on Windows platform.</Description>
<TargetFrameworks>net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net6.0-windows;net472</TargetFrameworks>
<AssemblyName>Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows</AssemblyName>
<PackageId>Microsoft.ML.Probabilistic.Visualizers.Windows$(NuGetPackageIdSuffix)</PackageId>
<DefineConstants>TRACE;SUPPRESS_XMLDOC_WARNINGS, SUPPRESS_UNREACHABLE_CODE_WARNINGS, SUPPRESS_AMBIGUOUS_REFERENCE_WARNINGS</DefineConstants>
@ -74,6 +74,7 @@
by the NuGet package format; so we list them explicitly here.
-->
<None Include="$(BaseOutputPath)\net6.0-windows\$(AssemblyName).pdb" Pack="true" PackagePath="\lib\net6.0-windows7.0\" />
<None Include="$(BaseOutputPath)\net8.0-windows\$(AssemblyName).pdb" Pack="true" PackagePath="\lib\net8.0-windows7.0\" />
<None Include="$(BaseOutputPath)\net472\$(AssemblyName).pdb" Pack="true" PackagePath="\lib\net472\" />
</ItemGroup>
</Project>

Просмотреть файл

@ -15,12 +15,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -18,12 +18,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -20,12 +20,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-windows;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -19,12 +19,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -17,12 +17,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-windows;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-windows;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -83,6 +83,12 @@ namespace Microsoft.ML.Probabilistic.Tests
foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly))
{
// In .NET8.0 we now have certain compiler generated fields without a proper type.
if (field.FieldType.FullName == null)
{
continue;
}
VisitTypesRecursively(field.FieldType, visitType, alreadyReviewed);
}
}

Просмотреть файл

@ -18,12 +18,12 @@
</When>
<When Condition="'$(Configuration)'=='DebugCore' OR '$(Configuration)'=='ReleaseCore'">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

Просмотреть файл

@ -15,7 +15,7 @@ then
configuration=Release
fi
compath=/bin/${configuration}/net6.0/
compath=/bin/${configuration}/net8.0/
# filter for parallel test run
#parallel_filter='-notrait Platform=x86 -notrait Category=OpenBug -notrait Category=BadTest -notrait Category=CompilerOptionsTest -notrait Category=CsoftModel -notrait Category=ModifiesGlobals -notrait Category=DistributedTest -notrait Category=Performance'