Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/actions/build-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ runs:
- name: Setup dotnet build tools
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0
7.0
dotnet-version: 8.0

- name: Display dotnet version
shell: bash
Expand Down
4 changes: 1 addition & 3 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ runs:
- name: Setup dotnet build tools
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0
7.0
dotnet-version: 8.0

- run: dotnet --version
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/full-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
- name: CI check
uses: ./.github/actions/ci
with:
framework_target: "net6.0"
framework_target: "net8.0"

- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
name: Get secrets
Expand Down
4 changes: 1 addition & 3 deletions .github/actions/publish-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ runs:
- name: Setup dotnet build tools
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0
7.0
dotnet-version: 8.0

- name: Install Workloads
shell: bash
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
strategy:
matrix:
framework:
- { target: 'netcoreapp3.1', image: 'sdk:3.1-focal' }
- { target: 'net6.0', image: 'sdk:6.0-focal' }
- { target: 'net8.0', image: 'sdk:8.0' }
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet/${{ matrix.framework.image }}
env:
Expand Down
2 changes: 1 addition & 1 deletion src/LaunchDarkly.InternalSdk/Http/HttpProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public HttpMessageHandler NewHttpMessageHandler() =>

private static HttpMessageHandler DefaultHttpMessageHandlerFactory(HttpProperties props)
{
#if NETCOREAPP || NET6_0
#if NETCOREAPP
return new SocketsHttpHandler
{
ConnectTimeout = props.ConnectTimeout,
Expand Down
14 changes: 7 additions & 7 deletions src/LaunchDarkly.InternalSdk/JsonConverterHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public static void WriteLdValueIfNotNull(Utf8JsonWriter w, string name, LdValue
/// <param name="reader">the JSON reader</param>
/// <returns>an <see cref="ArrayHelper"/></returns>
/// <exception cref="JsonException">if the next token is not the beginning of an array</exception>
public static ArrayHelper RequireArray(ref Utf8JsonReader reader) =>
public static ArrayHelper RequireArray(scoped ref Utf8JsonReader reader) =>
new ArrayHelper(ref reader, false);

/// <summary>
Expand All @@ -195,7 +195,7 @@ public static ArrayHelper RequireArray(ref Utf8JsonReader reader) =>
/// <param name="reader">the JSON reader</param>
/// <returns>an <see cref="ArrayHelper"/></returns>
/// <exception cref="JsonException">if the next token is not the beginning of an array or null</exception>
public static ArrayHelper RequireArrayOrNull(ref Utf8JsonReader reader) =>
public static ArrayHelper RequireArrayOrNull(scoped ref Utf8JsonReader reader) =>
new ArrayHelper(ref reader, true);

/// <summary>
Expand All @@ -205,7 +205,7 @@ public static ArrayHelper RequireArrayOrNull(ref Utf8JsonReader reader) =>
/// <param name="reader">the JSON reader</param>
/// <returns>an <see cref="ObjectHelper"/></returns>
/// <exception cref="JsonException">if the next token is not the beginning of an object</exception>
public static ObjectHelper RequireObject(ref Utf8JsonReader reader)
public static ObjectHelper RequireObject(scoped ref Utf8JsonReader reader)
{
if (reader.TokenType == JsonTokenType.None)
{
Expand All @@ -222,7 +222,7 @@ public static ObjectHelper RequireObject(ref Utf8JsonReader reader)
/// <param name="reader">the JSON reader</param>
/// <returns>an <see cref="ObjectHelper"/></returns>
/// <exception cref="JsonException">if the next token is not the beginning of an object or null</exception>
public static ObjectHelper RequireObjectOrNull(ref Utf8JsonReader reader)
public static ObjectHelper RequireObjectOrNull(scoped ref Utf8JsonReader reader)
{
if (reader.TokenType == JsonTokenType.None)
{
Expand All @@ -245,7 +245,7 @@ public ref struct ArrayHelper
{
private readonly bool _empty;

internal ArrayHelper(ref Utf8JsonReader reader, bool allowNull)
internal ArrayHelper(scoped ref Utf8JsonReader reader, bool allowNull)
{
if (reader.TokenType == JsonTokenType.None)
{
Expand All @@ -268,7 +268,7 @@ internal ArrayHelper(ref Utf8JsonReader reader, bool allowNull)
/// </summary>
/// <param name="reader">the JSON reader (this must be passed again due to ref struct rules)</param>
/// <returns>true if there is an element, false if this is the end</returns>
public bool Next(ref Utf8JsonReader reader) =>
public bool Next(scoped ref Utf8JsonReader reader) =>
!_empty && reader.Read() && reader.TokenType != JsonTokenType.EndArray;
}

Expand Down Expand Up @@ -360,7 +360,7 @@ public ObjectHelper WithRequiredProperties(params string[] propertyNames) =>
/// </summary>
/// <param name="reader">the JSON reader (this must be passed again due to ref struct rules)</param>
/// <returns>true if there is a property, false if this is the end</returns>
public bool Next(ref Utf8JsonReader reader)
public bool Next(scoped ref Utf8JsonReader reader)
{
if (!_defined)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
an environment variable is that we want to be able to run CI tests using .NET
SDKs that may not support all of these target frameworks.
-->
<BuildFrameworks Condition="'$(BUILDFRAMEWORKS)' == ''">netstandard2.0;netcoreapp3.1;net462;net6.0</BuildFrameworks>
<BuildFrameworks Condition="'$(BUILDFRAMEWORKS)' == ''">netstandard2.0;net462;net8.0</BuildFrameworks>
<TargetFrameworks>$(BUILDFRAMEWORKS)</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>LaunchDarkly.InternalSdk</AssemblyName>
<OutputType>Library</OutputType>
<LangVersion>7.3</LangVersion>
<LangVersion>11</LangVersion>
<PackageId>LaunchDarkly.InternalSdk</PackageId>
<RootNamespace>LaunchDarkly.Sdk.Internal</RootNamespace>
<Description>LaunchDarkly internal common code for .NET and Xamarin clients</Description>
Expand All @@ -27,7 +27,7 @@
<RepositoryBranch>main</RepositoryBranch>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net462'">
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void NonEmptyArray()
VerifyNonEmptyArray(ref r2, ref a2);
}

private void VerifyNonEmptyArray(ref Utf8JsonReader r, ref ArrayHelper a)
private void VerifyNonEmptyArray(scoped ref Utf8JsonReader r, ref ArrayHelper a)
{
Assert.True(a.Next(ref r));
Assert.Equal(10, r.GetInt32());
Expand All @@ -207,7 +207,7 @@ public void EmptyArray()
VerifyEmptyArray(ref r2, ref a2);
}

private void VerifyEmptyArray(ref Utf8JsonReader r, ref ArrayHelper a) =>
private void VerifyEmptyArray(scoped ref Utf8JsonReader r, ref ArrayHelper a) =>
Assert.False(a.Next(ref r));

[Fact]
Expand Down Expand Up @@ -242,7 +242,7 @@ public void NonEmptyObject()
VerifyNonEmptyObject(ref r2, ref o2);
}

private void VerifyNonEmptyObject(ref Utf8JsonReader r, ref ObjectHelper o)
private void VerifyNonEmptyObject(scoped ref Utf8JsonReader r, ref ObjectHelper o)
{
Assert.True(o.Next(ref r));
Assert.Equal("a", o.Name);
Expand All @@ -267,7 +267,7 @@ public void EmptyObject()
VerifyEmptyObject(ref r2, ref o2);
}

private void VerifyEmptyObject(ref Utf8JsonReader r, ref ObjectHelper o) =>
private void VerifyEmptyObject(scoped ref Utf8JsonReader r, ref ObjectHelper o) =>
Assert.False(o.Next(ref r));

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">netcoreapp3.1;net462;net6.0</TestFramework>
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net462;net8.0</TestFramework>
<TargetFrameworks>$(TESTFRAMEWORK)</TargetFrameworks>
<AssemblyName>LaunchDarkly.InternalSdk.Tests</AssemblyName>
<RootNamespace>LaunchDarkly.Sdk.Internal</RootNamespace>
<!-- Match the library's C# 11, needed for the 'scoped' ref-safety annotations. -->
<LangVersion>11</LangVersion>
<Version>1.2.3</Version> <!-- we check for this value in tests -->
<ReleaseVersion>1.2.3</ReleaseVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
Expand Down
Loading