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