From 1243fe4c03a2c962a2754e5937619975837c35ff Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 26 Apr 2023 09:03:20 +0200 Subject: [PATCH] Remove DownloadWebRtcTask.groovy Signed-off-by: Andy Scherzinger --- .../talk/gradle/DownloadWebRtcTask.groovy | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 buildSrc/src/main/groovy/com/nextcloud/talk/gradle/DownloadWebRtcTask.groovy diff --git a/buildSrc/src/main/groovy/com/nextcloud/talk/gradle/DownloadWebRtcTask.groovy b/buildSrc/src/main/groovy/com/nextcloud/talk/gradle/DownloadWebRtcTask.groovy deleted file mode 100644 index 75c2f7655..000000000 --- a/buildSrc/src/main/groovy/com/nextcloud/talk/gradle/DownloadWebRtcTask.groovy +++ /dev/null @@ -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 . - */ - -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 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 - } - } - } - } -}