summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-03-20 12:40:01 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-03-20 14:58:11 +0530
commitfbfe7dcb1e66c6240f8c8e90a85113102a175693 (patch)
treec9ff0880dd8d513c2b8e8f74e9b5075ecd0732fd /buildSrc/src/main/java
parent7f757bed811af445c8ba2c9edd3fad482468e7f8 (diff)
buildSrc: simplify CrowdinDownloadPlugin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'buildSrc/src/main/java')
-rw-r--r--buildSrc/src/main/java/CrowdinDownloadPlugin.kt23
1 files changed, 4 insertions, 19 deletions
diff --git a/buildSrc/src/main/java/CrowdinDownloadPlugin.kt b/buildSrc/src/main/java/CrowdinDownloadPlugin.kt
index 03a7859c..44c12ab0 100644
--- a/buildSrc/src/main/java/CrowdinDownloadPlugin.kt
+++ b/buildSrc/src/main/java/CrowdinDownloadPlugin.kt
@@ -36,28 +36,13 @@ class CrowdinDownloadPlugin : Plugin<Project> {
from(zipTree("$buildDir/translations.zip"))
into("$buildDir/translations")
}
- tasks.register<Copy>("extractBaseStrings") {
+ tasks.register<Copy>("extractStrings") {
setDependsOn(setOf("extractCrowdin"))
- from("$buildDir/translations/${project.name}/src/main/res")
- into("${projectDir}/src/main/res")
- }
- tasks.register<Copy>("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()