Skip to content

Commit

Permalink
Documentation and dependencies upgrade (#252)
Browse files Browse the repository at this point in the history
* update plugin with Flutter 3.0 and Dart 2.17.0 and upgrade dependencies in pubspec.yaml

* move flutter_lints to dev dependencies

* update generated code

* Feat(example-app) added permissions requests

* update README.md to specify how to install plugin

* Feat(Nordic-SDK) upgrade Android SDK to v3.2.4

* upgrade gradle dependencies, update example app's Podfile and fix running it on simulator

* Feat(Nordic-SDK) upgrade iOS SDK to v3.2.0

* increment pkg's version and update CHANGELOG.md
  • Loading branch information
Nanodash authored Oct 16, 2022
1 parent aa9f7e4 commit 9e2b75b
Show file tree
Hide file tree
Showing 50 changed files with 755 additions and 636 deletions.
27 changes: 25 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: f7a6a7906be96d2288f5d63a5a54c515a6e987fe
revision: eb6d86ee27deecba4a83536aa20f366a6044895c
channel: stable

project_type: plugin

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: android
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
- platform: ios
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
2 changes: 1 addition & 1 deletion Android-nRF-Mesh-Library-1
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.13.0
- Use of Nordic Semiconductor's Android SDK v3.2.4
- Use of Nordic Semiconductor's iOS SDK v3.2.0 (iOS 12.0 required as a result)
- Upgraded Gradle version and dependencies
- Upgraded Dart dependencies
- Now need Flutter 3.0 to use plugin
- Updated example app to request needed permissions
- Updated README.md to explain how to install plugin
## 0.12.0

- Use of Nordic Semiconductor's Android SDK v3.2.1
Expand Down
2 changes: 1 addition & 1 deletion IOS-nRF-Mesh-Library
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ This plugin wraps both [IOS-nRF-Mesh-Library] and [Android-nRF-Mesh-Library] to

_(Note: the Bluetooth scanning and connecting features are done with [flutter_reactive_ble])_
# How to use
## Installation
### Plugin development :

- clone repository
- execute `git submodule update --init`

### Install in Flutter App :

##### Install plugin
- add `nordic_nrf_mesh` to your pubspec.yaml and execute `flutter pub get`
- go to `path/to/flutter/.pub-cache/hosted/pub.dartlang.org/nrf_mesh_plugin-<plugin_version>`
- execute `git submodule update --init`

##### Update build scripts
###### **Android**
- copy plugin's example app gradle script in [android/settings.gradle](https://github.com/OZEO-DOOZ/nrf_mesh_plugin/blob/master/example/android/settings.gradle#L13)
- paste it in your own app's file

###### **iOS**
- copy plugin's example Podfile script in [ios/Podfile](https://github.com/OZEO-DOOZ/nrf_mesh_plugin/blob/master/example/ios/Podfile#L33)
- paste it in your own app's file
## Initialization
To begin to use the plugin, one should instantiate the `NordicNrfMesh` instance like so :
```dart
Expand Down
4 changes: 3 additions & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
14 changes: 7 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'fr.dooz.nordic_nrf_mesh'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.6.20'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,21 +25,21 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 32
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 23
targetSdkVersion 32
targetSdkVersion 33
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
implementation 'com.google.code.gson:gson:2.8.9'
implementation "com.polidea.rxandroidble2:rxandroidble:1.12.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
implementation 'com.google.code.gson:gson:2.9.1'
implementation "com.polidea.rxandroidble2:rxandroidble:1.13.0"
implementation project(':mesh')
}
29 changes: 29 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion flutter.ndkVersion

kotlinOptions {
jvmTarget = '1.8'
Expand Down Expand Up @@ -59,5 +60,4 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation project(':mesh')
}
3 changes: 2 additions & 1 deletion example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.dooz.nordic_nrf_mesh_example">
<!-- Flutter needs it to communicate with the running application
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
Expand Down
3 changes: 2 additions & 1 deletion example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.dooz.nordic_nrf_mesh_example">
<!-- Flutter needs it to communicate with the running application
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
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.6.20'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
3 changes: 1 addition & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
8 changes: 7 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -39,5 +39,11 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_BLUETOOTH=1',
]
end
end
end
64 changes: 38 additions & 26 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
PODS:
- CryptoSwift (1.4.0)
- DKImagePickerController/Core (4.3.2):
- CryptoSwift (1.5.1)
- device_info_plus (0.0.1):
- Flutter
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.2)
- DKImagePickerController/PhotoGallery (4.3.2):
- DKImagePickerController/ImageDataManager (4.3.4)
- DKImagePickerController/PhotoGallery (4.3.4):
- DKImagePickerController/Core
- DKPhotoGallery
- DKImagePickerController/Resource (4.3.2)
- DKImagePickerController/Resource (4.3.4)
- DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.17)
Expand Down Expand Up @@ -35,27 +37,31 @@ PODS:
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- nordic_nrf_mesh (0.0.1):
- nordic_nrf_mesh (0.13.0):
- Flutter
- nRFMeshProvision
- nRFMeshProvision (3.1.4):
- CryptoSwift (= 1.4.0)
- Protobuf (3.19.1)
- nRFMeshProvision (3.2.0):
- CryptoSwift (= 1.5.1)
- permission_handler_apple (9.0.4):
- Flutter
- Protobuf (3.21.7)
- reactive_ble_mobile (0.0.1):
- Flutter
- Protobuf (~> 3.5)
- SwiftProtobuf (~> 1.0)
- SDWebImage (5.12.1):
- SDWebImage/Core (= 5.12.1)
- SDWebImage/Core (5.12.1)
- SwiftProtobuf (1.18.0)
- SwiftyGif (5.4.0)
- SDWebImage (5.13.4):
- SDWebImage/Core (= 5.13.4)
- SDWebImage/Core (5.13.4)
- SwiftProtobuf (1.20.2)
- SwiftyGif (5.4.3)

DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- nordic_nrf_mesh (from `.symlinks/plugins/nordic_nrf_mesh/ios`)
- nRFMeshProvision (from `.symlinks/plugins/nordic_nrf_mesh/IOS-nRF-Mesh-Library`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)

SPEC REPOS:
Expand All @@ -69,6 +75,8 @@ SPEC REPOS:
- SwiftyGif

EXTERNAL SOURCES:
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
Expand All @@ -77,23 +85,27 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/nordic_nrf_mesh/ios"
nRFMeshProvision:
:path: ".symlinks/plugins/nordic_nrf_mesh/IOS-nRF-Mesh-Library"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
reactive_ble_mobile:
:path: ".symlinks/plugins/reactive_ble_mobile/ios"

SPEC CHECKSUMS:
CryptoSwift: 7cc902df1784de3b389a387756c7d710f197730c
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
CryptoSwift: c4f2debceb38bf44c80659afe009f71e23e4a082
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
nordic_nrf_mesh: 5b37621fef90bc1b077bc9b34d3241b3622a0605
nRFMeshProvision: 4b3e185fd13b077c997aadca6f54806f5c577cd7
Protobuf: 3724efa50cb2846d7ccebc8691c574e85fd74471
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
nordic_nrf_mesh: 469eac5b312f1e29c2da8f0c7c85c8d576f823bd
nRFMeshProvision: 0f0a0b9e83e4a77bb4df1b7dfdb3838f526875d0
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
Protobuf: f4128517d7a42302e106cc3afe614ee3a7513e94
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b
SwiftProtobuf: c3c12645230d9b09c72267e0de89468c5543bd86
SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7
SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3
SwiftProtobuf: 9f458aaa7844a2fc0b910053e66578bc4e2da9c1
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780

PODFILE CHECKSUM: 72e7578d6c04ade70fdc134ccf7d38a693d97cd0
PODFILE CHECKSUM: 128b388d0d827f7e3f8a3286f565f4414fc370a7

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3
4 changes: 4 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
Loading

0 comments on commit 9e2b75b

Please sign in to comment.