aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/build.gradle
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-11-07 19:02:21 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-11-07 19:13:42 +0530
commit5fa08f286ef320ad5b4ac273b082bf38de857a65 (patch)
treeaad502bb4fb2a2aa2a7d371720a004f281e97183 /build.gradle
parentbuild: switch to Gradle's maven-publish plugin (diff)
downloadwireguard-android-5fa08f286ef320ad5b4ac273b082bf38de857a65.tar.xz
wireguard-android-5fa08f286ef320ad5b4ac273b082bf38de857a65.zip
build: add task to sync localisations with Crowdin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle33
1 files changed, 33 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index f1d56c3..ccb920d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -33,6 +33,39 @@ buildscript {
}
}
+plugins {
+ id "de.undercouch.download" version "4.1.1"
+}
+
+task downloadCrowdin(type: Download) {
+ src 'https://crowdin.com/backend/download/project/wireguard.zip'
+ dest file('build/translations.zip')
+ overwrite true
+}
+
+task cleanCrowdin(type: Delete) {
+ delete 'ui/src/main/res/values-*/strings.xml'
+}
+
+task extractCrowdin(type: Copy, dependsOn: ['downloadCrowdin', 'cleanCrowdin']) {
+ mustRunAfter 'downloadCrowdin'
+ from zipTree(file('build/translations.zip'))
+ into file('build/translations')
+ doFirst {
+ delete 'build/translations'
+ }
+}
+
+task crowdin(type: Copy, dependsOn: ['extractCrowdin']) {
+ mustRunAfter 'extractCrowdin'
+ from 'build/translations/wireguard-android/ui/src/main/res'
+ into 'ui/src/main/res/'
+ doLast {
+ delete 'build/translations'
+ delete 'build/translations.zip'
+ }
+}
+
allprojects {
repositories {
google()