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
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Build example app APK
run: cd splitio/example; flutter build apk

Expand All @@ -34,12 +35,13 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Run Pub Get
run: cd splitio/; flutter pub get
- name: Build Android
run: cd splitio/example/android/; flutter build apk
- name: Run Android test
run: cd splitio/example/android/; ./gradlew :splitio:testReleaseUnitTest;
run: cd splitio/example; flutter build apk
- name: Run Android unit tests
run: cd splitio_android; flutter test

build-ios:
name: Build iOS
Expand All @@ -50,8 +52,9 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Run Build iOS
run: cd splitio/example/ios; flutter build ios --no-codesign;
run: cd splitio/example; flutter build ios --no-codesign;

test-ios:
name: Test iOS
Expand All @@ -62,6 +65,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Run Build iOS
run: cd splitio_ios/example/; flutter build ios --no-codesign;

Expand All @@ -81,6 +85,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Build Web
run: cd splitio/example; flutter build web

Expand All @@ -92,6 +97,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Build Web
run: cd splitio/example; flutter build web
- name: Run Web test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
inputSet:
name: flutter-sdk-plugin-inputset
identifier: fluttersdkplugininputset
orgIdentifier: PROD
projectIdentifier: Harness_Split
pipeline:
identifier: fluttersdkplugin
properties:
ci:
codebase:
build:
type: branch
spec:
branch: <+trigger.sourceBranch>
178 changes: 178 additions & 0 deletions .harness/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
pipeline:
name: flutter-sdk-plugin-repo
identifier: fluttersdkplugin
projectIdentifier: Harness_Split
orgIdentifier: PROD
tags: {}
properties:
ci:
codebase:
connectorRef: fmegithubharnessgitops
repoName: flutter-sdk-plugin
build:
type: branch
spec:
branch: <+input>
stages:
- stage:
name: Build and Test
identifier: Build_and_Test
description: ""
type: CI
spec:
cloneCodebase: true
caching:
enabled: true
override: true
platform:
os: Linux
arch: Amd64
runtime:
type: Cloud
spec:
size: flex
execution:
steps:
- step:
type: Run
name: Install Java
identifier: Install_Java
spec:
shell: Bash
command: |-
set -e
JDK_DIR="$HOME/jdk-17"
curl -fsSL "https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk" -o /tmp/jdk17.tar.gz
mkdir -p "$JDK_DIR"
tar -xzf /tmp/jdk17.tar.gz -C "$JDK_DIR" --strip-components=1
export JAVA_HOME="$JDK_DIR"
export PATH="$JAVA_HOME/bin:$PATH"
java -version
printf 'export JAVA_HOME=%s\nexport PATH="$JAVA_HOME/bin:$PATH"\n' "$JDK_DIR" > "$HOME/java.env"
- step:
type: Run
name: Install Flutter
identifier: Install_Flutter
spec:
shell: Bash
command: |-
git clone https://github.com/flutter/flutter.git -b stable --depth 1 $HOME/flutter
export PATH="$HOME/flutter/bin:$PATH"
flutter --version
flutter config --no-analytics
flutter precache
- step:
type: Run
name: Test splitio
identifier: Test_splitio
spec:
shell: Bash
command: |-
export PATH="$HOME/flutter/bin:$PATH"
cd splitio
flutter pub get
flutter test
- step:
type: Run
name: Test splitio_android
identifier: Test_splitio_android
spec:
shell: Bash
command: |-
export PATH="$HOME/flutter/bin:$PATH"
cd splitio_android
flutter pub get
flutter test
- step:
type: Run
name: Test splitio_ios
identifier: Test_splitio_ios
spec:
shell: Bash
command: |-
export PATH="$HOME/flutter/bin:$PATH"
cd splitio_ios
flutter pub get
flutter test
- step:
type: Run
name: Test splitio_web
identifier: Test_splitio_web
spec:
shell: Bash
command: |-
export PATH="$HOME/flutter/bin:$PATH"
cd splitio_web
flutter pub get
flutter test --platform=chrome
- step:
type: Run
name: SonarQube Scan
identifier: SonarQube_Scan
when:
stageStatus: Success
condition: <+matrix.sdkVersion> == "stable"
spec:
shell: Bash
command: |-
set -e
. "$HOME/java.env"
export SONAR_SCANNER_VERSION=5.0.1.3006
curl -sSLo sonar-scanner.zip \
"https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip"
unzip -q sonar-scanner.zip
export PATH="$PWD/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:$PATH"
sonar-scanner \
-Dsonar.projectKey=flutter-sdk-plugin \
-Dsonar.sources=splitio/lib,splitio_android/lib,splitio_ios/lib,splitio_web/lib,splitio_platform_interface/lib \
-Dsonar.tests=splitio/test,splitio_android/test,splitio_ios/test,splitio_web/test,splitio_platform_interface/test \
-Dsonar.host.url=https://sonar.harness.io \
-Dsonar.token=<+secrets.getValue("sonarqube-token")> \
-Dsonar.exclusions="**/example/**,**/.dart_tool/**,**/build/**"
- step:
type: Run
name: Post Quality Gate
identifier: Post_Quality_Gate
when:
stageStatus: Success
condition: <+matrix.sdkVersion> == "stable"
spec:
shell: Bash
command: |-
#!/bin/bash
set -e

SONAR_TOKEN="<+secrets.getValue("sonarqube-token")>"
SONAR_URL="https://sonar.harness.io"
SONAR_PROJECT_KEY="flutter-sdk-plugin"
GITHUB_TOKEN="<+secrets.getValue("github-devops-token")>"
GITHUB_REPO="flutter-sdk-plugin"
COMMIT_SHA="<+codebase.commitSha>"

