From 3af628a8278c8ec338656d09ae1abc0c7c225b8c Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 22 Dec 2023 15:30:12 -0800 Subject: [PATCH 1/2] java upgrades --- README.md | 4 +- binding/ios/README.md | 3 +- demo/android/LeopardDemo/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../LeopardDemo/leopard-demo-app/build.gradle | 7 +- .../src/main/AndroidManifest.xml | 3 +- demo/flutter/android/app/build.gradle | 4 +- demo/flutter/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- demo/flutter/pubspec.lock | 196 ++++++++++-------- demo/react-native/android/build.gradle | 10 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../android/leopard-rn-demo-app/build.gradle | 7 - .../src/main/AndroidManifest.xml | 3 +- 14 files changed, 135 insertions(+), 116 deletions(-) diff --git a/README.md b/README.md index 499d0616..c8e50f33 100644 --- a/README.md +++ b/README.md @@ -362,9 +362,9 @@ Replace `${ACCESS_KEY}` with yours obtained from Picovoice Console, `${MODEL_FIL Finally, when done be sure to release resources acquired using `pv_leopard_delete(leopard)`. ### iOS - + The Leopard iOS binding is available via [CocoaPods](https://cocoapods.org/pods/Leopard-iOS). To import it into your iOS project, add the following line to your Podfile and run `pod install`: - + ```ruby pod 'Leopard-iOS' ``` diff --git a/binding/ios/README.md b/binding/ios/README.md index 545b39e4..ff7b6d60 100644 --- a/binding/ios/README.md +++ b/binding/ios/README.md @@ -17,8 +17,9 @@ Leopard is an on-device speech-to-text engine. Leopard is: ## Installation + The Leopard iOS binding is available via [CocoaPods](https://cocoapods.org/pods/Leopard-iOS). To import it into your iOS project, add the following line to your Podfile: - + ```ruby pod 'Leopard-iOS' ``` diff --git a/demo/android/LeopardDemo/build.gradle b/demo/android/LeopardDemo/build.gradle index d1001bd5..56f710be 100644 --- a/demo/android/LeopardDemo/build.gradle +++ b/demo/android/LeopardDemo/build.gradle @@ -8,7 +8,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.2' + classpath 'com.android.tools.build:gradle:7.4.2' } } @@ -19,6 +19,6 @@ allprojects { } } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/demo/android/LeopardDemo/gradle/wrapper/gradle-wrapper.properties b/demo/android/LeopardDemo/gradle/wrapper/gradle-wrapper.properties index 740ab489..3fadc5ca 100644 --- a/demo/android/LeopardDemo/gradle/wrapper/gradle-wrapper.properties +++ b/demo/android/LeopardDemo/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Jun 29 23:02:09 PDT 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/demo/android/LeopardDemo/leopard-demo-app/build.gradle b/demo/android/LeopardDemo/leopard-demo-app/build.gradle index a00cb2a7..a097c913 100644 --- a/demo/android/LeopardDemo/leopard-demo-app/build.gradle +++ b/demo/android/LeopardDemo/leopard-demo-app/build.gradle @@ -1,7 +1,9 @@ +import groovy.json.JsonSlurper + apply plugin: 'com.android.application' android { - compileSdkVersion defaultTargetSdkVersion + compileSdk defaultTargetSdkVersion defaultConfig { applicationId "ai.picovoice.leoparddemo" @@ -20,7 +22,7 @@ android { } def testDataFile = file('../../../../resources/.test/test_data.json') - def parsedJson = new groovy.json.JsonSlurper().parseText(testDataFile.text) + def parsedJson = new JsonSlurper().parseText(testDataFile.text) def languages = [] parsedJson.tests.parameters.each { a -> languages.add(a.language) @@ -63,6 +65,7 @@ android { lint { abortOnError false } + namespace 'ai.picovoice.leoparddemo' } dependencies { diff --git a/demo/android/LeopardDemo/leopard-demo-app/src/main/AndroidManifest.xml b/demo/android/LeopardDemo/leopard-demo-app/src/main/AndroidManifest.xml index da27a910..9f648ee8 100644 --- a/demo/android/LeopardDemo/leopard-demo-app/src/main/AndroidManifest.xml +++ b/demo/android/LeopardDemo/leopard-demo-app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/demo/flutter/android/app/build.gradle b/demo/flutter/android/app/build.gradle index 0f5d123f..45a90886 100644 --- a/demo/flutter/android/app/build.gradle +++ b/demo/flutter/android/app/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdk 33 lintOptions { disable 'InvalidPackage' @@ -35,7 +35,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "ai.picovoice.flutter.leoparddemo" minSdkVersion 21 - targetSdkVersion 31 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/demo/flutter/android/build.gradle b/demo/flutter/android/build.gradle index fab3c2e1..98811922 100644 --- a/demo/flutter/android/build.gradle +++ b/demo/flutter/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' + classpath 'com.android.tools.build:gradle:7.4.2' } } @@ -24,6 +24,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties b/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties index 4a757e6d..b5618a59 100644 --- a/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties +++ b/demo/flutter/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME \ No newline at end of file diff --git a/demo/flutter/pubspec.lock b/demo/flutter/pubspec.lock index 97334c8c..b48c3ef4 100644 --- a/demo/flutter/pubspec.lock +++ b/demo/flutter/pubspec.lock @@ -1,83 +1,70 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.6" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.15.0" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" + version: "1.18.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "13a6ccf6a459a125b3fcdb6ec73bd5ff90822e071207c663bfd1f70062d51d18" + url: "https://pub.dev" source: hosted version: "1.2.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -97,7 +84,8 @@ packages: dependency: "direct main" description: name: flutter_voice_processor - url: "https://pub.dartlang.org" + sha256: fb511a2f0ca9540c4b7c6715515389d27b5bbd332138ab3a300078fb243a0caf + url: "https://pub.dev" source: hosted version: "1.1.0" fuchsia_remote_debug_protocol: @@ -114,105 +102,128 @@ packages: dependency: "direct main" description: name: leopard_flutter - url: "https://pub.dartlang.org" + sha256: "64fc6ede6e7bf43c26eaf608c17f1a2bce87baddb1e200e6f3eff69c19ee014c" + url: "https://pub.dev" source: hosted version: "2.0.1" lints: dependency: "direct dev" description: name: lints - url: "https://pub.dartlang.org" + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" + source: hosted + version: "0.12.16" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.10.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: "050e8e85e4b7fecdf2bb3682c1c64c4887a183720c802d323de8a5fd76d372dd" + url: "https://pub.dev" source: hosted version: "2.0.11" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "4d5542667150f5b779ba411dd5dc0b674a85d1355e45bda2877e0e82f4ad08d8" + url: "https://pub.dev" source: hosted version: "2.0.20" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.dartlang.org" + sha256: "03d639406f5343478352433f00d3c4394d52dac8df3d847869c5e2333e0bbce8" + url: "https://pub.dev" source: hosted version: "2.0.11" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 + url: "https://pub.dev" source: hosted version: "2.1.7" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.dartlang.org" + sha256: "2a97e7fbb7ae9dcd0dfc1220a78e9ec3e71da691912e617e8715ff2a13086ae8" + url: "https://pub.dev" source: hosted version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "27dc7a224fcd07444cb5e0e60423ccacea3e13cf00fc5282ac2c918132da931d" + url: "https://pub.dev" source: hosted version: "2.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: a34ecd7fb548f8e57321fd8e50d865d266941b54e6c3b7758cf8f37c24116905 + url: "https://pub.dev" source: hosted version: "2.0.7" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + url: "https://pub.dev" source: hosted version: "2.1.3" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" sky_engine: @@ -224,93 +235,106 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.3" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.6.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "11.10.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "4658d864d83cdaedcbf3e65ad93b71880a3e8c9ee1ff15d855f88fb2da66cb8a" + url: "https://pub.dev" source: hosted version: "2.5.2" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: bd512f03919aac5f1313eb8249f223bacf4927031bf60b02601f81f687689e86 + url: "https://pub.dev" source: hosted version: "0.2.0+3" sdks: - dart: ">=2.15.0 <3.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.8.1" diff --git a/demo/react-native/android/build.gradle b/demo/react-native/android/build.gradle index c1d8954a..f44b9e41 100644 --- a/demo/react-native/android/build.gradle +++ b/demo/react-native/android/build.gradle @@ -2,19 +2,17 @@ buildscript { ext { - buildToolsVersion = "29.0.2" + buildToolsVersion = "30.0.3" minSdkVersion = 21 - compileSdkVersion = 30 - targetSdkVersion = 30 + compileSdkVersion = 33 + targetSdkVersion = 33 } repositories { google() jcenter() } dependencies { - classpath("com.android.tools.build:gradle:4.1.3") - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.android.tools.build:gradle:7.4.2' } } diff --git a/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties b/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties index 991f0739..4a8c4481 100644 --- a/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties +++ b/demo/react-native/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Nov 02 11:32:43 PDT 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/demo/react-native/android/leopard-rn-demo-app/build.gradle b/demo/react-native/android/leopard-rn-demo-app/build.gradle index 6d7283b0..60545a9e 100644 --- a/demo/react-native/android/leopard-rn-demo-app/build.gradle +++ b/demo/react-native/android/leopard-rn-demo-app/build.gradle @@ -209,11 +209,4 @@ dependencies { } } -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile - into 'libs' -} - apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/demo/react-native/android/leopard-rn-demo-app/src/main/AndroidManifest.xml b/demo/react-native/android/leopard-rn-demo-app/src/main/AndroidManifest.xml index 2a010112..2c23ca27 100644 --- a/demo/react-native/android/leopard-rn-demo-app/src/main/AndroidManifest.xml +++ b/demo/react-native/android/leopard-rn-demo-app/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + android:exported="true"> From 2e5673f9e0af1eff42f149f60aba7568613a47c0 Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 22 Dec 2023 15:41:10 -0800 Subject: [PATCH 2/2] add android demo action --- .github/workflows/android-demos.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/android-demos.yml diff --git a/.github/workflows/android-demos.yml b/.github/workflows/android-demos.yml new file mode 100644 index 00000000..8dbf29de --- /dev/null +++ b/.github/workflows/android-demos.yml @@ -0,0 +1,35 @@ +name: Android Demos + +on: + workflow_dispatch: + push: + branches: [ master ] + paths: + - '.github/workflows/android-demos.yml' + - 'demo/android/**' + - '!demo/android/LeopardDemo/README.md' + pull_request: + branches: [ master, 'v[0-9]+.[0-9]+' ] + paths: + - '.github/workflows/android-demos.yml' + - 'demo/android/**' + - '!demo/android/LeopardDemo/README.md' + +jobs: + build-leopard-demo: + runs-on: ubuntu-latest + defaults: + run: + working-directory: demo/android/LeopardDemo + + steps: + - uses: actions/checkout@v3 + + - name: set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build + run: ./gradlew assembleDebug \ No newline at end of file