summaryrefslogtreecommitdiffhomepage
path: root/build.gradle
blob: e3839613ae2a7a436b00c4442d3fc7dbd310275c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
buildscript {
    ext {
        activityVersion = '1.2.0-beta02'
        agpVersion = '4.1.1'
        annotationsVersion = '1.1.0'
        appcompatVersion = '1.2.0'
        biometricVersion = '1.1.0-rc01'
        collectionVersion = '1.1.0'
        constraintLayoutVersion = '2.0.4'
        coordinatorLayoutVersion = '1.1.0'
        coreKtxVersion = '1.3.2'
        coroutinesVersion = '1.4.2'
        datastoreVersion = '1.0.0-alpha02'
        desugarVersion = '1.0.10'
        fragmentVersion = '1.3.0-beta02'
        jsr305Version = '3.0.2'
        junitVersion = '4.13.1'
        kotlinVersion = '1.4.21'
        lifecycleRuntimeKtxVersion = '2.3.0-beta01'
        materialComponentsVersion = '1.3.0-beta01'
        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.8.1"
        distributionType = Wrapper.DistributionType.ALL
        distributionSha256Sum = "3db89524a3981819ff28c3f979236c1274a726e146ced0c8a2020417f9bc0782"
    }
}

apply from: "version.gradle"