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/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ runs:
- name: Setup dotnet build tools
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0
7.0
dotnet-version: 8.0

- name: Setup Consul if needed
uses: launchdarkly/gh-actions/actions/[email protected]
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/xcode-select/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Xcode Version Selector'
description: 'Lists available Xcode versions, selects a specific version, and shows the current version'
inputs:
xcode-version:
description: 'The version of Xcode to select'
required: true
default: '16.2'

runs:
using: composite
steps:
- name: List Available Xcode Versions
shell: bash
run: ls -la /Applications/ | grep "Xcode"

- name: Select Xcode Version
shell: bash
run: sudo xcode-select -switch /Applications/Xcode_${{ inputs.xcode-version }}.app

- name: Show Current Xcode Version
shell: bash
run: xcodebuild -version
10 changes: 9 additions & 1 deletion .github/workflows/release-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
with:
fetch-depth: 0 # fetch all history, useful for docs

- uses: ./.github/actions/xcode-select
with:
xcode-version: '16.2'

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV
Expand All @@ -45,7 +49,7 @@ jobs:
with:
project_file: ${{ env.PROJECT_FILE }}
test_project_file: ${{ env.TEST_PROJECT_FILE }}
target_test_framework: "net7.0"
target_test_framework: "8.0"

- name: Release build
uses: ./.github/actions/build-release
Expand Down Expand Up @@ -122,6 +126,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/xcode-select
with:
xcode-version: '16.2'

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/sdk-client-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
id-token: write
contents: read
steps:
- name: Print Xcode Version
run: xcodebuild -version

- uses: actions/checkout@v4

- uses: ./.github/actions/xcode-select
with:
xcode-version: '16.2'

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/sdk/client/github_actions.env)" >> $GITHUB_ENV
Expand All @@ -39,7 +40,7 @@ jobs:
with:
project_file: ${{ env.PROJECT_FILE}}
test_project_file: ${{ env.TEST_PROJECT_FILE}}
target_test_framework: "net7.0"
target_test_framework: "net8.0"

- uses: ./.github/actions/contract-tests
with:
Expand Down
4 changes: 2 additions & 2 deletions pkgs/sdk/client/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ dotnet build src/LaunchDarkly.ClientSdk.csproj

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).

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.:
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.:

```
dotnet build /p:TargetFramework=net7.0-ios src/LaunchDarkly.ClientSdk.csproj
dotnet build /p:TargetFramework=net8.0-ios src/LaunchDarkly.ClientSdk.csproj
```

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.
Expand Down
14 changes: 7 additions & 7 deletions pkgs/sdk/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ For using LaunchDarkly in *server-side* .NET applications, refer to our [Server-
This version of the SDK is built for the following targets:

* .Net Standard 2.0
* .Net 7 Android, for use with Android 5.0 (Android API 21) and higher.
* .Net 7 iOS, for use with iOS 11 and higher.
* .Net 7 macOS (using Mac Catalyst), for use with macOS 10.15 and higher.
* .Net 7 Windows (using WinUI), for Windows 11 and Windows 10 version 1809 or higher.
* .NET 7
* .Net 8 Android, for use with Android 5.0 (Android API 21) and higher.
* .Net 8 iOS, for use with iOS 11 and higher.
* .Net 8 macOS (using Mac Catalyst), for use with macOS 11 and higher.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://learn.microsoft.com/en-us/dotnet/maui/supported-platforms?view=net-maui-8.0, the minimum requirement bumps from 10.15 to 11 which were released in 2019 and 2020 respectively. 10.15 has been EOL since 2022.

* .Net 8 Windows (using WinUI), for Windows 11 and Windows 10 version 1809 or higher.
* .NET 8

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.
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.

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

Expand Down Expand Up @@ -54,7 +54,7 @@ We encourage pull requests and other contributions from the community. Check out
* 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.
* 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?).
* 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.
* 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.
* 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.
* 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.
* Explore LaunchDarkly
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
Expand Down
2 changes: 1 addition & 1 deletion pkgs/sdk/client/contract-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ To run these tests locally, run `make contract-tests` from the SDK project root

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.

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).
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).
2 changes: 1 addition & 1 deletion pkgs/sdk/client/contract-tests/TestService.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net7.0</TestFramework>
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net8.0</TestFramework>
<TargetFrameworks>$(TESTFRAMEWORK)</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>ContractTestService</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion pkgs/sdk/client/github_actions.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ BUILD_OUTPUT_PATH=pkgs/sdk/client/src/bin/Release/
BUILD_OUTPUT_DLL_NAME=LaunchDarkly.ClientSdk.dll
TEST_PROJECT_FILE=pkgs/sdk/client/test/LaunchDarkly.ClientSdk.Tests/LaunchDarkly.ClientSdk.Tests.csproj
CONTRACT_TEST_PROJECT_FILE=pkgs/sdk/client/contract-tests/TestService.csproj
CONTRACT_TEST_DLL_FILE=pkgs/sdk/client/contract-tests/bin/debug/net7.0/ContractTestService.dll
CONTRACT_TEST_DLL_FILE=pkgs/sdk/client/contract-tests/bin/debug/net8.0/ContractTestService.dll
2 changes: 1 addition & 1 deletion pkgs/sdk/client/scripts/start-contract-test-service.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
cd contract-tests && dotnet bin/Debug/${TESTFRAMEWORK:-net7.0}/ContractTestService.dll
cd contract-tests && dotnet bin/Debug/${TESTFRAMEWORK:-net8.0}/ContractTestService.dll
14 changes: 7 additions & 7 deletions pkgs/sdk/client/src/Internal/SdkPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ internal static class SdkPackage
/// </remarks>
internal static string DotNetTargetFramework =>
// We'll need to update this whenever we add or remove supported target frameworks in the .csproj file.
// Order of these conditonals matters. Specific frameworks come before net7.0 intentionally.
// Order of these conditonals matters. Specific frameworks come before net8.0 intentionally.
#if ANDROID
"net7.0-android";
"net8.0-android";
#elif IOS
"net7.0-ios";
"net8.0-ios";
#elif MACCATALYST
"net7.0-maccatalyst";
"net8.0-maccatalyst";
#elif WINDOWS
"net7.0-windows";
#elif NET7_0
"net7.0";
"net8.0-windows";
#elif NET8_0
"net8.0";
#else
"unknown";
#endif
Expand Down
16 changes: 8 additions & 8 deletions pkgs/sdk/client/src/LaunchDarkly.ClientSdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
that doesn't have the MAUI tools installed. That is currently the case in
the release phase where we build HTML documentation. -->

