Skip to content

Commit

Permalink
Merge pull request #225 from PhilipsHue/upgrade-null-safety-to-latest…
Browse files Browse the repository at this point in the history
…-flutter-stable

Upgrade null safety to latest flutter stable
  • Loading branch information
remonh87 authored Feb 13, 2021
2 parents fe23380 + bfbce72 commit 4c1c21a
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 61 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Main releases
## 2.7.3

* Upgrade Android dependencies to comply to newer Gradle distributions.

## 2.7.2

* Fix #188 `subscribeToCharacteristic` fails when characteristic config descriptor is not present.
* Fix #195 `scanFailure` when using backgroundmode messaging Firebase.

## 2.7.1

* Fix #115 by updating to new protobuf lite on Android.
Expand Down Expand Up @@ -116,6 +125,6 @@ Other improvements:

# Null safety

## 1.0.0-nullsafety.0
## 3.0.0-nullsafety.0

* Initial migration
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version '1.0-SNAPSHOT'

buildscript {
ext.detekt_version = '1.14.1'
ext.kotlin_version = '1.4.10'
ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()
Expand All @@ -13,11 +13,11 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.13'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detekt_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.3.2.0"
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.0.0"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class ScanDevicesHandler(private val bleClient: com.signify.hue.flutterreactiveb
private var scanDevicesSink: EventChannel.EventSink? = null
private lateinit var scanForDevicesDisposable: Disposable
private val converter = ProtobufMessageConverter()
private var scanParameters: ScanParameters? = null

companion object {
private var scanParameters: ScanParameters? = null
}

override fun onListen(objectSink: Any?, eventSink: EventChannel.EventSink?) {
eventSink?.let {
Expand Down Expand Up @@ -51,7 +54,7 @@ class ScanDevicesHandler(private val bleClient: com.signify.hue.flutterreactiveb
it.dispose()
scanParameters = null
}
}
}
}

fun prepareScan(scanMessage: pb.ScanForDevicesRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,8 @@ class ProtobufMessageConverter {
}

private fun createUuidFromParcelUuid(uuid: UUID): pb.Uuid {

val convertedUuid = uuidConverter.byteArrayFromUuid(uuid)
val byteArray = byteArrayOf(convertedUuid[positionMostSignificantBit],
convertedUuid[positionLeastSignificantBit])
return pb.Uuid.newBuilder().setData(ByteString.copyFrom(byteArray)).build()

return pb.Uuid.newBuilder().setData(ByteString.copyFrom(convertedUuid)).build()
}
}
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion 30

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.4.10'
ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
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-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"

Expand Down
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_reactive_ble/ios"

SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_reactive_ble: 118af63a7cda4e26ae1791bd1ddf659e2ae0a76d
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_reactive_ble: ac0ccac596f481b221549cad2abe16987e1f411b
Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748
SwiftProtobuf: 4ef85479c18ca85b5482b343df9c319c62bda699

PODFILE CHECKSUM: fe0e1ee7f3d1f7d00b11b474b62dd62134535aea
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.9.3
COCOAPODS: 1.10.0
2 changes: 0 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,12 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
"${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework",
"${BUILT_PRODUCTS_DIR}/flutter_reactive_ble/flutter_reactive_ble.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_reactive_ble.framework",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 19 additions & 19 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.3"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
build_config:
dependency: transitive
description:
Expand All @@ -35,14 +35,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.5"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
checked_yaml:
dependency: transitive
description:
Expand All @@ -56,14 +56,14 @@ packages:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.5"
version: "1.15.0"
dependency_validator:
dependency: "direct dev"
description:
Expand All @@ -77,7 +77,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
file:
dependency: transitive
description:
Expand All @@ -103,7 +103,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0-nullsafety.0"
version: "3.0.0-nullsafety.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -157,14 +157,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.3"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.6"
version: "1.3.0"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -199,7 +199,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
version: "1.8.0"
pedantic:
dependency: transitive
description:
Expand Down Expand Up @@ -253,56 +253,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.4"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.6"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.6"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.5"
version: "2.1.0"
yaml:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_reactive_ble_example
description: Demonstrates how to use the flutter_reactive_ble plugin.
version: 1.0.0-nullsafety.0
version: 3.0.0-nullsafety.0
publish_to: 'none'

environment:
Expand Down
Loading

0 comments on commit 4c1c21a

Please sign in to comment.