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