STATUS_JSON=$(curl -sf \
-H "Authorization: Bearer ${SONAR_TOKEN}" \
"${SONAR_URL}/api/qualitygates/project_status?projectKey=${SONAR_PROJECT_KEY}")

QG_STATUS=$(echo "$STATUS_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['projectStatus']['status'])")

case "$QG_STATUS" in
OK) GH_STATE="success"; DESCRIPTION="Quality gate passed" ;;
ERROR) GH_STATE="failure"; DESCRIPTION="Quality gate failed" ;;
WARN) GH_STATE="success"; DESCRIPTION="Quality gate passed with warnings" ;;
*) GH_STATE="pending"; DESCRIPTION="Quality gate status unknown" ;;
esac

TARGET_URL="${SONAR_URL}/dashboard?id=${SONAR_PROJECT_KEY}"

curl -sf -X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Content-Type: application/json" \
-d "{\"state\":\"${GH_STATE}\",\"description\":\"${DESCRIPTION}\",\"context\":\"sonarqube/quality-gate\",\"target_url\":\"${TARGET_URL}\"}" \
"https://api.github.com/repos/splitio/${GITHUB_REPO}/statuses/${COMMIT_SHA}"

echo "Posted SonarQube quality gate status: ${GH_STATE}"
strategy:
matrix:
sdkVersion:
- "stable"
5 changes: 5 additions & 0 deletions splitio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 1.3.0-rc.1 (Sep 23, 2026)
* Added Swift Package Manager support, which becomes the default package manager for Flutter apps in Flutter 3.44. CocoaPods remains fully supported.
* Updated the minimum supported iOS version to 12.

# 1.2.1 (Jan 28, 2026)
* Bug fix: corrected asset path for loading the Browser SDK.

Expand Down
3 changes: 3 additions & 0 deletions splitio/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Swift Package Manager (resolved locally by Xcode / Flutter)
**/xcshareddata/swiftpm/
1 change: 1 addition & 0 deletions splitio/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'dev.flutter.flutter-gradle-plugin'
}

Expand Down
2 changes: 2 additions & 0 deletions splitio/example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
android.builtInKotlin=false
android.newDsl=false
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
3 changes: 2 additions & 1 deletion splitio/example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
id "com.android.application" version "8.4.0" apply false
id "com.android.application" version "8.11.1" apply false
id "org.jetbrains.kotlin.android" version "2.2.20" apply false
}

include ":app"
4 changes: 2 additions & 2 deletions splitio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: splitio
description: Official plugin for split.io, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience.
version: 1.2.1
version: 1.3.0-rc.1
homepage: https://split.io/
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio/

Expand All @@ -22,7 +22,7 @@ dependencies:
flutter:
sdk: flutter
splitio_android: ^1.1.0
splitio_ios: ^1.1.0
splitio_ios: ^1.2.0-rc.1
splitio_web: ^1.1.1
splitio_platform_interface: ^2.1.0
dev_dependencies:
Expand Down
5 changes: 5 additions & 0 deletions splitio_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 1.2.0-rc.1 (Sep 23, 2026)
* Added Swift Package Manager support, which becomes the default package manager for Flutter apps in Flutter 3.44. CocoaPods remains fully supported.
* Updated the minimum supported iOS version to 12.

# 1.1.0 (Jan 28, 2026)
* Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
* Updated iOS SDK to `3.6.0`.
Expand Down
3 changes: 3 additions & 0 deletions splitio_ios/example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Swift Package Manager (resolved locally by Xcode / Flutter)
**/xcshareddata/swiftpm/
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import XCTest
import Flutter
@testable import splitio_ios
@testable import Split

Expand Down
18 changes: 18 additions & 0 deletions splitio_ios/example/ios/SplitTests/SplitTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import XCTest
import Flutter
@testable import splitio_ios
@testable import Split

Expand Down Expand Up @@ -593,12 +594,29 @@ class SplitManagerStub: SplitManager, Destroyable {
}
}

private final class BinaryMessengerStub: NSObject, FlutterBinaryMessenger {
func send(onChannel channel: String, message: Data?) {}
func send(onChannel channel: String, message: Data?, binaryReply callback: FlutterBinaryReply?) {}
func setMessageHandlerOnChannel(_ channel: String, binaryMessageHandler handler: FlutterBinaryMessageHandler?) -> FlutterBinaryMessengerConnection { 0 }
func cleanUpConnection(_ connection: FlutterBinaryMessengerConnection) {}
}

class MethodChannelStub: FlutterMethodChannel {
var methodName: String = ""
var arguments: Any?

init(name: String = "splitio.test") {
super.init(name: name, binaryMessenger: BinaryMessengerStub(), codec: FlutterStandardMethodCodec.sharedInstance(), taskQueue: nil)
}

override func invokeMethod(_ method: String, arguments: Any?) {
self.methodName = method
self.arguments = arguments
}

override func invokeMethod(_ method: String, arguments: Any?, result callback: FlutterResult?) {
self.methodName = method
self.arguments = arguments
callback?(nil)
}
}
7 changes: 6 additions & 1 deletion splitio_ios/ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ Icon?

/Flutter/Generated.xcconfig
/Flutter/ephemeral/
/Flutter/flutter_export_environment.sh
/Flutter/flutter_export_environment.sh

# Swift Package Manager
.build/
.swiftpm/
Package.resolved
Empty file removed splitio_ios/ios/Assets/.gitkeep
Empty file.
4 changes: 0 additions & 4 deletions splitio_ios/ios/Classes/SplitioPlugin.h

This file was deleted.

Loading
Loading