1// Top-level build file where you can add configuration options common to all
2// sub-projects/modules.
3buildscript {
4 repositories {
5 google()
6 mavenCentral()
7 }
8 dependencies {
9 classpath 'com.android.tools.build:gradle:8.5.2'
10 classpath "com.diffplug.spotless:spotless-plugin-gradle:7.0.2"
11 }
12}
13
14apply plugin: 'com.android.application'
15apply plugin: "com.diffplug.spotless"
16
17repositories {
18 google()
19 mavenCentral()
20 maven { url='https://jitpack.io'}
21}
22
23configurations {
24 playstoreImplementation
25 freeImplementation
26 conversationsFreeImplementation
27 conversationsPlaystorImplementation
28 conversationsPlaystoreImplementation
29 quicksyPlaystoreImplementation
30 quicksyPlaystoreImplementation
31 quicksyFreeImplementation
32 quicksyImplementation
33}
34
35spotless {
36 ratchetFrom '2.17.4'
37 java {
38 target '**/*.java'
39 googleJavaFormat().aosp().reflowLongStrings()
40 }
41}
42
43
44dependencies {
45 coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
46
47 implementation project(':libs:annotation')
48 annotationProcessor project(':libs:annotation-processor')
49
50
51 implementation 'androidx.viewpager:viewpager:1.1.0'
52
53 playstoreImplementation('com.google.firebase:firebase-messaging:24.1.1') {
54 exclude group: 'com.google.firebase', module: 'firebase-core'
55 exclude group: 'com.google.firebase', module: 'firebase-analytics'
56 exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
57 }
58 conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
59 quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.2.0'
60 implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1'
61 implementation("com.vanniktech:android-image-cropper:4.6.0")
62 implementation "androidx.sharetarget:sharetarget:1.2.0"
63
64 implementation 'androidx.appcompat:appcompat:1.7.0'
65 implementation 'androidx.exifinterface:exifinterface:1.4.0'
66 implementation 'androidx.cardview:cardview:1.0.0'
67 implementation "androidx.preference:preference:1.2.1"
68 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
69 implementation 'com.google.android.material:material:1.13.0-alpha12'
70 implementation 'androidx.work:work-runtime:2.9.1'
71
72 implementation "androidx.emoji2:emoji2:1.5.0"
73 freeImplementation "androidx.emoji2:emoji2-bundled:1.5.0"
74 implementation "androidx.emoji2:emoji2-emojipicker:1.5.0"
75
76 implementation 'org.bouncycastle:bcmail-jdk18on:1.80'
77 implementation 'com.google.zxing:core:3.5.3'
78 implementation 'org.minidns:minidns-client:1.0.4'
79 implementation 'org.minidns:minidns-dnssec:1.0.4'
80 implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
81 implementation 'org.whispersystems:signal-protocol-java:2.6.2'
82 implementation 'com.makeramen:roundedimageview:2.3.0'
83
84 //noinspection GradleDependency
85 implementation 'io.deepmedia.community:transcoder-android:0.11.2'
86
87 implementation 'org.jxmpp:jxmpp-jid:1.0.3'
88 implementation 'org.jxmpp:jxmpp-stringprep-libidn:1.0.3'
89 implementation 'org.osmdroid:osmdroid-android:6.1.11'
90 implementation 'org.hsluv:hsluv:0.2'
91 implementation 'org.conscrypt:conscrypt-android:2.5.2'
92 implementation 'me.drakeet.support:toastcompat:1.1.0'
93 implementation "com.leinardi.android:speed-dial:3.3.0"
94
95 implementation "com.squareup.retrofit2:retrofit:2.11.0"
96 implementation "com.squareup.retrofit2:converter-gson:2.11.0"
97 implementation "com.squareup.okhttp3:okhttp:4.12.0"
98
99 implementation 'com.google.guava:guava:33.4.0-android'
100 quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.13.52'
101 implementation 'im.conversations.webrtc:webrtc-android:129.0.0'
102
103 //Testing
104 testImplementation 'junit:junit:4.13.2'
105
106}
107
108ext {
109 preDexEnabled = System.getProperty("pre-dex", "true")
110 abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
111}
112
113android {
114 namespace 'eu.siacs.conversations'
115 compileSdk 34
116
117 defaultConfig {
118 minSdkVersion 23
119 targetSdkVersion 34
120 versionCode 42137
121 versionName "2.18.0-beta.2"
122 archivesBaseName += "-$versionName"
123 applicationId "eu.siacs.conversations"
124 resValue "string", "applicationId", applicationId
125 def appName = "Conversations"
126 resValue "string", "app_name", appName
127 buildConfigField "String", "APP_NAME", "\"$appName\""
128 }
129
130 splits {
131 abi {
132 universalApk true
133 enable true
134 reset()
135 //noinspection ChromeOsAbiSupport
136 include project.ext.abiCodes.keySet() as String[]
137 }
138 }
139
140 configurations {
141 implementation.exclude group: 'org.jetbrains' , module:'annotations'
142 }
143
144 dataBinding {
145 enabled true
146 }
147
148 compileOptions {
149 coreLibraryDesugaringEnabled true
150 sourceCompatibility JavaVersion.VERSION_17
151 targetCompatibility JavaVersion.VERSION_17
152 }
153
154 flavorDimensions += "mode"
155 flavorDimensions += "distribution"
156
157 productFlavors {
158
159 quicksy {
160 dimension "mode"
161 applicationId = "im.quicksy.client"
162 resValue "string", "applicationId", applicationId
163
164 def appName = "Quicksy"
165 resValue "string", "app_name", appName
166 buildConfigField "String", "APP_NAME", "\"$appName\""
167 buildConfigField "String", "PRIVACY_POLICY", "\"https://quicksy.im/privacy.htm\""
168 }
169
170 conversations {
171 dimension "mode"
172 buildConfigField "String", "PRIVACY_POLICY", "\"https://conversations.im/privacy.html\""
173 }
174
175 playstore {
176 dimension "distribution"
177 versionNameSuffix "+playstore"
178 }
179 free {
180 dimension "distribution"
181 versionNameSuffix "+free"
182 }
183 }
184
185 sourceSets {
186 quicksyFree {
187 java {
188 srcDir 'src/quicksyFree/java'
189 }
190 }
191 quicksyPlaystore {
192 java {
193 srcDir 'src/quicksyPlaystore/java'
194 }
195 res {
196 srcDir 'src/quicksyPlaystore/res'
197 }
198 }
199 conversationsFree {
200 java {
201 srcDir 'src/conversationsFree/java'
202 }
203 }
204 conversationsPlaystore {
205 java {
206 srcDir 'src/conversationsPlaystore/java'
207 }
208 res {
209 srcDir 'src/conversationsPlaystore/res'
210 }
211 }
212 }
213
214 buildTypes {
215 release {
216 shrinkResources true
217 minifyEnabled true
218 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
219 }
220 }
221
222
223 if (new File("signing.properties").exists()) {
224 Properties props = new Properties()
225 props.load(new FileInputStream(file("signing.properties")))
226
227 signingConfigs {
228 release {
229 storeFile file(props['keystore'])
230 storePassword props['keystore.password']
231 keyAlias props['keystore.alias']
232 keyPassword props['keystore.password']
233 }
234 }
235 buildTypes.release.signingConfig = signingConfigs.release
236 }
237
238
239 subprojects {
240
241 afterEvaluate {
242 if (getPlugins().hasPlugin('android') ||
243 getPlugins().hasPlugin('android-library')) {
244
245 configure(android.lintOptions) {
246 disable 'AndroidGradlePluginVersion', 'MissingTranslation'
247 }
248 }
249
250 }
251 }
252 packagingOptions {
253 resources {
254 excludes += ['META-INF/BCKEY.DSA', 'META-INF/BCKEY.SF', 'META-INF/versions/9/OSGI-INF/MANIFEST.MF']
255 }
256 }
257 lint {
258 disable 'MissingTranslation', 'InvalidPackage', 'AppCompatResource'
259 }
260 buildFeatures {
261 buildConfig true
262 }
263
264 android.applicationVariants.configureEach { variant ->
265 variant.outputs.each { output ->
266 def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(com.android.build.OutputFile.ABI))
267 if (baseAbiVersionCode != null) {
268 output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode
269 } else {
270 output.versionCodeOverride = 100 * project.android.defaultConfig.versionCode
271 }
272 }
273
274 }
275}