build.gradle 3.85 KB
Newer Older
Румен Петров's avatar
Румен Петров committed
1
2
apply plugin: 'com.android.application'

3
4
5
6
7
8
9
10
def computeVersionCode(int code) {
    return code * 1000000 + android.defaultConfig.versionCode
}

def computeVersionName(String name) {
    return android.defaultConfig.versionName + "-" + name
}

Румен Петров's avatar
Румен Петров committed
11
android {
12
13
    compileSdkVersion project.ext.compileSdkVersion
    buildToolsVersion project.ext.buildToolsVersion
Румен Петров's avatar
Румен Петров committed
14
15
    defaultConfig {
        applicationId "com.termoneplus.securebox"
16

17
18
19
        minSdkVersion project.ext.minSdkVersion
        targetSdkVersion project.ext.targetSdkVersion

Румен Петров's avatar
Румен Петров committed
20
21
        versionCode 224
        versionName '2.2.4'
22

23
24
25
26
        // TermOnePlus applicationId
        manifestPlaceholders = [ termApplicationId:"com.termoneplus"]
        buildConfigField("String", "TERM_APPLICATION_ID", "\"com.termoneplus\"")

27
        vectorDrawables.useSupportLibrary = true
28
29
30
31
32
33

        externalNativeBuild {
            cmake {
                arguments "-DAPPLICATION_ID:STRING=${applicationId}"
            }
        }
Румен Петров's avatar
Румен Петров committed
34
    }
35
36
    externalNativeBuild {
        cmake {
37
            path "src/CMakeLists.txt"
38
39
        }
    }
40
41
42
43
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
Румен Петров's avatar
Румен Петров committed
44
45
    buildTypes {
        release {
46
47
            minifyEnabled true
            shrinkResources true
Румен Петров's avatar
Румен Петров committed
48
49
50
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
51
52
    flavorDimensions "abi"
    productFlavors {
53
        /* removed in NDK r18
54
55
56
57
58
        arm {
            dimension "abi"
            ndk {
                abiFilters "armeabi"
            }
59
            versionCode computeVersionCode(1)
60
            versionName computeVersionName("arm")
61
        }*/
62
63
        arm7 {
            dimension "abi"
64
            /* in NDK r18 minimal available platform is API 16
65
66
67
68
            // Remark: in emulator native commands crash if build is for "armeabi-v7a"
            // but work fine with "armeabi". Version 16(JELLY_BEAN) is lowest that
            // work fine with "armeabi-v7a".
            minSdkVersion 16
69
            */
70
71
72
            ndk {
                abiFilters "armeabi-v7a"
            }
73
            versionCode computeVersionCode(2)
74
75
76
77
78
79
80
            versionName computeVersionName("arm7")
        }
        i686 {
            dimension "abi"
            ndk {
                abiFilters "x86"
            }
81
            versionCode computeVersionCode(3)
82
83
            versionName computeVersionName("i686")
        }
84
        /* removed in NDK r18
85
86
87
88
89
        mips {
            dimension "abi"
            ndk {
                abiFilters "mips"
            }
90
            versionCode computeVersionCode(4)
91
            versionName computeVersionName("mips")
92
        }*/
93
94
95
96
97
        arm8 {
            dimension "abi"
            ndk {
                abiFilters "arm64-v8a"
            }
98
            versionCode computeVersionCode(5)
99
100
101
102
103
104
105
            versionName computeVersionName("arm8")
        }
        x86_64 {
            dimension "abi"
            ndk {
                abiFilters "x86_64"
            }
106
            versionCode computeVersionCode(6)
107
108
            versionName computeVersionName("x86_64")
        }
109
        /* removed in NDK r18
110
111
112
113
114
        mips64 {
            dimension "abi"
            ndk {
                abiFilters "mips64"
            }
115
            versionCode computeVersionCode(7)
116
            versionName computeVersionName("mips64")
117
        }*/
118
    }
Румен Петров's avatar
Румен Петров committed
119
120
121
}

dependencies {
122
    implementation fileTree(include: ['*.jar'], dir: 'libs')
123
    implementation 'androidx.appcompat:appcompat:1.1.0'
124
125
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
Румен Петров's avatar
Румен Петров committed
126
}
127
128
129
130
131
132
133
134
135
136
137

task elfcleaner(type: Exec) {
    // only unix
    commandLine 'sh', '-c', 'find build/*/stripped* -name lib*.so -exec elf-cleaner {} \\;'
}

tasks.whenTaskAdded { task ->
    if (task.name.matches('strip.*DebugSymbols')) {
        task.finalizedBy elfcleaner
    }
}