diff --git a/.builds/debian-stable.yml b/.builds/debian-stable.yml index 933cf901441b8aa6ff73a38858bd399bbfefaa9c..7de4f7981c4c79f69888fd557f9e1db384469dab 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 bd14098391f7362ffa4f2c1d4c54661269ee31bc..d9b30ae524c94149ad735d64cd47c8365541905c 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 {