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