@mentra/bluetooth-sdk 3.4.0-dev.1034 → 3.4.0-dev.1037

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -865,10 +865,28 @@ MentraOS repo root:
865
865
  ./scripts/check-android-compile.sh bluetooth-sdk
866
866
  ```
867
867
 
868
- The `android/` folder in this package is source for the generated Expo Android
869
- project, not the local Gradle entrypoint. The check script prepares
870
- `mobile/android` and uses its Gradle wrapper with `-PmentraPublicSdk=true`,
871
- matching the CI release workflow's public SDK dependency mode.
868
+ The check script prepares `mobile/android` and uses its Gradle wrapper with
869
+ `-PmentraPublicSdk=true`, matching the CI release workflow's public SDK
870
+ dependency mode. Inside an Expo app, the `android/` folder in this package is
871
+ included by autolinking as `:mentra-bluetooth-sdk`.
872
+
873
+ A plain Android app can also build the native SDK from a MentraOS checkout,
874
+ without publishing it to Maven local, through a Gradle composite build. In the
875
+ app's `settings.gradle.kts`:
876
+
877
+ ```kotlin
878
+ includeBuild("/path/to/MentraOS/mobile/modules/bluetooth-sdk/android") {
879
+ dependencySubstitution {
880
+ substitute(module("com.mentraglass:bluetooth-sdk")).using(project(":"))
881
+ }
882
+ }
883
+ ```
884
+
885
+ The app keeps its `com.mentraglass:bluetooth-sdk` dependency; Gradle replaces it
886
+ with the source build. This standalone build has the same dependencies as the
887
+ Maven Central artifact (`-PmentraPublicSdk=true` is its default) and leaves out
888
+ the Expo adapter classes, which need an Expo host. It needs the Android NDK for
889
+ `lc3Lib`.
872
890
 
873
891
  For bare native iOS or macOS apps, use the public SwiftPM repository:
874
892
 
@@ -8,7 +8,14 @@ apply plugin: 'signing'
8
8
  def packageJson = new JsonSlurper().parse(file("../package.json"))
9
9
  def mavenGroupId = 'com.mentraglass'
10
10
  def mavenPublishVersion = (findProperty('mentraMavenVersion') ?: System.getenv('MENTRA_MAVEN_VERSION') ?: packageJson.version).toString()
11
- def publicMavenSdk = (findProperty('mentraPublicSdk') ?: System.getenv('MENTRA_PUBLIC_SDK') ?: 'false').toString().toBoolean()
11
+ // Inside an Expo host such as the MentraOS app, autolinking provides
12
+ // :expo-modules-core. Without it, this directory is the root of a standalone
13
+ // build (settings.gradle), for example a composite build in a plain Android app.
14
+ // expo-modules-core has no prebuilt Android artifact to resolve instead, so a
15
+ // standalone build leaves out the Expo adapter classes and defaults to the
16
+ // public Maven artifact's dependency shape.
17
+ def standaloneBuild = findProject(':expo-modules-core') == null
18
+ def publicMavenSdk = (findProperty('mentraPublicSdk') ?: System.getenv('MENTRA_PUBLIC_SDK') ?: standaloneBuild.toString()).toString().toBoolean()
12
19
 
13
20
  // Download Sherpa-ONNX Android AAR from the upstream GitHub release and stage
14
21
  // it as a Maven artifact in a tiny on-disk repository under libs/maven/.
@@ -181,10 +188,35 @@ gradle.taskGraph.whenReady {
181
188
  }
182
189
  }
183
190
 
184
- def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
185
- apply from: expoModulesCorePlugin
186
- applyKotlinExpoModulesCorePlugin()
187
- useExpoPublishing()
191
+ if (standaloneBuild) {
192
+ apply plugin: 'kotlin-android'
193
+ // Java 17 bytecode, as in the MentraOS app build.
194
+ android {
195
+ compileOptions {
196
+ sourceCompatibility JavaVersion.VERSION_17
197
+ targetCompatibility JavaVersion.VERSION_17
198
+ }
199
+ }
200
+ kotlin {
201
+ compilerOptions {
202
+ jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
203
+ }
204
+ }
205
+ // Expo adapters, compiled only inside an Expo host (see expo-module.config.json).
206
+ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
207
+ exclude(
208
+ '**/com/mentra/bluetoothsdk/BluetoothSdkModule.kt',
209
+ '**/com/mentra/bluetoothsdk/MentraLocalNetworkModule.kt',
210
+ '**/com/mentra/bluetoothsdk/otaserver/MentraOtaServerModule.kt',
211
+ '**/com/mentra/bluetoothsdk/photoreceiver/MentraPhotoReceiverModule.kt'
212
+ )
213
+ }
214
+ } else {
215
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
216
+ apply from: expoModulesCorePlugin
217
+ applyKotlinExpoModulesCorePlugin()
218
+ useExpoPublishing()
219
+ }
188
220
 
189
221
  // Hosts that embed @mentra/crust compile with Kotlin 2.3 (its QuickJS library
190
222
  // requires it). Keep the public Maven artifact usable from Kotlin 2.1 builds:
@@ -225,6 +257,9 @@ if (useManagedAndroidSdkVersions) {
225
257
 
226
258
  android {
227
259
  namespace "com.mentra.bluetoothsdk"
260
+ buildFeatures {
261
+ buildConfig true
262
+ }
228
263
  defaultConfig {
229
264
  versionCode 1
230
265
  versionName project.version
@@ -255,7 +290,9 @@ android {
255
290
  dependencies {
256
291
  // Expo adapter class is compiled into the MentraOS module, but the bare SDK
257
292
  // artifact should not expose Expo as a runtime dependency.
258
- compileOnly project(':expo-modules-core')
293
+ if (!standaloneBuild) {
294
+ compileOnly project(':expo-modules-core')
295
+ }
259
296
 
260
297
  // Kotlin standard library (explicitly added for IDE support)
261
298
  // Version is managed by Expo modules, but explicit dependency helps IDE indexing
@@ -0,0 +1,3 @@
1
+ # Used when this directory is the root of a standalone build (settings.gradle).
2
+ # Inside an Expo host, the host's own gradle.properties sets the same value.
3
+ android.useAndroidX=true
@@ -1,3 +1,50 @@
1
+ // Standalone build of the Bluetooth SDK's Android library, used when this
2
+ // directory is the root of a Gradle build: for example a plain Android app that
3
+ // consumes the SDK from source through a composite build,
4
+ // includeBuild("<MentraOS>/mobile/modules/bluetooth-sdk/android")
5
+ // with com.mentraglass:bluetooth-sdk substituted by project(":").
6
+ // The MentraOS app (an Expo host) ignores this file: Expo autolinking adds this
7
+ // directory as :mentra-bluetooth-sdk, and the SDK's config plugin adds :lc3Lib
8
+ // and :silero to the host's own settings.gradle.
9
+
10
+ gradle.rootProject { project ->
11
+ // Same versions as the MentraOS app's generated Android project. AGP refuses
12
+ // two versions in one composite build, so when this build is included in an
13
+ // app, use the AGP version on that app's root build classpath.
14
+ def androidGradlePluginVersion = '8.12.0'
15
+ def appGradle = gradle.parent
16
+ if (appGradle != null) {
17
+ try {
18
+ androidGradlePluginVersion = appGradle.rootProject.buildscript.classLoader
19
+ .loadClass('com.android.Version')
20
+ .getField('ANDROID_GRADLE_PLUGIN_VERSION')
21
+ .get(null)
22
+ } catch (ClassNotFoundException ignored) {
23
+ // The app does not load AGP in its root build; keep the default.
24
+ }
25
+ }
26
+
27
+ project.buildscript {
28
+ repositories {
29
+ google()
30
+ mavenCentral()
31
+ }
32
+ dependencies {
33
+ classpath "com.android.tools.build:gradle:${androidGradlePluginVersion}"
34
+ classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.0'
35
+ }
36
+ }
37
+ }
38
+
39
+ gradle.beforeProject { project ->
40
+ project.repositories {
41
+ google()
42
+ mavenCentral()
43
+ }
44
+ }
45
+
46
+ rootProject.name = 'mentra-bluetooth-sdk'
47
+
1
48
  include ':lc3Lib'
2
49
 
3
50
  include ':silero'
@@ -3,9 +3,9 @@ package com.mentra.bluetoothsdk
3
3
  /** Generated by release CI. Do not edit in a release checkout. */
4
4
  internal object GeneratedReleaseMetadata {
5
5
  const val FAMILY_BASE_VERSION: String = "3.4.0"
6
- const val RELEASE_IDENTITY: String = "3.4.0-dev.1034"
7
- const val RELEASE_SET_ID: String = "mentra-3.4.0-dev.1034"
8
- const val SOURCE_COMMIT: String = "a64689b75cf895b840c5ae10f659295e5e1043ef"
9
- const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1034.json"
10
- const val OTA_MANIFEST_SHA256: String = "1480354b3f6dba514b19f2f24218664ce9566cb986f1c9b37f4fddf5c0b6d28c"
6
+ const val RELEASE_IDENTITY: String = "3.4.0-dev.1037"
7
+ const val RELEASE_SET_ID: String = "mentra-3.4.0-dev.1037"
8
+ const val SOURCE_COMMIT: String = "e0ee6c124c1beef9a595dd99aef97393e20c6dc5"
9
+ const val OTA_MANIFEST_URL: String = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1037.json"
10
+ const val OTA_MANIFEST_SHA256: String = "d2891e0d82e167d9cc56c3279183ff91501d90aa6c089ca68c31633eb629c32b"
11
11
  }
@@ -1,10 +1,10 @@
1
1
  export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
2
2
  "schemaVersion": 1,
3
3
  "familyBaseVersion": "3.4.0",
4
- "releaseIdentity": "3.4.0-dev.1034",
5
- "releaseSetId": "mentra-3.4.0-dev.1034",
6
- "sourceCommit": "a64689b75cf895b840c5ae10f659295e5e1043ef",
7
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1034.json",
8
- "otaManifestSha256": "1480354b3f6dba514b19f2f24218664ce9566cb986f1c9b37f4fddf5c0b6d28c"
4
+ "releaseIdentity": "3.4.0-dev.1037",
5
+ "releaseSetId": "mentra-3.4.0-dev.1037",
6
+ "sourceCommit": "e0ee6c124c1beef9a595dd99aef97393e20c6dc5",
7
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1037.json",
8
+ "otaManifestSha256": "d2891e0d82e167d9cc56c3279183ff91501d90aa6c089ca68c31633eb629c32b"
9
9
  });
10
10
  //# sourceMappingURL=releaseMetadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.4.0\",\n \"releaseIdentity\": \"3.4.0-dev.1034\",\n \"releaseSetId\": \"mentra-3.4.0-dev.1034\",\n \"sourceCommit\": \"a64689b75cf895b840c5ae10f659295e5e1043ef\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1034.json\",\n \"otaManifestSha256\": \"1480354b3f6dba514b19f2f24218664ce9566cb986f1c9b37f4fddf5c0b6d28c\"\n})\n"]}
1
+ {"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,uBAAuB;IACvC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,kIAAkI;IACpJ,mBAAmB,EAAE,kEAAkE;CACxF,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"3.4.0\",\n \"releaseIdentity\": \"3.4.0-dev.1037\",\n \"releaseSetId\": \"mentra-3.4.0-dev.1037\",\n \"sourceCommit\": \"e0ee6c124c1beef9a595dd99aef97393e20c6dc5\",\n \"otaManifestUrl\": \"https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1037.json\",\n \"otaManifestSha256\": \"d2891e0d82e167d9cc56c3279183ff91501d90aa6c089ca68c31633eb629c32b\"\n})\n"]}
@@ -16,7 +16,7 @@ enum BluetoothSdkDefaults {
16
16
  /// silently disable it on every pair the app touches.
17
17
  static let autoPowerOffEnabled = false
18
18
  private static let infoSdkVersionKey = "MentraBluetoothSdkVersion"
19
- private static let swiftPackageSdkVersion = "3.4.0-dev.1034"
19
+ private static let swiftPackageSdkVersion = "3.4.0-dev.1037"
20
20
  private static let swiftPackageSdkVersionPlaceholder = "__MENTRA" + "_BLUETOOTH_SDK_VERSION__"
21
21
 
22
22
  private static func normalizedSdkVersion(_ value: String?) -> String? {
@@ -3,9 +3,9 @@ import Foundation
3
3
  /// Generated by release CI. Do not edit in a release checkout.
4
4
  enum GeneratedReleaseMetadata {
5
5
  static let familyBaseVersion = "3.4.0"
6
- static let releaseIdentity = "3.4.0-dev.1034"
7
- static let releaseSetId = "mentra-3.4.0-dev.1034"
8
- static let sourceCommit = "a64689b75cf895b840c5ae10f659295e5e1043ef"
9
- static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1034.json"
10
- static let otaManifestSha256 = "1480354b3f6dba514b19f2f24218664ce9566cb986f1c9b37f4fddf5c0b6d28c"
6
+ static let releaseIdentity = "3.4.0-dev.1037"
7
+ static let releaseSetId = "mentra-3.4.0-dev.1037"
8
+ static let sourceCommit = "e0ee6c124c1beef9a595dd99aef97393e20c6dc5"
9
+ static let otaManifestUrl = "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1037.json"
10
+ static let otaManifestSha256 = "d2891e0d82e167d9cc56c3279183ff91501d90aa6c089ca68c31633eb629c32b"
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/bluetooth-sdk",
3
- "version": "3.4.0-dev.1034",
3
+ "version": "3.4.0-dev.1037",
4
4
  "description": "SDK for communicating with smart glasses",
5
5
  "main": "build/index.js",
6
6
  "react-native": "src/index.ts",
@@ -115,7 +115,7 @@
115
115
  "registry": "https://registry.npmjs.org/"
116
116
  },
117
117
  "dependencies": {
118
- "@mentra/cloud-protocol": "3.4.0-dev.1034"
118
+ "@mentra/cloud-protocol": "3.4.0-dev.1037"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^25.9.3",
@@ -12,9 +12,9 @@ export interface BluetoothSdkReleaseMetadata {
12
12
  export const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({
13
13
  "schemaVersion": 1,
14
14
  "familyBaseVersion": "3.4.0",
15
- "releaseIdentity": "3.4.0-dev.1034",
16
- "releaseSetId": "mentra-3.4.0-dev.1034",
17
- "sourceCommit": "a64689b75cf895b840c5ae10f659295e5e1043ef",
18
- "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1034.json",
19
- "otaManifestSha256": "1480354b3f6dba514b19f2f24218664ce9566cb986f1c9b37f4fddf5c0b6d28c"
15
+ "releaseIdentity": "3.4.0-dev.1037",
16
+ "releaseSetId": "mentra-3.4.0-dev.1037",
17
+ "sourceCommit": "e0ee6c124c1beef9a595dd99aef97393e20c6dc5",
18
+ "otaManifestUrl": "https://artifactscdn.mentraglass.com/Mentra-Community/MentraOS/releases/mentra-builds-v3.4.0/mentra-live-ota-3.4.0-dev.1037.json",
19
+ "otaManifestSha256": "d2891e0d82e167d9cc56c3279183ff91501d90aa6c089ca68c31633eb629c32b"
20
20
  })