build.gradle

  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.2.0-rc01'
 10    }
 11}
 12
 13apply plugin: 'com.android.application'
 14
 15repositories {
 16    google()
 17    mavenCentral()
 18    maven { url='https://jitpack.io'}
 19}
 20
 21configurations {
 22    playstoreImplementation
 23    freeImplementation
 24    conversationsFreeImplementation
 25    conversationsPlaystorImplementation
 26    conversationsPlaystoreImplementation
 27    quicksyPlaystoreImplementation
 28    quicksyPlaystoreImplementation
 29    quicksyFreeImplementation
 30    quicksyImplementation
 31}
 32
 33dependencies {
 34    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
 35
 36    implementation 'androidx.viewpager:viewpager:1.0.0'
 37
 38    playstoreImplementation('com.google.firebase:firebase-messaging:23.3.1') {
 39        exclude group: 'com.google.firebase', module: 'firebase-core'
 40        exclude group: 'com.google.firebase', module: 'firebase-analytics'
 41        exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
 42    }
 43    conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2")
 44    quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
 45    implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1'
 46    implementation("com.github.CanHub:Android-Image-Cropper:2.0.0")
 47    implementation 'androidx.appcompat:appcompat:1.6.1'
 48    implementation 'androidx.exifinterface:exifinterface:1.3.6'
 49    implementation 'androidx.cardview:cardview:1.0.0'
 50    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
 51    implementation 'com.google.android.material:material:1.10.0'
 52
 53    implementation "androidx.emoji2:emoji2:1.4.0"
 54    freeImplementation "androidx.emoji2:emoji2-bundled:1.4.0"
 55
 56    implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
 57    //zxing stopped supporting Java 7 so we have to stick with 3.3.3
 58    //https://github.com/zxing/zxing/issues/1170
 59    implementation 'com.google.zxing:core:3.3.3'
 60    implementation 'de.measite.minidns:minidns-hla:0.2.4'
 61    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
 62    implementation 'org.whispersystems:signal-protocol-java:2.6.2'
 63    implementation 'com.makeramen:roundedimageview:2.3.0'
 64    implementation "com.wefika:flowlayout:0.4.1"
 65    //noinspection GradleDependency
 66    implementation('com.github.natario1:Transcoder:v0.9.1') {
 67        exclude group: 'com.otaliastudios.opengl', module: 'egloo'
 68    }
 69    implementation 'com.github.natario1:Egloo:v0.4.0'
 70
 71    implementation 'org.jxmpp:jxmpp-jid:1.0.3'
 72    implementation 'org.jxmpp:jxmpp-stringprep-libidn:1.0.3'
 73    implementation 'org.osmdroid:osmdroid-android:6.1.11'
 74    implementation 'org.hsluv:hsluv:0.2'
 75    implementation 'org.conscrypt:conscrypt-android:2.5.2'
 76    implementation 'me.drakeet.support:toastcompat:1.1.0'
 77    implementation "com.leinardi.android:speed-dial:3.2.0"
 78
 79    implementation "com.squareup.retrofit2:retrofit:2.9.0"
 80    implementation "com.squareup.retrofit2:converter-gson:2.9.0"
 81    implementation "com.squareup.okhttp3:okhttp:4.11.0"
 82
 83    implementation 'com.google.guava:guava:32.1.3-android'
 84    quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.13.17'
 85    implementation 'im.conversations.webrtc:webrtc-android:119.0.0'
 86}
 87
 88ext {
 89    preDexEnabled = System.getProperty("pre-dex", "true")
 90    abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
 91}
 92
 93android {
 94    namespace 'eu.siacs.conversations'
 95    compileSdkVersion 34
 96
 97    defaultConfig {
 98        minSdkVersion 21
 99        targetSdkVersion 34
100        versionCode 42077
101        versionName "2.12.12"
102        archivesBaseName += "-$versionName"
103        applicationId "eu.siacs.conversations"
104        resValue "string", "applicationId", applicationId
105        def appName = "Conversations"
106        resValue "string", "app_name", appName
107        buildConfigField "String", "APP_NAME", "\"$appName\""
108    }
109
110    splits {
111        abi {
112            universalApk true
113            enable true
114            reset()
115            include project.ext.abiCodes.keySet() as String[]
116        }
117    }
118
119    configurations {
120        implementation.exclude group: 'org.jetbrains' , module:'annotations'
121    }
122
123    dataBinding {
124        enabled true
125    }
126
127    compileOptions {
128        coreLibraryDesugaringEnabled true
129        sourceCompatibility JavaVersion.VERSION_17
130        targetCompatibility JavaVersion.VERSION_17
131    }
132
133    flavorDimensions("mode", "distribution")
134
135    productFlavors {
136
137        quicksy {
138            dimension "mode"
139            applicationId = "im.quicksy.client"
140            resValue "string", "applicationId", applicationId
141
142            def appName = "Quicksy"
143            resValue "string", "app_name", appName
144            buildConfigField "String", "APP_NAME", "\"$appName\""
145        }
146
147        conversations {
148            dimension "mode"
149        }
150
151        playstore {
152            dimension "distribution"
153            versionNameSuffix "+playstore"
154        }
155        free {
156            dimension "distribution"
157            versionNameSuffix "+free"
158        }
159    }
160
161    sourceSets {
162        quicksyFree {
163            java {
164                srcDir 'src/quicksyFree/java'
165            }
166        }
167        quicksyPlaystore {
168            java {
169                srcDir 'src/quicksyPlaystore/java'
170            }
171            res {
172                srcDir 'src/quicksyPlaystore/res'
173            }
174        }
175        conversationsFree {
176            java {
177                srcDir 'src/conversationsFree/java'
178            }
179        }
180        conversationsPlaystore {
181            java {
182                srcDir 'src/conversationsPlaystore/java'
183            }
184            res {
185                srcDir 'src/conversationsPlaystore/res'
186            }
187        }
188    }
189
190    buildTypes {
191        release {
192            shrinkResources true
193            minifyEnabled true
194            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
195        }
196        debug {
197            shrinkResources true
198            minifyEnabled true
199            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
200        }
201    }
202
203
204    if (new File("signing.properties").exists()) {
205        Properties props = new Properties()
206        props.load(new FileInputStream(file("signing.properties")))
207
208        signingConfigs {
209            release {
210                storeFile file(props['keystore'])
211                storePassword props['keystore.password']
212                keyAlias props['keystore.alias']
213                keyPassword props['keystore.password']
214            }
215        }
216        buildTypes.release.signingConfig = signingConfigs.release
217    }
218
219
220    subprojects {
221
222        afterEvaluate {
223            if (getPlugins().hasPlugin('android') ||
224                    getPlugins().hasPlugin('android-library')) {
225
226                configure(android.lintOptions) {
227                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
228                }
229            }
230
231        }
232    }
233    packagingOptions {
234        resources {
235            excludes += ['META-INF/BCKEY.DSA', 'META-INF/BCKEY.SF']
236        }
237    }
238    lint {
239        disable 'MissingTranslation', 'InvalidPackage', 'AppCompatResource'
240    }
241    buildFeatures {
242        buildConfig true
243    }
244
245    android.applicationVariants.configureEach { variant ->
246        variant.outputs.each { output ->
247            def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(com.android.build.OutputFile.ABI))
248            if (baseAbiVersionCode != null) {
249                output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode
250            } else {
251                output.versionCodeOverride = 100 * project.android.defaultConfig.versionCode
252            }
253        }
254
255    }
256}