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        jcenter()
  7    }
  8    dependencies {
  9        classpath 'com.android.tools.build:gradle:3.5.3'
 10    }
 11}
 12
 13apply plugin: 'com.android.application'
 14
 15repositories {
 16    google()
 17    jcenter()
 18    mavenCentral()
 19}
 20
 21configurations {
 22    playstoreImplementation
 23    compatImplementation
 24    conversationsFreeCompatImplementation
 25    quicksyFreeCompatImplementation
 26    quicksyImplementation
 27}
 28
 29ext {
 30    supportLibVersion = '28.0.0'
 31}
 32
 33dependencies {
 34    playstoreImplementation('com.google.firebase:firebase-messaging:17.3.4') {
 35        exclude group: 'com.google.firebase', module: 'firebase-core'
 36        exclude group: 'com.google.firebase', module: 'firebase-analytics'
 37        exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
 38    }
 39    implementation 'org.sufficientlysecure:openpgp-api:10.0'
 40    implementation('com.theartofdev.edmodo:android-image-cropper:2.7.+') {
 41        exclude group: 'com.android.support', module: 'appcompat-v7'
 42        exclude group: 'com.android.support', module: 'exifinterface'
 43    }
 44    implementation "com.android.support:support-v13:$supportLibVersion"
 45    implementation "com.android.support:appcompat-v7:$supportLibVersion"
 46    implementation "com.android.support:exifinterface:$supportLibVersion"
 47    implementation "com.android.support:cardview-v7:$supportLibVersion"
 48    implementation "com.android.support:support-emoji:$supportLibVersion"
 49    implementation "com.android.support:design:$supportLibVersion"
 50    compatImplementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
 51    conversationsFreeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
 52    quicksyFreeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
 53    implementation 'org.bouncycastle:bcmail-jdk15on:1.58'
 54    //zxing stopped supporting Java 7 so we have to stick with 3.3.3
 55    //https://github.com/zxing/zxing/issues/1170
 56    implementation 'com.google.zxing:core:3.3.3'
 57    implementation 'de.measite.minidns:minidns-hla:0.2.4'
 58    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
 59    implementation 'org.whispersystems:signal-protocol-java:2.6.2'
 60    implementation 'com.makeramen:roundedimageview:2.3.0'
 61    implementation "com.wefika:flowlayout:0.4.1"
 62    implementation 'net.ypresto.androidtranscoder:android-transcoder:0.3.0'
 63    implementation project(':libs:xmpp-addr')
 64    implementation 'org.osmdroid:osmdroid-android:6.1.5'
 65    implementation 'org.hsluv:hsluv:0.2'
 66    implementation 'org.conscrypt:conscrypt-android:2.2.1'
 67    implementation 'me.drakeet.support:toastcompat:1.1.0'
 68    implementation "com.leinardi.android:speed-dial:2.0.1"
 69    //retrofit needs to stick with 2.6.x (https://github.com/square/retrofit/blob/master/CHANGELOG.md)
 70    implementation "com.squareup.retrofit2:retrofit:2.6.4"
 71    implementation "com.squareup.retrofit2:converter-gson:2.6.4"
 72    //okhttp needs to stick with 3.12.x
 73    implementation 'com.squareup.okhttp3:okhttp:3.12.7'
 74    implementation 'com.google.guava:guava:27.1-android'
 75    quicksyImplementation 'io.michaelrocks:libphonenumber-android:8.11.1'
 76}
 77
 78ext {
 79    travisBuild = System.getenv("TRAVIS") == "true"
 80    preDexEnabled = System.getProperty("pre-dex", "true")
 81}
 82
 83android {
 84    compileSdkVersion 28
 85
 86    defaultConfig {
 87        minSdkVersion 16
 88        targetSdkVersion 28
 89        versionCode 353
 90        versionName "2.6.2"
 91        archivesBaseName += "-$versionName"
 92        applicationId "eu.siacs.conversations"
 93        resValue "string", "applicationId", applicationId
 94        resValue "string", "app_name", "Conversations"
 95        buildConfigField "String", "LOGTAG", "\"conversations\""
 96    }
 97
 98    dataBinding {
 99        enabled true
100    }
101
102    dexOptions {
103        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
104        preDexLibraries = preDexEnabled && !travisBuild
105        jumboMode true
106    }
107
108    compileOptions {
109        sourceCompatibility JavaVersion.VERSION_1_8
110        targetCompatibility JavaVersion.VERSION_1_8
111    }
112
113    flavorDimensions("mode", "distribution", "emoji")
114
115    productFlavors {
116
117        quicksy {
118            dimension "mode"
119            applicationId = "im.quicksy.client"
120            resValue "string", "app_name", "Quicksy"
121            resValue "string", "applicationId", applicationId
122            buildConfigField "String", "LOGTAG", "\"quicksy\""
123        }
124
125        conversations {
126            dimension "mode"
127        }
128
129        playstore {
130            dimension "distribution"
131            versionNameSuffix "+p"
132        }
133        free {
134            dimension "distribution"
135            versionNameSuffix "+f"
136        }
137        system {
138            dimension "emoji"
139            versionNameSuffix "s"
140        }
141        compat {
142            dimension "emoji"
143            versionNameSuffix "c"
144        }
145    }
146
147    sourceSets {
148        quicksyFreeCompat {
149            java {
150                srcDirs 'src/freeCompat/java'
151            }
152        }
153        quicksyPlaystoreCompat {
154            java {
155                srcDirs 'src/playstoreCompat/java'
156            }
157            res {
158                srcDir 'src/playstoreCompat/res'
159                srcDir 'src/quicksyPlaystore/res'
160            }
161        }
162        quicksyPlaystoreSystem {
163            res {
164                srcDir 'src/quicksyPlaystore/res'
165            }
166        }
167        conversationsFreeCompat {
168            java {
169                srcDirs 'src/freeCompat/java'
170            }
171        }
172        conversationsPlaystoreCompat {
173            java {
174                srcDirs 'src/playstoreCompat/java'
175            }
176            res {
177                srcDir 'src/playstoreCompat/res'
178                srcDir 'src/conversationsPlaystore/res'
179            }
180        }
181        conversationsPlaystoreSystem {
182            res {
183                srcDir 'src/conversationsPlaystore/res'
184            }
185        }
186    }
187
188    buildTypes {
189        release {
190            shrinkResources true
191            minifyEnabled true
192            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
193            versionNameSuffix "r"
194        }
195        debug {
196            shrinkResources true
197            minifyEnabled true
198            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
199            versionNameSuffix "d"
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    lintOptions {
220        disable 'ExtraTranslation', 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
221    }
222
223    subprojects {
224
225        afterEvaluate {
226            if (getPlugins().hasPlugin('android') ||
227                    getPlugins().hasPlugin('android-library')) {
228
229                configure(android.lintOptions) {
230                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
231                }
232            }
233
234        }
235    }
236
237    packagingOptions {
238        exclude 'META-INF/BCKEY.DSA'
239        exclude 'META-INF/BCKEY.SF'
240    }
241}