Skip to content

Commit

Permalink
update to .net 9
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Nov 14, 2024
1 parent b8f060a commit ea57ac8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/Equatable.Comparers/Equatable.Comparers.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
2 changes: 1 addition & 1 deletion src/Equatable.Generator/Equatable.Generator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<RootNamespace>Equatable</RootNamespace>
</PropertyGroup>

Expand Down
13 changes: 1 addition & 12 deletions src/Equatable.SourceGenerator/IsExternalInit.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.ComponentModel;

// ReSharper disable once CheckNamespace
namespace System.Runtime.CompilerServices;

/// <summary>
/// Reserved to be used by the compiler for tracking metadata.
/// This class should not be used by developers in source code.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
internal static class IsExternalInit
{
}
internal static class IsExternalInit;
17 changes: 15 additions & 2 deletions src/Equatable.SourceGenerator/Models/EquatableArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@
namespace Equatable.SourceGenerator.Models;

[ExcludeFromCodeCoverage]
public readonly struct EquatableArray<T>(T[] array) : IEquatable<EquatableArray<T>>, IEnumerable<T>
public readonly struct EquatableArray<T> : IEquatable<EquatableArray<T>>, IEnumerable<T>
where T : IEquatable<T>
{
public T[] Array { get; } = array ?? [];
public static readonly EquatableArray<T> Empty = new();


public EquatableArray() : this([]) { }

public EquatableArray(T[] array) => Array = array ?? [];

public EquatableArray(IEnumerable<T> items) => Array = items.ToArray() ?? [];


public T[] Array { get; }

public int Count => Array.Length;


public ReadOnlySpan<T> AsSpan() => Array.AsSpan();

public T[] AsArray() => Array;
Expand Down Expand Up @@ -44,4 +55,6 @@ public override int GetHashCode()


public static implicit operator EquatableArray<T>(T[] array) => new(array);

public static implicit operator EquatableArray<T>(List<T> items) => new(items);
}
5 changes: 4 additions & 1 deletion test/Equatable.Entities/Equatable.Entities.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

Expand Down

0 comments on commit ea57ac8

Please sign in to comment.