This repository was archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 393
/
Copy pathbuild.gradle
executable file
·235 lines (191 loc) · 8.14 KB
/
build.gradle
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
applicationId "im.vector"
minSdkVersion 16
targetSdkVersion 26
// use the version code
versionCode rootProject.ext.versionCodeProp
versionName rootProject.ext.versionNameProp
// custom values
resValue "string", "bug_report_url", "https://riot.im/bugreports/submit"
ndk {
abiFilters "armeabi-v7a", "x86"
}
packagingOptions {
// The project react-native does not provide 64-bit binaries at the
// time of this writing. Unfortunately, packaging any 64-bit
// binaries into the .apk will crash the app at runtime on 64-bit
// platforms.
exclude "lib/x86_64/libjingle_peerconnection_so.so"
exclude "lib/arm64-v8a/libjingle_peerconnection_so.so"
}
multiDexEnabled true
}
signingConfigs {
release {
storeFile file(project.hasProperty("RELEASE_STORE_FILE") ? RELEASE_STORE_FILE : "/dummy/path")
storePassword project.hasProperty("RELEASE_STORE_PASSWORD") ? RELEASE_STORE_PASSWORD : "dummy password"
keyAlias project.hasProperty("RELEASE_KEY_ALIAS") ? RELEASE_KEY_ALIAS : "dummy alias"
keyPassword project.hasProperty("RELEASE_KEY_PASSWORD") ? RELEASE_KEY_PASSWORD : "dummy password"
}
}
dexOptions {
jumboMode true
javaMaxHeapSize "2g"
}
buildTypes {
debug {
resValue "string", "git_revision", "\"${gitRevision()}\""
resValue "string", "git_revision_date", "\"${gitRevisionDate()}\""
resValue "string", "git_branch_name", "\"${gitBranchName()}\""
resValue "string", "build_number", rootProject.ext.buildNumberProp
minifyEnabled false
}
release {
resValue "string", "git_revision", "\"${gitRevision()}\""
resValue "string", "git_revision_date", "\"${gitRevisionDate()}\""
resValue "string", "git_branch_name", "\"${gitBranchName()}\""
resValue "string", "build_number", rootProject.ext.buildNumberProp
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
matrixorg.initWith(buildTypes.release)
matrixorg {
signingConfig signingConfigs.release
// When building with source of the SDK, there is no buildType 'matrixorg' in the SDK so fallback to 'release'
matchingFallbacks = ['release']
}
}
// Specifies a flavor dimension (no need to specify it in each productsFlavor, cause we only declare one dimension).
flavorDimensions "flavor_dimension_vector"
productFlavors {
app {
applicationId "im.vector.alpha"
// use the version name
versionCode rootProject.ext.versionCodeProp
versionName rootProject.ext.versionNameProp
resValue "string", "allow_gcm_use", "true"
resValue "string", "allow_ga_use", "true"
resValue "string", "short_flavor_description", "G"
resValue "string", "flavor_description", "GooglePlay"
}
appfdroid {
applicationId "im.vector.alpha"
// use the version name
versionCode rootProject.ext.versionCodeProp
versionName rootProject.ext.versionNameProp
resValue "string", "allow_gcm_use", "false"
resValue "string", "allow_ga_use", "false"
resValue "string", "short_flavor_description", "F"
resValue "string", "flavor_description", "FDroid"
}
}
lintOptions {
disable 'InvalidPackage'
disable 'MissingTranslation'
disable 'RestrictedApi'
disable 'ImpliedQuantity'
}
repositories {
flatDir {
dir 'libs'
}
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
}
static def gitRevision() {
def cmd = "git rev-parse --short HEAD"
return cmd.execute().text.trim()
}
static def gitRevisionDate() {
def cmd = "git show -s --format=%ci HEAD^{commit}"
return cmd.execute().text.trim()
}
static def gitBranchName() {
def cmd = "git name-rev --name-only HEAD"
return cmd.execute().text.trim()
}
dependencies {
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// Kotlin KTX
implementation 'androidx.core:core-ktx:0.3'
implementation 'com.android.support:multidex:1.0.0'
implementation 'me.leolin:ShortcutBadger:1.1.2@aar'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.jakewharton:butterknife:8.5.1'
kapt 'com.jakewharton:butterknife-compiler:8.5.1'
// Network
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
implementation 'com.squareup.okio:okio:1.13.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
// Use Glide library to display image (Gif supported)
implementation 'com.github.bumptech.glide:glide:4.7.1'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.0.1'
/************* Matrix SDK management **************/
// update settings.gradle
// use the matrix SDK as external lib
implementation(name: 'matrix-sdk', ext: 'aar')
// use the matrix SDK as a sub project
// you have to uncomment some lines in settings.gradle
//implementation project(':matrix-sdk')
implementation(name: 'olm-sdk', ext: 'aar')
/************* jitsi **************/
implementation 'javax.inject:javax.inject:1'
implementation 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.0.0'
implementation 'com.facebook.fresco:fresco:1.3.0'
implementation 'com.facebook.fresco:imagepipeline-okhttp3:1.3.0'
implementation 'com.facebook.soloader:soloader:0.1.0'
implementation 'com.google.code.findbugs:jsr305:3.0.0'
implementation 'org.webkit:android-jsc:r174650'
implementation(name: 'jitsi-sdk', ext: 'aar')
implementation(name: 'react-native-background-timer', ext: 'aar')
implementation(name: 'react-native-fetch-blob', ext: 'aar')
implementation(name: 'react-native-immersive', ext: 'aar')
implementation(name: 'react-native-keep-awake', ext: 'aar')
implementation(name: 'react-native-vector-icons', ext: 'aar')
implementation(name: 'react-native-webrtc', ext: 'aar')
implementation(name: 'react-native', ext: 'aar')
implementation(name: 'react-native-locale-detector', ext: 'aar')
// Library to add the built-in emoj on the chat room
// Some changes were needed to integrate it into this project. Until the new build
// is released, the snapshot has to be used.
compile 'com.vanniktech:emoji-one:0.6.0-SNAPSHOT'
// another tracking than GA
implementation 'org.piwik.sdk:piwik-sdk:2.0.0'
/************* flavors management **************/
// app flavor only
appImplementation 'com.google.firebase:firebase-core:11.8.0'
appImplementation 'com.google.firebase:firebase-messaging:11.8.0'
// fdroid flavor only
}
if (!getGradle().getStartParameter().getTaskRequests().toString().contains("fdroid")) {
apply plugin: 'com.google.gms.google-services'
}