-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/build | ||
/build | ||
libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |