mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00:00
Merge pull request #2977 from nextcloud/chore/2972/weRTCViaJitpack
Switch webRTC dependency to gradle dependency managed
This commit is contained in:
commit
c673f3f745
2
.github/workflows/assembleFlavors.yml
vendored
2
.github/workflows/assembleFlavors.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
flavor: [ Generic, Gplay ]
|
||||
steps:
|
||||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
||||
- name: set up JDK 11
|
||||
- name: set up JDK 17
|
||||
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
|
||||
with:
|
||||
distribution: "temurin"
|
||||
|
@ -24,7 +24,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import com.github.spotbugs.snom.SpotBugsTask
|
||||
import com.nextcloud.talk.gradle.DownloadWebRtcTask
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
@ -154,13 +153,6 @@ ext {
|
||||
espressoVersion = "3.5.1"
|
||||
}
|
||||
|
||||
def webRtcVersion = "110.5481.0"
|
||||
tasks.register('downloadWebRtc', DownloadWebRtcTask){
|
||||
version = webRtcVersion
|
||||
}
|
||||
|
||||
preBuild.dependsOn('downloadWebRtc')
|
||||
|
||||
configurations.all {
|
||||
exclude group: 'com.google.firebase', module: 'firebase-core'
|
||||
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
||||
@ -242,7 +234,6 @@ dependencies {
|
||||
implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
|
||||
implementation 'eu.davidea:flexible-adapter:5.1.0'
|
||||
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
|
||||
implementation fileTree(downloadWebRtc.libFile.path)
|
||||
implementation 'com.yarolegovich:mp:1.1.6'
|
||||
implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
|
||||
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
||||
@ -311,6 +302,8 @@ dependencies {
|
||||
// implementation 'androidx.activity:activity-ktx:1.4.0'
|
||||
|
||||
implementation 'com.github.nextcloud.android-common:ui:0.8.0'
|
||||
|
||||
implementation 'com.github.nextcloud-deps:android-talk-webrtc:110.5481.0'
|
||||
}
|
||||
|
||||
task installGitHooks(type: Copy, group: "development") {
|
||||
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Álvaro Brey
|
||||
* Copyright (C) 2022 Álvaro Brey
|
||||
* Copyright (C) 2022 Nextcloud GmbH
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.gradle
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.CacheableTask
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.OutputFile
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
|
||||
@CacheableTask
|
||||
abstract class DownloadWebRtcTask extends DefaultTask {
|
||||
@Input
|
||||
abstract Property<String> getVersion()
|
||||
|
||||
@OutputFile
|
||||
File getLibFile() {
|
||||
return new File(getOutputPath())
|
||||
}
|
||||
|
||||
private String getFileName() {
|
||||
def webRtcVersion = version.get()
|
||||
return "libwebrtc-${webRtcVersion}.aar"
|
||||
}
|
||||
|
||||
private String getDownloadUrl() {
|
||||
def webRtcVersion = version.get()
|
||||
return "https://github.com/nextcloud-releases/talk-clients-webrtc/releases/download/${webRtcVersion}/${getFileName()}"
|
||||
}
|
||||
|
||||
private String getOutputPath() {
|
||||
return "${project.buildDir}/download/${getFileName()}"
|
||||
}
|
||||
|
||||
@TaskAction
|
||||
def run() {
|
||||
libFile.parentFile.mkdirs()
|
||||
if (!libFile.exists()) {
|
||||
logger.lifecycle("Downloading libWebRTC ${version.get()} from ${getDownloadUrl()}")
|
||||
new URL(getDownloadUrl()).withInputStream { downloadStream ->
|
||||
libFile.withOutputStream { fileOut ->
|
||||
fileOut << downloadStream
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user