From fbfe7dcb1e66c6240f8c8e90a85113102a175693 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 20 Mar 2021 12:40:01 +0530 Subject: [PATCH] buildSrc: simplify CrowdinDownloadPlugin Signed-off-by: Harsh Shandilya --- .../src/main/java/CrowdinDownloadPlugin.kt | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/buildSrc/src/main/java/CrowdinDownloadPlugin.kt b/buildSrc/src/main/java/CrowdinDownloadPlugin.kt index 03a7859ca..44c12ab01 100644 --- a/buildSrc/src/main/java/CrowdinDownloadPlugin.kt +++ b/buildSrc/src/main/java/CrowdinDownloadPlugin.kt @@ -36,28 +36,13 @@ class CrowdinDownloadPlugin : Plugin { from(zipTree("$buildDir/translations.zip")) into("$buildDir/translations") } - tasks.register("extractBaseStrings") { + tasks.register("extractStrings") { setDependsOn(setOf("extractCrowdin")) - from("$buildDir/translations/${project.name}/src/main/res") - into("${projectDir}/src/main/res") - } - tasks.register("extractNonFreeStrings") { - setDependsOn(setOf("extractCrowdin")) - from("$buildDir/translations/") { exclude("app/") } - into("$buildDir/nonFree-translations") - doLast { - File("$buildDir/nonFree-translations") - .listFiles { file: File -> file.isDirectory } - ?.forEach { file -> - val dest = File("${projectDir}/src/nonFree/values-${file.name}") - val src = File(file, "app/src/nonFree/res/values/strings.xml") - dest.mkdirs() - src.renameTo(File(dest, "strings.xml")) - } - } + from("$buildDir/translations/") + into("${projectDir}/src/") } tasks.register("crowdin") { - setDependsOn(setOf("extractBaseStrings", "extractNonFreeStrings")) + setDependsOn(setOf("extractStrings")) if (!extension.skipCleanup) { doLast { File("$buildDir/translations").deleteRecursively()