mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
build: Use a task to download webRtc for proper task dependencies
`./gradlew clean [whatever] should work now` Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
a44a627cdf
commit
a92dcc075b
@ -33,20 +33,6 @@ apply plugin: 'com.github.spotbugs'
|
|||||||
apply plugin: 'io.gitlab.arturbosch.detekt'
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||||
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||||
|
|
||||||
def urlFile = { url, fileName ->
|
|
||||||
File file = new File("$buildDir/download/${fileName}")
|
|
||||||
file.parentFile.mkdirs()
|
|
||||||
if (!file.exists()) {
|
|
||||||
new URL(url).withInputStream { downloadStream ->
|
|
||||||
file.withOutputStream { fileOut ->
|
|
||||||
fileOut << downloadStream
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
files(file.absolutePath)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdkVersion 30
|
||||||
buildToolsVersion '30.0.3'
|
buildToolsVersion '30.0.3'
|
||||||
@ -147,7 +133,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt'
|
check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt'
|
||||||
lint.dependsOn 'preBuild'
|
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
@ -180,6 +165,8 @@ ext {
|
|||||||
espressoVersion = "3.4.0"
|
espressoVersion = "3.4.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def webRtcVersion = "96.4664.0"
|
||||||
|
|
||||||
configurations.all {
|
configurations.all {
|
||||||
exclude group: 'com.google.firebase', module: 'firebase-core'
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
||||||
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
||||||
@ -253,8 +240,7 @@ dependencies {
|
|||||||
kapt "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
|
kapt "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
|
||||||
implementation 'eu.davidea:flexible-adapter:5.1.0'
|
implementation 'eu.davidea:flexible-adapter:5.1.0'
|
||||||
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
|
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
|
||||||
implementation urlFile('https://github.com/nextcloud-releases/talk-clients-webrtc/releases/download/96.4664.0-RC1/libwebrtc-96.4664.0.aar',
|
implementation files("${project.buildDir}/download/libwebrtc-${webRtcVersion}.aar")
|
||||||
'libwebrtc-96.4664.0.aar')
|
|
||||||
implementation 'com.yarolegovich:lovely-dialog:1.1.1'
|
implementation 'com.yarolegovich:lovely-dialog:1.1.1'
|
||||||
implementation 'com.yarolegovich:mp:1.1.6'
|
implementation 'com.yarolegovich:mp:1.1.6'
|
||||||
implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
|
implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
|
||||||
@ -361,3 +347,30 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
|||||||
jvmTarget = "1.8"
|
jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class DownloadWebRtcTask extends DefaultTask {
|
||||||
|
@Input
|
||||||
|
abstract Property<String> getVersion()
|
||||||
|
|
||||||
|
@TaskAction
|
||||||
|
def run() {
|
||||||
|
def webRtcVersion = version.get()
|
||||||
|
def fileName = "libwebrtc-${webRtcVersion}.aar"
|
||||||
|
def url = "https://github.com/nextcloud-releases/talk-clients-webrtc/releases/download/${webRtcVersion}-RC1/libwebrtc-${webRtcVersion}.aar"
|
||||||
|
|
||||||
|
File file = new File("${project.buildDir}/download/${fileName}")
|
||||||
|
file.parentFile.mkdirs()
|
||||||
|
if (!file.exists()) {
|
||||||
|
new URL(url).withInputStream { downloadStream ->
|
||||||
|
file.withOutputStream { fileOut ->
|
||||||
|
fileOut << downloadStream
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('downloadWebRtc', DownloadWebRtcTask){
|
||||||
|
version = webRtcVersion
|
||||||
|
}
|
||||||
|
preBuild.dependsOn('downloadWebRtc')
|
Loading…
Reference in New Issue
Block a user