Skip to content

Commit

Permalink
feat!: update plugin to Capacitor 5
Browse files Browse the repository at this point in the history
  • Loading branch information
pwespi committed Apr 15, 2023
1 parent 9aad0ab commit 16822ac
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 208 deletions.
17 changes: 9 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
}

buildscript {
ext.kotlinVersion = project.hasProperty('kotlinVersion') ? rootProject.ext.kotlinVersion : '1.7.10'
ext.coreKtx = project.hasProperty('coreKtx') ? rootProject.ext.coreKtx : '1.8.0'
ext.kotlinVersion = project.hasProperty('kotlinVersion') ? rootProject.ext.kotlinVersion : '1.8.20'
ext.coreKtx = project.hasProperty('coreKtx') ? rootProject.ext.coreKtx : '1.9.0'

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:7.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
Expand All @@ -23,10 +23,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
namespace "com.capacitorjs.community.plugins.bluetoothle"
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 0 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.capacitorjs.community.plugins.bluetoothle">
xmlns:tools="http://schemas.android.com/tools">
<!-- Bluetooth -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class BluetoothLe : Plugin() {
@PluginMethod
fun getDevices(call: PluginCall) {
assertBluetoothAdapter(call) ?: return
val deviceIds = call.getArray("deviceIds").toList<String>()
val deviceIds = (call.getArray("deviceIds", JSArray()) as JSArray).toList<String>()
val bleDevices = JSArray()
deviceIds.forEach { deviceId ->
val bleDevice = JSObject()
Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Capacitor (4.7.3):
- Capacitor (5.0.0-nightly-20230414T150509.0):
- CapacitorCordova
- CapacitorCordova (4.7.3)
- CapacitorCordova (5.0.0-nightly-20230414T150509.0)

DEPENDENCIES:
- "Capacitor (from `../node_modules/@capacitor/ios`)"
Expand All @@ -14,8 +14,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@capacitor/ios"

SPEC CHECKSUMS:
Capacitor: 736ef58c1aff08d3142fe3be9c7d928e47ee461d
CapacitorCordova: e8ed29bd616c9f5a81498d47c0b84179b9c6a5a6
Capacitor: 246296a14c2a538127aa514266539b86051ff839
CapacitorCordova: 766abf0d9b054e76796d8b3d2cf6b7edd6dd4798

PODFILE CHECKSUM: 14e8b2400457751b865e1c327e7cfa1c6fa67da6

Expand Down
Loading

0 comments on commit 16822ac

Please sign in to comment.