From 3a38c76eb2015677691bbb3ad30810a251caa394 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 16 Feb 2022 19:11:28 -0500 Subject: [PATCH] Get libwebrtc using gradle --- .builds/debian-stable.yml | 5 ----- build.gradle | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.builds/debian-stable.yml b/.builds/debian-stable.yml index 933cf9014..7de4f7981 100644 --- a/.builds/debian-stable.yml +++ b/.builds/debian-stable.yml @@ -22,11 +22,6 @@ tasks: echo y | android/cmdline-tools/tools/bin/sdkmanager "build-tools;29.0.2" touch ~/.android/repositories.cfg yes | android/cmdline-tools/tools/bin/sdkmanager --licenses -- libwebrtc: | - cd cheogram-android - mkdir libs - cd libs - wget -qO libwebrtc.aar https://cloudflare-ipfs.com/ipfs/QmeqMiLxHi8AAjXobxr3QTfa1bSSLyAu86YviAqQnjxCjM/libwebrtc.aar - build: | cd cheogram-android ./gradlew assembleCheogramFreeSystemDebug diff --git a/build.gradle b/build.gradle index bd1409839..d9b30ae52 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,20 @@ repositories { jcenter() } +// https://stackoverflow.com/a/38105112/8611 +def urlFile = { url, name -> + File file = new File("$buildDir/download/${name}") + file.parentFile.mkdirs() + if (!file.exists()) { + new URL(url).withInputStream { downloadStream -> + file.withOutputStream { fileOut -> + fileOut << downloadStream + } + } + } + files(file.absolutePath) +} + configurations { playstoreImplementation compatImplementation @@ -77,7 +91,7 @@ dependencies { implementation 'com.google.guava:guava:30.1.1-android' quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.12.36' - implementation fileTree(include: ['libwebrtc.aar'], dir: 'libs') + implementation urlFile('https://cloudflare-ipfs.com/ipfs/QmeqMiLxHi8AAjXobxr3QTfa1bSSLyAu86YviAqQnjxCjM/libwebrtc.aar', 'libwebrtc.aar') } ext { -- 2.38.5