diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e446f3..ea8b0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.1.7 + +- **Android:** Migrated from jcenter to mavenCentral +- **Android:** Updated Kotlin to 1.6.10 +- **Android:** Updated Gradle to 7.0.2 +- **Android:** Updated Gradle Build Tools to 7.0.4 + # 0.1.6 Remove TODO for onDetachedFromActivity method diff --git a/android/build.gradle b/android/build.gradle index 3fb573d..8829f85 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.homexlabs.optimizely_dart' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.72' + ext.kotlin_version = '1.6.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:7.0.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -17,7 +17,7 @@ buildscript { rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 01a286e..297f2fe 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/example/android/build.gradle b/example/android/build.gradle index 59baba0..1743f09 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:7.0.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -14,7 +14,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index d8e25aa..d514ba2 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -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-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 64b2dec..42e5561 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -155,7 +155,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140c..3db53b6 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { Future getPriceFilterFlag() async { String priceFilterFlag; // Platform messages may fail, so we use a try/catch PlatformException. - var platform = - Theme.of(context).platform.toString().split('.')[1].toLowerCase(); try { bool? featureEnabled = await optimizelyPlugin.isFeatureEnabled( 'price_filter', @@ -69,8 +67,6 @@ class _MyAppState extends State { Future getPriceFilterMinPrice() async { String minPriceVariable; Map variables; - var platform = - Theme.of(context).platform.toString().split('.')[1].toLowerCase(); try { variables = await optimizelyPlugin.getAllFeatureVariables( 'price_filter', diff --git a/pubspec.yaml b/pubspec.yaml index 39a23a2..d8be059 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: optimizely_dart description: Flutter plugin for Optimizely native SDKs. Check feature flags and feature variables from your Optimizely project. -version: 0.1.6 +version: 0.1.7 homepage: https://github.com/HomeXLabs/optimizely-dart repository: https://github.com/HomeXLabs/optimizely-dart diff --git a/test/optimizely_dart_test.dart b/test/optimizely_dart_test.dart index f6330b4..53527e6 100644 --- a/test/optimizely_dart_test.dart +++ b/test/optimizely_dart_test.dart @@ -14,24 +14,14 @@ void main() { break; case 'isFeatureEnabled': var featureKey = methodCall.arguments['feature_key']; - var userId = methodCall.arguments['user_id']; - if (userId == 'user@pg.com' && featureKey == 'flutter') { + if (featureKey == 'flutter') { return true; } return false; case 'getAllFeatureVariables': var featureKey = methodCall.arguments['feature_key']; - var userId = methodCall.arguments['user_id']; - var attributes = methodCall.arguments['attributes']; - if (featureKey == 'calculator' && userId == 'user@pg.com') { - switch (attributes['platform']) { - case 'ios': - return {'calc_type': 'scientific'}; - case 'android': - return {'calc_type': 'basic'}; - default: - return {}; - } + if (featureKey == 'calculator') { + return {'calc_type': 'scientific'}; } return {}; default: @@ -60,28 +50,14 @@ void main() { final optimizelyPlugin = OptimizelyPlugin(); final enabled = await optimizelyPlugin.isFeatureEnabled( 'flutter', - 'user@pg.com', - {'platform': 'android'}, ); expect(enabled, true); }); - test('getAllFeatureVariablesAndroid', () async { + test('getAllFeatureVariables', () async { final optimizelyPlugin = OptimizelyPlugin(); var features = await optimizelyPlugin.getAllFeatureVariables( 'calculator', - 'user@pg.com', - {'platform': 'android'}, - ); - expect(features['calc_type'], 'basic'); - }); - - test('getAllFeatureVariablesApple', () async { - final optimizelyPlugin = OptimizelyPlugin(); - var features = await optimizelyPlugin.getAllFeatureVariables( - 'calculator', - 'user@pg.com', - {'platform': 'ios'}, ); expect(features['calc_type'], 'scientific'); });