Skip to content

Commit aea1514

Browse files
authored
chore: Update SDK client to net8 (#103)
1 parent ba4e416 commit aea1514

14 files changed

Lines changed: 70 additions & 41 deletions

File tree

.github/actions/ci/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ runs:
3434
- name: Setup dotnet build tools
3535
uses: actions/setup-dotnet@v4
3636
with:
37-
dotnet-version: |
38-
8.0
39-
7.0
37+
dotnet-version: 8.0
4038

4139
- name: Setup Consul if needed
4240
uses: launchdarkly/gh-actions/actions/persistent-stores@persistent-stores-v0.1.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Xcode Version Selector'
2+
description: 'Lists available Xcode versions, selects a specific version, and shows the current version'
3+
inputs:
4+
xcode-version:
5+
description: 'The version of Xcode to select'
6+
required: true
7+
default: '16.2'
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: List Available Xcode Versions
13+
shell: bash
14+
run: ls -la /Applications/ | grep "Xcode"
15+
16+
- name: Select Xcode Version
17+
shell: bash
18+
run: sudo xcode-select -switch /Applications/Xcode_${{ inputs.xcode-version }}.app
19+
20+
- name: Show Current Xcode Version
21+
shell: bash
22+
run: xcodebuild -version

.github/workflows/release-sdk-client.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030
with:
3131
fetch-depth: 0 # fetch all history, useful for docs
3232

33+
- uses: ./.github/actions/xcode-select
34+
with:
35+
xcode-version: '16.2'
36+
3337
- name: Setup Env from project's Env file
3438
shell: bash
3539
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV
@@ -45,7 +49,7 @@ jobs:
4549
with:
4650
project_file: ${{ env.PROJECT_FILE }}
4751
test_project_file: ${{ env.TEST_PROJECT_FILE }}
48-
target_test_framework: "net7.0"
52+
target_test_framework: "8.0"
4953

5054
- name: Release build
5155
uses: ./.github/actions/build-release
@@ -122,6 +126,10 @@ jobs:
122126
steps:
123127
- uses: actions/checkout@v4
124128

129+
- uses: ./.github/actions/xcode-select
130+
with:
131+
xcode-version: '16.2'
132+
125133
- name: Setup Env from project's Env file
126134
shell: bash
127135
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV

.github/workflows/sdk-client-ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ jobs:
2020
id-token: write
2121
contents: read
2222
steps:
23-
- name: Print Xcode Version
24-
run: xcodebuild -version
25-
2623
- uses: actions/checkout@v4
2724

25+
- uses: ./.github/actions/xcode-select
26+
with:
27+
xcode-version: '16.2'
28+
2829
- name: Setup Env from project's Env file
2930
shell: bash
3031
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV
@@ -39,7 +40,7 @@ jobs:
3940
with:
4041
project_file: ${{ env.PROJECT_FILE}}
4142
test_project_file: ${{ env.TEST_PROJECT_FILE}}
42-
target_test_framework: "net7.0"
43+
target_test_framework: "net8.0"
4344

4445
- uses: ./.github/actions/contract-tests
4546
with:

pkgs/sdk/client/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ dotnet build src/LaunchDarkly.ClientSdk.csproj
2828

2929
Currently this command can only be run on MacOS, because that is the only platform that allows building for all of the targets (.NET Standard, Android, and iOS).
3030

31-
To build the SDK for only one of the supported platforms, add `/p:TargetFramework=X` where `X` is one of the items in the `<TargetFrameworks>` list of `LaunchDarkly.ClientSdk.csproj`: `netstandard2.0` for .NET Standard 2.0, `net7.0-android` for Android, etc.:
31+
To build the SDK for only one of the supported platforms, add `/p:TargetFramework=X` where `X` is one of the items in the `<TargetFrameworks>` list of `LaunchDarkly.ClientSdk.csproj`: `netstandard2.0` for .NET Standard 2.0, `net8.0-android` for Android, etc.:
3232

3333
```
34-
dotnet build /p:TargetFramework=net7.0-ios src/LaunchDarkly.ClientSdk.csproj
34+
dotnet build /p:TargetFramework=net8.0-ios src/LaunchDarkly.ClientSdk.csproj
3535
```
3636

3737
Note that the main project, `src/LaunchDarkly.ClientSdk`, contains source files that are built for all platforms (ending in just `.cs`, or `.shared.cs`), and also a smaller amount of code that is conditionally compiled for platform-specific functionality. The latter is all in the `PlatformSpecific` folder. We use `#ifdef` directives only for small sections that differ slightly between platform versions; otherwise the conditional compilation is done according to filename suffix (`.android.cs`, etc.) based on rules in the `.csproj` file.

pkgs/sdk/client/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ For using LaunchDarkly in *server-side* .NET applications, refer to our [Server-
1515
This version of the SDK is built for the following targets:
1616

1717
* .Net Standard 2.0
18-
* .Net 7 Android, for use with Android 5.0 (Android API 21) and higher.
19-
* .Net 7 iOS, for use with iOS 11 and higher.
20-
* .Net 7 macOS (using Mac Catalyst), for use with macOS 10.15 and higher.
21-
* .Net 7 Windows (using WinUI), for Windows 11 and Windows 10 version 1809 or higher.
22-
* .NET 7
18+
* .Net 8 Android, for use with Android 5.0 (Android API 21) and higher.
19+
* .Net 8 iOS, for use with iOS 11 and higher.
20+
* .Net 8 macOS (using Mac Catalyst), for use with macOS 11 and higher.
21+
* .Net 8 Windows (using WinUI), for Windows 11 and Windows 10 version 1809 or higher.
22+
* .NET 8
2323

24-
The .Net Standard and .Net 7.0 targets have no OS-specific code. This allows the SDK to be used in a desktop .NET Framework or .NET 7.0 application. However, due to the lack of OS-specific integration, SDK functionality will be limited in those environments: for instance, the SDK will not be able to detect whether networking is turned on or off.
24+
The .Net Standard and .Net 8.0 targets have no OS-specific code. This allows the SDK to be used in a desktop .NET Framework or .NET 8.0 application. However, due to the lack of OS-specific integration, SDK functionality will be limited in those environments: for instance, the SDK will not be able to detect whether networking is turned on or off.
2525

2626
The .NET build tools should automatically load the most appropriate build of the SDK for whatever platform your application or library is targeted to.
2727

@@ -54,7 +54,7 @@ We encourage pull requests and other contributions from the community. Check out
5454
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
5555
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
5656
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
57-
* Grant access to certain features based on user attributes, like payment plan (eg: users on the gold plan get access to more features than users in the silver plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
57+
* Grant access to certain features based on user attributes, like payment plan (eg: users on the 'gold' plan get access to more features than users in the 'silver' plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
5858
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
5959
* Explore LaunchDarkly
6060
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information

pkgs/sdk/client/contract-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ To run these tests locally, run `make contract-tests` from the SDK project root
66

77
Or, to test against an in-progress local version of the test harness, run `make start-contract-test-service` from the SDK project root directory; then, in the root directory of the `sdk-test-harness` project, build the test harness and run it from the command line.
88

9-
Currently, the project does _not_ automatically detect the available target frameworks. It will default to building and running for .NET 7.0. To use a different target framework, set the environment variable `TESTFRAMEWORK` to the name of the application runtime framework (such as `net7.0`), and set the environment variable `BUILDFRAMEWORKS` (note the S at the end) to the target framework that the SDK should be built for (which may or may not be the same).
9+
Currently, the project does _not_ automatically detect the available target frameworks. It will default to building and running for .NET 8.0. To use a different target framework, set the environment variable `TESTFRAMEWORK` to the name of the application runtime framework (such as `net8.0`), and set the environment variable `BUILDFRAMEWORKS` (note the S at the end) to the target framework that the SDK should be built for (which may or may not be the same).

pkgs/sdk/client/contract-tests/TestService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net7.0</TestFramework>
4+
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net8.0</TestFramework>
55
<TargetFrameworks>$(TESTFRAMEWORK)</TargetFrameworks>
66
<DebugType>portable</DebugType>
77
<AssemblyName>ContractTestService</AssemblyName>

pkgs/sdk/client/github_actions.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ BUILD_OUTPUT_PATH=pkgs/sdk/client/src/bin/Release/
44
BUILD_OUTPUT_DLL_NAME=LaunchDarkly.ClientSdk.dll
55
TEST_PROJECT_FILE=pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj
66
CONTRACT_TEST_PROJECT_FILE=pkgs/sdk/client/contract-tests/TestService.csproj
7-
CONTRACT_TEST_DLL_FILE=pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll
7+
CONTRACT_TEST_DLL_FILE=pkgs/sdk/client/contract-tests/bin/debug/net8.0/ContractTestService.dll
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
cd contract-tests && dotnet bin/Debug/${TESTFRAMEWORK:-net7.0}/ContractTestService.dll
2+
cd contract-tests && dotnet bin/Debug/${TESTFRAMEWORK:-net8.0}/ContractTestService.dll

0 commit comments

Comments
 (0)