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