Skip to content

Commit

Permalink
Fix USB Serial Depreciation error (#462)
Browse files Browse the repository at this point in the history
* use aar package for USB serial
  • Loading branch information
isha382 authored Nov 12, 2024
1 parent 1417476 commit 196ebb2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion android/comlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ apply from: 'download.gradle'

def googleWebrtcFile = file("${project.ext.LIB_DIR}/google-webrtc-1.0.32006.aar")
def wroupFile = file("${project.ext.LIB_DIR}/Wroup-master-release.aar")
def usbserialFile = file("${project.ext.LIB_DIR}/usbserial-6.1.0-release.aar")

// Task to check for AAR files
task checkAars {
dependsOn downloadAars // Ensure this matches the actual download task name

doLast {
if (!googleWebrtcFile.exists() || !wroupFile.exists()) {
if (!googleWebrtcFile.exists() || !wroupFile.exists() || !usbserialFile.exists()) {
throw new GradleException("Required AAR files are missing. Please run the download task.")
}
}
Expand All @@ -36,6 +37,10 @@ dependencies {
if (wroupFile.exists()) {
api files(wroupFile)
}

if (usbserialFile.exists()) {
api files(usbserialFile)
}
}

// Ensure that checkAars runs before any Java compile tasks
Expand Down
3 changes: 2 additions & 1 deletion android/comlib/download.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ task downloadAars(type: Download) {
src([
'https://storage.googleapis.com/openbot_aar/Wroup-master-release.aar',
'https://storage.googleapis.com/openbot_aar/google-webrtc-1.0.32006.aar',
'https://storage.googleapis.com/openbot_aar/usbserial-6.1.0-release.aar',
])
dest project.ext.LIB_DIR
onlyIfModified true
overwrite false
}
}
2 changes: 1 addition & 1 deletion android/robot/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'io.github.reactivecircus.app-versioning' version "1.1.2"
id 'com.google.gms.google-services'
id 'com.android.application'
}

appVersioning {
Expand Down Expand Up @@ -84,7 +85,6 @@ dependencies {

implementation "com.google.android.gms:play-services-location:$location_version"
implementation "com.google.android.gms:play-services-nearby:$nearby_version"
implementation 'com.github.felHR85:UsbSerial:6.1.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'org.zeroturnaround:zt-zip:1.14'
implementation 'com.loopj.android:android-async-http:1.4.9'
Expand Down

0 comments on commit 196ebb2

Please sign in to comment.