Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
859df60
Add flagSets constructor to SplitSyncConfig
gthea Nov 2, 2023
1126d81
Add to SplitConfiguration
gthea Nov 2, 2023
d31b9f7
New evaluation methods in platform
gthea Nov 2, 2023
34da305
Change toString implementation of split_result
gthea Nov 2, 2023
3b0e582
defaultTreatment in SplitView
gthea Nov 2, 2023
f8a5060
Add sets to SplitView
gthea Nov 2, 2023
9e32952
Revert
gthea Nov 2, 2023
5973f3b
Update SplitResult.toString to display null values differently (#88)
vincevargadev Nov 2, 2023
c91c179
Add flagSets constructor to SplitSyncConfig (#89)
gthea Nov 3, 2023
05868d9
New evaluation methods in platform (#90)
gthea Nov 3, 2023
ee2997a
SplitView new properties (#91)
gthea Nov 3, 2023
bec7cc7
Dev pubspec
gthea Nov 3, 2023
d3eeae5
New evaluation methods in SplitClient
gthea Nov 3, 2023
6fd9433
Update android-client to 3.4.0
gthea Nov 3, 2023
84aa0c3
Evaluation & config in Android
gthea Nov 3, 2023
8e7c44b
New evaluation methods in SplitClient (#92)
gthea Nov 7, 2023
4e3e16b
Android implementation (#93)
gthea Nov 7, 2023
f2c04c5
iOS evaluation methods & config
gthea Nov 7, 2023
53025df
Podfile
gthea Nov 7, 2023
4a7c39b
New method parsing for Android
gthea Nov 7, 2023
f2ec3e9
refactor'
gthea Nov 7, 2023
c7beb5a
Minor fix
gthea Nov 7, 2023
74e5a50
Fix test
gthea Nov 7, 2023
42d7677
iOS evaluation methods & config
gthea Nov 7, 2023
59ed4fa
Podfile
gthea Nov 7, 2023
5d0ef4b
New methods parsing in Android (#95)
gthea Nov 7, 2023
9d1fe13
New methods parsing in iOS; new fields in SplitView
gthea Nov 8, 2023
d54592b
Merge branch 'sets_7' of github.com:splitio/flutter-sdk-plugin into s…
gthea Nov 8, 2023
2dc062a
Merge branch 'sets_7' into sets_8
gthea Nov 8, 2023
26adc98
Add missing platform tests
gthea Nov 8, 2023
7e0c2a2
Fix tests
gthea Nov 8, 2023
d1b1744
Missing tests
gthea Nov 8, 2023
10d9e40
Merge branch 'sets_8' into sets_9
gthea Nov 8, 2023
3a37130
Fix
gthea Nov 8, 2023
681dd0d
Merge branch 'sets_7' into sets_8
gthea Nov 8, 2023
4f784e3
Merge branch 'sets_8' into sets_9
gthea Nov 8, 2023
c4a99de
Fix test
gthea Nov 8, 2023
df76a6f
Merge branch 'sets_7' into sets_8
gthea Nov 8, 2023
f3c5a64
Merge branch 'sets_8' into sets_9
gthea Nov 8, 2023
c68f260
New config and methods for iOS (#96)
gthea Nov 8, 2023
d23fd6a
Retrigger checks
gthea Nov 8, 2023
9d2e89e
New methods parsing in iOS (#97)
gthea Nov 8, 2023
b682f6c
Retrigger checks
gthea Nov 8, 2023
e903cb6
Add missing platform tests (#98)
gthea Nov 8, 2023
7755003
Merge branch 'development' into sets_baseline
gthea Nov 8, 2023
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
12 changes: 0 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ jobs:
- name: Run Android test
run: cd splitio/example/android/; ./gradlew :splitio:testReleaseUnitTest;

build-ios:
name: Build iOS
runs-on: [ macos-latest ]

steps:
- uses: actions/[email protected]
- uses: subosito/[email protected]
with:
channel: 'stable'
- name: Run Build iOS
run: cd splitio/example/ios; flutter build ios --no-codesign;

test-ios:
name: Test iOS
runs-on: [ macos-latest ]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ jobs:
run: cd splitio/; flutter pub get
- name: Run flutter test
run: cd splitio/; flutter test
- name: Run flutter splitio_android test
run: cd splitio_android/; flutter test
- name: Run flutter splitio_ios test
run: cd splitio_ios/; flutter test
8 changes: 4 additions & 4 deletions splitio/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -150,28 +150,28 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.6-rc.1"
version: "0.1.6"
splitio_android:
dependency: transitive
description:
path: "../../splitio_android"
relative: true
source: path
version: "0.1.6-rc.1"
version: "0.1.6"
splitio_ios:
dependency: transitive
description:
path: "../../splitio_ios"
relative: true
source: path
version: "0.1.6-rc.1"
version: "0.1.6"
splitio_platform_interface:
dependency: transitive
description:
path: "../../splitio_platform_interface"
relative: true
source: path
version: "1.3.0-rc.1"
version: "1.3.0"
stack_trace:
dependency: transitive
description:
Expand Down
76 changes: 76 additions & 0 deletions splitio/lib/split_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,46 @@ abstract class SplitClient {
Future<Map<String, String>> getTreatments(List<String> featureFlagNames,
[Map<String, dynamic> attributes = const {}]);

/// Convenience method to perform multiple evaluations by flag set. Returns a [Map] in
/// which the keys are feature flag names and the values are treatments.
///
/// A flag set needs to be specified in [flagSet].
///
/// Optionally, a [Map] can be specified with the [attributes] parameter to
/// take into account when evaluating.
Future<Map<String, String>> getTreatmentsByFlagSet(String flagSet,
[Map<String, dynamic> attributes = const {}]);

/// Convenience method to perform multiple evaluations by flag sets. Returns a [Map] in
/// which the keys are feature flag names and the values are treatments.
///
/// A list of flag sets needs to be specified in [flagSets].
///
/// Optionally, a [Map] can be specified with the [attributes] parameter to
/// take into account when evaluating.
Future<Map<String, String>> getTreatmentsByFlagSets(List<String> flagSets,
[Map<String, dynamic> attributes = const {}]);

/// Convenience method to perform multiple evaluations by flag set. Returns a [Map] in
/// which the keys are feature flag names and the values are [SplitResult] objects.
///
/// A flag set needs to be specified in [flagSet].
///
/// Optionally, a [Map] can be specified with the [attributes] parameter to
/// take into account when evaluating.
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSet(String flagSet,
[Map<String, dynamic> attributes = const {}]);

/// Convenience method to perform multiple evaluations by flag sets. Returns a [Map] in
/// which the keys are feature flag names and the values are [SplitResult] objects.
///
/// A list of flag sets needs to be specified in [flagSets].
///
/// Optionally, a [Map] can be specified with the [attributes] parameter to
/// take into account when evaluating.
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSets(List<String> flagSets,
[Map<String, dynamic> attributes = const {}]);

/// Convenience method to perform multiple evaluations. Returns a [Map] in
/// which the keys are feature flag names and the values are [SplitResult] objects.
///
Expand Down Expand Up @@ -185,6 +225,42 @@ class DefaultSplitClient implements SplitClient {
attributes: attributes);
}

@override
Future<Map<String, String>> getTreatmentsByFlagSet(String flagSet, [Map<String, dynamic> attributes = const {}]) {
return _platform.getTreatmentsByFlagSet(
matchingKey: _matchingKey,
bucketingKey: _bucketingKey,
flagSet: flagSet,
attributes: attributes);
}

@override
Future<Map<String, String>> getTreatmentsByFlagSets(List<String> flagSets, [Map<String, dynamic> attributes = const {}]) {
return _platform.getTreatmentsByFlagSets(
matchingKey: _matchingKey,
bucketingKey: _bucketingKey,
flagSets: flagSets,
attributes: attributes);
}

@override
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSet(String flagSet, [Map<String, dynamic> attributes = const {}]) {
return _platform.getTreatmentsWithConfigByFlagSet(
matchingKey: _matchingKey,
bucketingKey: _bucketingKey,
flagSet: flagSet,
attributes: attributes);
}

@override
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSets(List<String> flagSets, [Map<String, dynamic> attributes = const {}]) {
return _platform.getTreatmentsWithConfigByFlagSets(
matchingKey: _matchingKey,
bucketingKey: _bucketingKey,
flagSets: flagSets,
attributes: attributes);
}

@override
Future<bool> track(String eventType,
{String? trafficType,
Expand Down
9 changes: 6 additions & 3 deletions splitio/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ flutter:
dependencies:
flutter:
sdk: flutter
splitio_android: ^0.1.6
splitio_ios: ^0.1.6
splitio_platform_interface: ^1.3.0
splitio_android: #^0.1.6
path: ../splitio_android
splitio_ios: #^0.1.6
path: ../splitio_ios
splitio_platform_interface: #^1.3.0
path: ../splitio_platform_interface

dev_dependencies:
flutter_test:
Expand Down
112 changes: 112 additions & 0 deletions splitio/test/splitio_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,118 @@ void main() {
'attributes': {'attr1': true}
});
});

test('getTreatmentsByFlagSet without attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsByFlagSet('set_1');

expect(_platform.methodName, 'getTreatmentsByFlagSet');
expect(_platform.methodArguments, {
'flagSet': 'set_1',
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {}
});
});

test('getTreatmentsByFlagSet with attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsByFlagSet('set_1', {'attr1': true});

expect(_platform.methodName, 'getTreatmentsByFlagSet');
expect(_platform.methodArguments, {
'flagSet': 'set_1',
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {'attr1': true}
});
});

test('getTreatmentsByFlagSets without attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsByFlagSets(['set_1', 'set_2']);

expect(_platform.methodName, 'getTreatmentsByFlagSets');
expect(_platform.methodArguments, {
'flagSets': ['set_1', 'set_2'],
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {}
});
});

test('getTreatmentsByFlagSets with attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsByFlagSets(['set_1', 'set_2'], {'attr1': true});

expect(_platform.methodName, 'getTreatmentsByFlagSets');
expect(_platform.methodArguments, {
'flagSets': ['set_1', 'set_2'],
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {'attr1': true}
});
});

test('getTreatmentsWithConfigByFlagSet without attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsWithConfigByFlagSet('set_1');

expect(_platform.methodName, 'getTreatmentsWithConfigByFlagSet');
expect(_platform.methodArguments, {
'flagSet': 'set_1',
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {}
});
});

test('getTreatmentsWithConfigByFlagSet with attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsWithConfigByFlagSet('set_1', {'attr1': true});

expect(_platform.methodName, 'getTreatmentsWithConfigByFlagSet');
expect(_platform.methodArguments, {
'flagSet': 'set_1',
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {'attr1': true}
});
});

test('getTreatmentsWithConfigByFlagSets without attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsWithConfigByFlagSets(['set_1', 'set_2']);

expect(_platform.methodName, 'getTreatmentsWithConfigByFlagSets');
expect(_platform.methodArguments, {
'flagSets': ['set_1', 'set_2'],
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {}
});
});

test('getTreatmentsWithConfigByFlagSets with attributes', () async {
SplitClient client = _getClient();

client.getTreatmentsWithConfigByFlagSets(['set_1', 'set_2'], {'attr1': true});

expect(_platform.methodName, 'getTreatmentsWithConfigByFlagSets');
expect(_platform.methodArguments, {
'flagSets': ['set_1', 'set_2'],
'matchingKey': 'matching-key',
'bucketingKey': 'bucketing-key',
'attributes': {'attr1': true}
});
});
});

