Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thias15 committed Oct 5, 2024
1 parent 0d8538d commit 2a75480
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
3 changes: 2 additions & 1 deletion android/comlib/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
libs
43 changes: 35 additions & 8 deletions android/comlib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
//Abemart wroup and google webRtc are both deprecated on maven and other similar repositories
//Hence created a local implementation of those libraries using pre-compiled .aar files in a shared modules called comlib
plugins {
id 'java-library'
id 'de.undercouch.download'
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

// Download aars
apply plugin: 'de.undercouch.download'
project.ext.LIB_DIR = projectDir.toString() + '/libs'
// Define the libs directory
project.ext.LIB_DIR = "${projectDir}/libs"
apply from: 'download.gradle'

//Abemart wroup and google webRtc are both deprecated on maven and other similar repositories
//Hence created a local implementation of those libraries using pre-compiled .aar files in a shared modules called comlib
// Task to check for AAR files
task checkAars {
dependsOn downloadAars // Ensure this matches the actual download task name

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

if (!googleWebrtcFile.exists() || !wroupFile.exists()) {
throw new GradleException("Required AAR files are missing. Please run the download task.")
}
}
}

dependencies {
api files('libs/google-webrtc-1.0.32006.aar')
api files('libs/Wroup-master-release.aar')
}
def googleWebrtcFile = file("${project.ext.LIB_DIR}/google-webrtc-1.0.32006.aar")
def wroupFile = file("${project.ext.LIB_DIR}/Wroup-master-release.aar")

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

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

// Ensure that checkAars runs before any Java compile tasks
tasks.withType(JavaCompile) {
dependsOn checkAars
}

0 comments on commit 2a75480

Please sign in to comment.