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.2.1'
 10    }
 11}
 12
 13apply plugin: 'com.android.application'
 14
 15repositories {
 16    google()
 17    jcenter()
 18    mavenCentral()
 19}
 20
 21configurations {
 22    playstoreImplementation
 23    compatImplementation
 24    freeCompatImplementation
 25}
 26
 27ext {
 28    supportLibVersion = '28.0.0'
 29}
 30
 31dependencies {
 32    playstoreImplementation('com.google.firebase:firebase-messaging:15.0.2') {
 33        exclude group: 'com.google.firebase', module: 'firebase-core'
 34    }
 35    implementation 'org.sufficientlysecure:openpgp-api:10.0'
 36    implementation ('com.theartofdev.edmodo:android-image-cropper:2.7.+') {
 37        exclude group: 'com.android.support', module: 'appcompat-v7'
 38        exclude group: 'com.android.support', module: 'exifinterface'
 39    }
 40    implementation "com.android.support:support-v13:$supportLibVersion"
 41    implementation "com.android.support:appcompat-v7:$supportLibVersion"
 42    implementation "com.android.support:exifinterface:$supportLibVersion"
 43    implementation "com.android.support:cardview-v7:$supportLibVersion"
 44    compatImplementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
 45    implementation "com.android.support:support-emoji:$supportLibVersion"
 46    implementation "com.android.support:design:$supportLibVersion"
 47    freeCompatImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
 48    implementation 'org.bouncycastle:bcmail-jdk15on:1.58'
 49    implementation 'com.google.zxing:core:3.3.0'
 50    implementation 'de.measite.minidns:minidns-hla:0.2.4'
 51    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
 52    implementation 'org.whispersystems:signal-protocol-java:2.6.2'
 53    implementation 'com.makeramen:roundedimageview:2.3.0'
 54    implementation "com.wefika:flowlayout:0.4.1"
 55    implementation 'net.ypresto.androidtranscoder:android-transcoder:0.2.0'
 56    implementation 'rocks.xmpp:xmpp-addr:0.8.0'
 57    implementation 'org.osmdroid:osmdroid-android:6.0.1'
 58    implementation 'org.hsluv:hsluv:0.2'
 59    implementation 'org.conscrypt:conscrypt-android:1.3.0'
 60}
 61
 62ext {
 63    travisBuild = System.getenv("TRAVIS") == "true"
 64    preDexEnabled = System.getProperty("pre-dex", "true")
 65}
 66
 67android {
 68    compileSdkVersion 28
 69
 70    defaultConfig {
 71        minSdkVersion 19
 72        targetSdkVersion 25
 73        versionCode 297
 74        versionName "2.3.5"
 75        archivesBaseName += "-$versionName"
 76        applicationId "eu.siacs.conversations"
 77        resValue "string", "applicationId", applicationId
 78        resValue "string", "app_name", "Conversations"
 79    }
 80
 81    dataBinding {
 82        enabled true
 83    }
 84
 85    dexOptions {
 86        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
 87        preDexLibraries = preDexEnabled && !travisBuild
 88        jumboMode true
 89    }
 90
 91    compileOptions {
 92        sourceCompatibility JavaVersion.VERSION_1_8
 93        targetCompatibility JavaVersion.VERSION_1_8
 94    }
 95
 96    flavorDimensions("mode", "distribution", "emoji")
 97
 98    productFlavors {
 99
100        quick {
101            dimension "mode"
102            applicationId = "im.conversations.quick"
103            resValue "string", "app_name", "Quick Conversations"
104            resValue "string", "applicationId", applicationId
105        }
106
107        full {
108            dimension "mode"
109        }
110
111        playstore {
112            dimension "distribution"
113            versionNameSuffix "+p"
114        }
115        free {
116            dimension "distribution"
117            versionNameSuffix "+f"
118        }
119        system {
120            dimension "emoji"
121            versionNameSuffix "s"
122        }
123        compat {
124            dimension "emoji"
125            versionNameSuffix "c"
126        }
127    }
128
129    sourceSets {
130        quickFreeCompat {
131            java {
132                srcDirs 'src/freeCompat/java'
133            }
134        }
135        quickPlaystoreCompat {
136            java {
137                srcDirs 'src/playstoreCompat/java'
138            }
139            res {
140                srcDir 'src/playstoreCompat/res'
141            }
142        }
143        fullFreeCompat {
144            java {
145                srcDirs 'src/freeCompat/java'
146            }
147        }
148        fullPlaystoreCompat {
149            java {
150                srcDirs 'src/playstoreCompat/java'
151            }
152            res {
153                srcDir 'src/playstoreCompat/res'
154            }
155        }
156    }
157
158    buildTypes {
159        release {
160            shrinkResources true
161            minifyEnabled true
162            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
163            versionNameSuffix "r"
164        }
165        debug {
166            shrinkResources true
167            minifyEnabled true
168            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
169            versionNameSuffix "d"
170        }
171    }
172
173
174
175    if (new File("signing.properties").exists()) {
176        Properties props = new Properties()
177        props.load(new FileInputStream(file("signing.properties")))
178
179        signingConfigs {
180            release {
181                storeFile file(props['keystore'])
182                storePassword props['keystore.password']
183                keyAlias props['keystore.alias']
184                keyPassword props['keystore.password']
185            }
186        }
187        buildTypes.release.signingConfig = signingConfigs.release
188    }
189
190    lintOptions {
191        disable 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
192    }
193
194    subprojects {
195
196        afterEvaluate {
197            if (getPlugins().hasPlugin('android') ||
198                    getPlugins().hasPlugin('android-library')) {
199
200                configure(android.lintOptions) {
201                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
202                }
203            }
204
205        }
206    }
207
208    packagingOptions {
209        exclude 'META-INF/BCKEY.DSA'
210        exclude 'META-INF/BCKEY.SF'
211    }
212}