Skip to content

Commit

Permalink
try net8 packaging (#1113)
Browse files Browse the repository at this point in the history
* try net8 packaging

* explicit assembly binding redirect

* attempt to fix file collision problems
  • Loading branch information
mgravell committed Dec 4, 2023
1 parent f750d75 commit 5e8ae8f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ skip_commits:
install:
- choco install dotnet-sdk --version 6.0.406
- choco install dotnet-sdk --version 7.0.200
- choco install dotnet-sdk --version 8.0.100

environment:
Appveyor: true
Expand Down
2 changes: 2 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestPatch",
"allowPrerelease": false
}
}
3 changes: 2 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<DefaultLanguage>en-US</DefaultLanguage>
<IncludeSymbols>false</IncludeSymbols>
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
<LangVersion>9.0</LangVersion>
<LangVersion>12</LangVersion>
<Features>strict</Features>
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)Shared.ruleset</CodeAnalysisRuleset>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

Expand Down
1 change: 1 addition & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<PackageVersion Include="protobuf-net.Grpc" Version="1.0.21" />
<PackageVersion Include="protobuf-net.Grpc.Reflection" Version="1.1.1" />

<PackageVersion Include="System.Buffers" Version="4.5.1" />
<PackageVersion Include="System.CodeDom" Version="7.0.0" />
<PackageVersion Include="System.Collections.Immutable" Version="7.0.0" />
<PackageVersion Include="System.Collections.NonGeneric" Version="4.3.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/protobuf-net.Protogen/protobuf-net.Protogen.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release;VS</Configurations>
<PackAsTool>true</PackAsTool>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand Down
11 changes: 11 additions & 0 deletions src/protobuf-net.Test/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
5 changes: 4 additions & 1 deletion src/protobuf-net.Test/NullCollections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using Xunit;
using Xunit.Abstractions;
using static ProtoBuf.Test.BufferWriteCountTests;
Expand Down Expand Up @@ -193,6 +194,8 @@ public void SchemaGenerationSucceeds(Type type, string expected)
[InlineData(10, "23-0A-04-0A-02-08-00-0A-04-0A-02-08-01-0A-00-0A-04-0A-02-08-03-0A-04-0A-02-08-04-0A-00-0A-04-0A-02-08-06-0A-04-0A-02-08-07-0A-00-0A-04-0A-02-08-09-24")]
public void TestManualWrappedGroupEquivalent_WrappedValues(int count, string? hex = null) => Test<ManualWrappedGroupEquivalent_WrappedValues>(count, true, hex, true);

static int _next;
private static int Next() => Interlocked.Increment(ref _next);

private void Test<T>(int count, bool preserveEmpty, string? expectedHex, bool usesWrappedValues = false, [CallerMemberName] string name = "") where T : class, ITestScenario, new()
{
Expand All @@ -202,7 +205,7 @@ private void Test<T>(int count, bool preserveEmpty, string? expectedHex, bool us
Test<T>(model, count, preserveEmpty, expectedHex, true, usesWrappedValues);
model.CompileInPlace();
Test<T>(model, count, preserveEmpty, expectedHex, false, usesWrappedValues);
Test<T>(count == 0 ? PEVerify.CompileAndVerify(model, name) : model.Compile(), count, preserveEmpty, expectedHex, false, usesWrappedValues);
Test<T>(count == 0 ? PEVerify.CompileAndVerify(model, name + Next()) : model.Compile(), count, preserveEmpty, expectedHex, false, usesWrappedValues);
}

private void Test<T>(TypeModel model, int count, bool preserveEmpty, string? expectedHex, bool logHex, bool usesWrappedValues) where T : class, ITestScenario, new()
Expand Down
1 change: 1 addition & 0 deletions src/protobuf-net.Test/protobuf-net.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<ItemGroup Condition="$(TargetFramework)=='net462'">
<PackageReference Include="NHibernate" />
<PackageReference Include="Iesi.Collections" />
<PackageReference Include="System.Buffers" />
</ItemGroup>
<ItemGroup Condition="'$(LibImport)' == 'net'">
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/protogen/protogen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<VersionPrefix>$(ProtoGenVersion)</VersionPrefix>
<OutputType>Exe</OutputType>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release;VS</Configurations>
<AssemblyName>protogen</AssemblyName>
<Title>protobuf-net command-line "global tool" for .NET code-generation from .proto schema files</Title>
Expand Down

0 comments on commit 5e8ae8f

Please sign in to comment.