wireguard-android/build.gradle
Harsh Shandilya 5fa08f286e
build: add task to sync localisations with Crowdin
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-07 19:13:42 +05:30

89 lines
2.2 KiB
Groovy

buildscript {
ext {
activityVersion = '1.2.0-beta01'
agpVersion = '4.1.0'
annotationsVersion = '1.1.0'
appcompatVersion = '1.2.0'
biometricVersion = '1.1.0-beta01'
collectionVersion = '1.1.0'
constraintLayoutVersion = '2.0.2'
coordinatorLayoutVersion = '1.1.0'
coreKtxVersion = '1.3.1'
coroutinesVersion = '1.3.9'
datastoreVersion = '1.0.0-alpha01'
desugarVersion = '1.0.10'
fragmentVersion = '1.3.0-beta01'
jsr305Version = '3.0.2'
junitVersion = '4.13'
kotlinVersion = '1.4.10'
lifecycleRuntimeKtxVersion = '2.3.0-alpha07'
materialComponentsVersion = '1.3.0-alpha03'
preferenceVersion = '1.1.1'
zxingEmbeddedVersion = '3.6.0'
groupName = 'com.wireguard.android'
}
dependencies {
classpath "com.android.tools.build:gradle:$agpVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
repositories {
google()
jcenter()
}
}
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()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
tasks {
wrapper {
gradleVersion = "6.7"
distributionType = Wrapper.DistributionType.ALL
distributionSha256Sum = "0080de8491f0918e4f529a6db6820fa0b9e818ee2386117f4394f95feb1d5583"
}
}
apply from: "version.gradle"