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:7.2.1'
 10    }
 11}
 12
 13apply plugin: 'com.android.application'
 14
 15repositories {
 16    google()
 17    mavenCentral()
 18    jcenter()
 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.0.7') {
 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 'org.sufficientlysecure:openpgp-api:10.0'
 44    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
 45    implementation 'androidx.appcompat:appcompat:1.5.0'
 46    implementation 'androidx.exifinterface:exifinterface:1.3.3'
 47    implementation 'androidx.cardview:cardview:1.0.0'
 48    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
 49    implementation 'com.google.android.material:material:1.4.0'
 50
 51    implementation "androidx.emoji2:emoji2:1.2.0"
 52    freeImplementation "androidx.emoji2:emoji2-bundled:1.2.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    implementation 'com.otaliastudios:transcoder:0.10.4'
 64
 65    implementation 'org.jxmpp:jxmpp-jid:1.0.3'
 66    implementation 'org.osmdroid:osmdroid-android:6.1.11'
 67    implementation 'org.hsluv:hsluv:0.2'
 68    implementation 'org.conscrypt:conscrypt-android:2.5.2'
 69    implementation 'me.drakeet.support:toastcompat:1.1.0'
 70    implementation "com.leinardi.android:speed-dial:3.2.0"
 71
 72    implementation "com.squareup.retrofit2:retrofit:2.9.0"
 73    implementation "com.squareup.retrofit2:converter-gson:2.9.0"
 74    implementation "com.squareup.okhttp3:okhttp:4.10.0"
 75
 76    implementation 'com.google.guava:guava:30.1.1-android'
 77    quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.12.49'
 78    freeImplementation 'ch.threema:webrtc-android:100.0.0'
 79    playstoreImplementation fileTree(include: ['libwebrtc-m104.aar'], dir: 'libs')
 80}
 81
 82ext {
 83    travisBuild = System.getenv("TRAVIS") == "true"
 84    preDexEnabled = System.getProperty("pre-dex", "true")
 85    abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
 86}
 87
 88android {
 89    namespace 'eu.siacs.conversations'
 90    compileSdkVersion 32
 91
 92    defaultConfig {
 93        minSdkVersion 21
 94        targetSdkVersion 32
 95        versionCode 42037
 96        versionName "2.10.9"
 97        archivesBaseName += "-$versionName"
 98        applicationId "eu.siacs.conversations"
 99        resValue "string", "applicationId", applicationId
100        def appName = "Conversations"
101        resValue "string", "app_name", appName
102        buildConfigField "String", "APP_NAME", "\"$appName\"";
103    }
104
105    splits {
106        abi {
107            universalApk true
108            enable true
109        }
110    }
111
112    configurations {
113        implementation.exclude group: 'org.jetbrains' , module:'annotations'
114    }
115
116    dataBinding {
117        enabled true
118    }
119
120    compileOptions {
121        sourceCompatibility JavaVersion.VERSION_1_8
122        targetCompatibility JavaVersion.VERSION_1_8
123    }
124
125    flavorDimensions("mode", "distribution")
126
127    productFlavors {
128
129        quicksy {
130            dimension "mode"
131            applicationId = "im.quicksy.client"
132            resValue "string", "applicationId", applicationId
133
134            def appName = "Quicksy"
135            resValue "string", "app_name", appName
136            buildConfigField "String", "APP_NAME", "\"$appName\"";
137        }
138
139        conversations {
140            dimension "mode"
141        }
142
143        playstore {
144            dimension "distribution"
145            versionNameSuffix "+playstore"
146        }
147        free {
148            dimension "distribution"
149            versionNameSuffix "+free"
150        }
151    }
152
153    sourceSets {
154        quicksyFree {
155            java {
156                srcDir 'src/quicksyFree/java'
157            }
158        }
159        quicksyPlaystore {
160            java {
161                srcDir 'src/quicksyPlaystore/java'
162            }
163            res {
164                srcDir 'src/quicksyPlaystore/res'
165            }
166        }
167        conversationsFree {
168            java {
169                srcDir 'src/conversationsFree/java'
170            }
171        }
172        conversationsPlaystore {
173            java {
174                srcDir 'src/conversationsPlaystore/java'
175            }
176            res {
177                srcDir 'src/conversationsPlaystore/res'
178            }
179        }
180    }
181
182    buildTypes {
183        release {
184            shrinkResources true
185            minifyEnabled true
186            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
187        }
188        debug {
189            shrinkResources true
190            minifyEnabled true
191            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
192        }
193    }
194
195
196    if (new File("signing.properties").exists()) {
197        Properties props = new Properties()
198        props.load(new FileInputStream(file("signing.properties")))
199
200        signingConfigs {
201            release {
202                storeFile file(props['keystore'])
203                storePassword props['keystore.password']
204                keyAlias props['keystore.alias']
205                keyPassword props['keystore.password']
206            }
207        }
208        buildTypes.release.signingConfig = signingConfigs.release
209    }
210
211
212    subprojects {
213
214        afterEvaluate {
215            if (getPlugins().hasPlugin('android') ||
216                    getPlugins().hasPlugin('android-library')) {
217
218                configure(android.lintOptions) {
219                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
220                }
221            }
222
223        }
224    }
225    packagingOptions {
226        resources {
227            excludes += ['META-INF/BCKEY.DSA', 'META-INF/BCKEY.SF']
228        }
229    }
230    lint {
231        disable 'MissingTranslation', 'InvalidPackage', 'AppCompatResource'
232    }
233
234    android.applicationVariants.all { variant ->
235        variant.outputs.each { output ->
236            def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(com.android.build.OutputFile.ABI))
237            if (baseAbiVersionCode != null) {
238                output.versionCodeOverride = (100 * project.android.defaultConfig.versionCode) + baseAbiVersionCode
239            } else {
240                output.versionCodeOverride = 100 * project.android.defaultConfig.versionCode
241            }
242        }
243
244    }
245}