<BuildFrameworks Condition="'$(BUILDFRAMEWORKS)' == ''">netstandard2.0;net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst;net7.0-windows</BuildFrameworks>
<BuildFrameworks Condition="'$(BUILDFRAMEWORKS)' == ''">netstandard2.0;net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst;net8.0-windows</BuildFrameworks>
<TargetFrameworks>$(BUILDFRAMEWORKS)</TargetFrameworks>
<UseMauiEssentials>true</UseMauiEssentials>
<OutputType>Library</OutputType>
<AssemblyName>LaunchDarkly.ClientSdk</AssemblyName>
<PackageId>LaunchDarkly.ClientSdk</PackageId>
Expand Down Expand Up @@ -47,33 +46,34 @@
<PackageReference Include="LaunchDarkly.EventSource" Version="5.0.1"/>
<PackageReference Include="LaunchDarkly.InternalSdk" Version="3.5.0" />
<PackageReference Include="LaunchDarkly.Logging" Version="2.0.0"/>
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.100" />
<Compile Include="**\*.cs" Exclude="PlatformSpecific\*.cs;bin\**\*.cs;obj\**\*.cs"/>
<Compile Include="PlatformSpecific\*.shared.cs"/>
</ItemGroup>

<!-- dependencies and source files for .NET 7.0 (all versions) -->
<ItemGroup Condition="$(TargetFramework.ToLower().Equals('netstandard2.0')) Or $(TargetFramework.ToLower().Equals('net7.0'))">
<!-- dependencies and source files for .NET 8.0 (all versions) -->
<ItemGroup Condition="$(TargetFramework.ToLower().Equals('netstandard2.0')) Or $(TargetFramework.ToLower().Equals('net8.0'))">
<Compile Include="**\*.netstandard.cs"/>
</ItemGroup>

<!-- dependencies and source files for Android (all versions) -->
<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-android'))">
<ItemGroup Condition="$(TargetFramework.StartsWith('net8.0-android'))">
<Compile Include="**\*.android.cs"/>
<Compile Include="**\*.maui.cs"/>
<Reference Include="System.Numerics"/>
<Reference Include="System.Numerics.Vectors"/>
</ItemGroup>

<!-- dependencies and source files for iOS (all versions) -->
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('net7.0-ios'))">
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('net8.0-ios'))">
<Compile Include="**\*.ios.cs"/>
<Compile Include="**\*.maui.cs"/>
<Reference Include="System.Numerics"/>
<Reference Include="System.Numerics.Vectors"/>
</ItemGroup>

<!-- dependencies and source files for MacCatalyst (all versions) -->
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('net7.0-maccatalyst'))">
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('net8.0-maccatalyst'))">
<Compile Include="**\*.maccatalyst.cs"/>
<Compile Include="**\*.maui.cs"/>
<Reference Include="System.Numerics"/>
Expand All @@ -88,7 +88,7 @@
</ItemGroup>

<!-- dependencies and source files for Windows (all versions) -->
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('net7.0-windows'))">
<ItemGroup Condition="$(TargetFramework.ToLower().StartsWith('net8.0-windows'))">
<Compile Include="**\*.windows.cs"/>
<Compile Include="**\*.maui.cs"/>
<Reference Include="System.Numerics"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android; net7.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>8.0-android; net8.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand Down Expand Up @@ -32,7 +32,7 @@
<!-- <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> -->
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
single framework that we are testing; this allows us to test with older SDK
versions that would error out if they saw any newer target frameworks listed
here, even if we weren't running those. -->
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net7.0</TestFramework>
<TestFramework Condition="'$(TESTFRAMEWORK)' == ''">net8.0</TestFramework>
<TargetFrameworks>$(TESTFRAMEWORK)</TargetFrameworks>
<AssemblyName>LaunchDarkly.ClientSdk.Tests</AssemblyName>
<RootNamespace>LaunchDarkly.Sdk.Client</RootNamespace>
Expand Down
Loading