group('track', () {
Expand Down
72 changes: 72 additions & 0 deletions splitio/test/splitio_platform_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,78 @@ class SplitioPlatformStub
return Future.value({});
}

@override
Future<Map<String, String>> getTreatmentsByFlagSet(
{required String matchingKey,
required String? bucketingKey,
required String flagSet,
Map<String, dynamic> attributes = const {}}) {
methodName = 'getTreatmentsByFlagSet';

methodArguments = {
'matchingKey': matchingKey,
'bucketingKey': bucketingKey,
'flagSet': flagSet,
'attributes': attributes,
};

return Future.value({});
}

@override
Future<Map<String, String>> getTreatmentsByFlagSets(
{required String matchingKey,
required String? bucketingKey,
required List<String> flagSets,
Map<String, dynamic> attributes = const {}}) {
methodName = 'getTreatmentsByFlagSets';

methodArguments = {
'matchingKey': matchingKey,
'bucketingKey': bucketingKey,
'flagSets': flagSets,
'attributes': attributes,
};

return Future.value({});
}

@override
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSet(
{required String matchingKey,
required String? bucketingKey,
required String flagSet,
Map<String, dynamic> attributes = const {}}) {
methodName = 'getTreatmentsWithConfigByFlagSet';

methodArguments = {
'matchingKey': matchingKey,
'bucketingKey': bucketingKey,
'flagSet': flagSet,
'attributes': attributes,
};

return Future.value({});
}

@override
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSets(
{required String matchingKey,
required String? bucketingKey,
required List<String> flagSets,
Map<String, dynamic> attributes = const {}}) {
methodName = 'getTreatmentsWithConfigByFlagSets';

methodArguments = {
'matchingKey': matchingKey,
'bucketingKey': bucketingKey,
'flagSets': flagSets,
'attributes': attributes,
};

return Future.value({});
}

@override
Stream<Impression> impressionsStream() {
methodName = 'impressionsStream';
Expand Down
6 changes: 3 additions & 3 deletions splitio_android/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 31
compileSdk 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
minSdkVersion 16
minSdk 16

consumerProguardFiles 'split-proguard-rules.pro'
}

dependencies {
implementation 'io.split.client:android-client:3.3.0'
implementation 'io.split.client:android-client:3.4.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.13'

testImplementation 'junit:junit:4.13.2'
Expand Down
Loading