Skip to content

Commit

Permalink
Merge pull request #51 from AArnott/polytype
Browse files Browse the repository at this point in the history
Switch dependency from typeshape-csharp to PolyType
  • Loading branch information
AArnott authored Nov 7, 2024
2 parents ec9f3dc + 679f1eb commit 65b43cf
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<RoslynVersion>4.11.0</RoslynVersion>
<PolyTypeVersion>0.15.3-gdec65ec2a5</PolyTypeVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
Expand All @@ -17,7 +18,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
<PackageVersion Include="Nerdbank.Streams" Version="2.11.79" />
<PackageVersion Include="PolySharp" Version="1.14.1" />
<PackageVersion Include="typeshape-csharp" Version="0.14.1" />
<PackageVersion Include="PolyType" Version="$(PolyTypeVersion)" />
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit" Version="2.9.2" />
Expand Down
2 changes: 1 addition & 1 deletion src/Nerdbank.MessagePack.Analyzers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static class PropertyShapeAttribute
{
public const string TypeName = "PropertyShapeAttribute";
public const string IgnoreProperty = "Ignore";
public static readonly ImmutableArray<string> Namespace = ["TypeShape"];
public static readonly ImmutableArray<string> Namespace = ["PolyType"];
}

public static class KeyAttribute
Expand Down
2 changes: 1 addition & 1 deletion src/Nerdbank.MessagePack.Analyzers/ReferenceSymbols.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out
return false;
}

INamedTypeSymbol? propertyShapeAttribute = compilation.GetTypeByMetadataName("TypeShape.PropertyShapeAttribute");
INamedTypeSymbol? propertyShapeAttribute = compilation.GetTypeByMetadataName("PolyType.PropertyShapeAttribute");
if (propertyShapeAttribute is null)
{
referenceSymbols = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Nerdbank.MessagePack/Nerdbank.MessagePack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Validation" PrivateAssets="compile" />
<PackageReference Include="Nerdbank.Streams" />
<PackageReference Include="typeshape-csharp" />
<PackageReference Include="PolyType" />
</ItemGroup>
<ItemGroup>
<None Update="Converters\IntConverters.tt">
Expand Down
4 changes: 2 additions & 2 deletions src/Nerdbank.MessagePack/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
global using System.Buffers;
global using Nerdbank.MessagePack.Converters;
global using Nerdbank.MessagePack.Utilities;
global using TypeShape;
global using TypeShape.Abstractions;
global using PolyType;
global using PolyType.Abstractions;
2 changes: 1 addition & 1 deletion test/Benchmarks/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
global using BenchmarkDotNet.Jobs;
global using Nerdbank.MessagePack;
global using Nerdbank.Streams;
global using TypeShape;
global using PolyType;
global using MsgPackCSharp = global::MessagePack;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ConverterAnalyzersTests
public async Task NoIssues()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
public class MyType { }
Expand All @@ -28,8 +28,8 @@ public class MyTypeConverter : MessagePackConverter<MyType>
public async Task CreatesNewSerializer()
{
string source = /* lang=c#-test */ """
using TypeShape;
using TypeShape.Abstractions;
using PolyType;
using PolyType.Abstractions;
using Nerdbank.MessagePack;
public partial class MyType : IShapeable<MyType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class KeyAttributeUseAnalyzerTests
public async Task NoIssues()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand All @@ -33,7 +33,7 @@ public class MyType
public async Task KeyReuseInOneClass()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand All @@ -54,7 +54,7 @@ public class MyType
public async Task KeyReuseAcrossClassHierarchy()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand All @@ -79,7 +79,7 @@ public class MyType : MyBaseType
public async Task MissingKey()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand All @@ -99,7 +99,7 @@ public class MyType
public async Task MissingKeyOnBaseType()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand All @@ -123,7 +123,7 @@ public class MyType : {|NBMsgPack001:MyBaseType|}
public async Task KeyOnNonSerializedInternalProperty()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand All @@ -144,7 +144,7 @@ public class MyType
public async Task KeyOnNonSerializedPublicProperty()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[GenerateShape]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class MessagePackConverterAttributeAnalyzerTests
public async Task NoIssues()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[MessagePackConverter(typeof(MyTypeConverter))]
Expand All @@ -31,7 +31,7 @@ public class MyTypeConverter : MessagePackConverter<MyType>
public async Task MissingPublicDefaultCtor()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[MessagePackConverter({|NBMsgPack021:typeof(MyTypeConverter)|})]
Expand All @@ -54,7 +54,7 @@ private MyTypeConverter() { }
public async Task TypeDoesNotDeriveFromConverter()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[MessagePackConverter({|NBMsgPack020:typeof(MyTypeConverter)|})]
Expand All @@ -76,7 +76,7 @@ public class MyTypeConverter
public async Task TypeDoesNotDeriveFromConverterOfMatchingType()
{
string source = /* lang=c#-test */ """
using TypeShape;
using PolyType;
using Nerdbank.MessagePack;
[MessagePackConverter({|NBMsgPack020:typeof(IntConverter)|})]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using TypeShape;
using PolyType;

internal static class ReferencesHelper
{
Expand Down
4 changes: 2 additions & 2 deletions test/Nerdbank.MessagePack.Tests/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
global using System.Collections.Immutable;
global using Nerdbank.MessagePack;
global using Nerdbank.Streams;
global using TypeShape;
global using TypeShape.Abstractions;
global using PolyType;
global using PolyType.Abstractions;
global using Xunit;
global using Xunit.Abstractions;

0 comments on commit 65b43cf

Please sign in to comment.