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.1.4'
 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 = '27.1.1'
 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}
 56
 57ext {
 58    travisBuild = System.getenv("TRAVIS") == "true"
 59    preDexEnabled = System.getProperty("pre-dex", "true")
 60}
 61
 62android {
 63    compileSdkVersion 28
 64
 65    defaultConfig {
 66        minSdkVersion 19
 67        targetSdkVersion 28
 68        versionCode 284
 69        versionName "2.3.0-beta"
 70        archivesBaseName += "-$versionName"
 71        applicationId "eu.siacs.conversations"
 72        resValue "string", "applicationId", applicationId
 73        resValue "string", "app_name", "Conversations"
 74    }
 75
 76    dataBinding {
 77        enabled true
 78    }
 79
 80    dexOptions {
 81        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
 82        preDexLibraries = preDexEnabled && !travisBuild
 83        jumboMode true
 84    }
 85
 86    compileOptions {
 87        sourceCompatibility JavaVersion.VERSION_1_8
 88        targetCompatibility JavaVersion.VERSION_1_8
 89    }
 90
 91    flavorDimensions("distribution", "emoji")
 92
 93    productFlavors {
 94        playstore {
 95            dimension "distribution"
 96            versionNameSuffix "+p"
 97        }
 98        free {
 99            dimension "distribution"
100            versionNameSuffix "+f"
101        }
102        system {
103            dimension "emoji"
104            versionNameSuffix "s"
105        }
106        compat {
107            dimension "emoji"
108            versionNameSuffix "c"
109        }
110    }
111
112    buildTypes {
113        release {
114            shrinkResources true
115            minifyEnabled true
116            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
117            versionNameSuffix "r"
118        }
119        debug {
120            shrinkResources true
121            minifyEnabled true
122            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
123            versionNameSuffix "d"
124        }
125    }
126
127
128
129    if(new File("signing.properties").exists()) {
130        Properties props = new Properties()
131        props.load(new FileInputStream(file("signing.properties")))
132
133        signingConfigs {
134            release {
135                storeFile file(props['keystore'])
136                storePassword props['keystore.password']
137                keyAlias props['keystore.alias']
138                keyPassword props['keystore.password']
139            }
140        }
141        buildTypes.release.signingConfig = signingConfigs.release
142    }
143
144    lintOptions {
145        disable 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
146    }
147
148    subprojects {
149
150        afterEvaluate {
151            if (getPlugins().hasPlugin('android') ||
152                    getPlugins().hasPlugin('android-library')) {
153
154                configure(android.lintOptions) {
155                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
156                }
157            }
158
159        }
160    }
161
162    packagingOptions {
163        exclude 'META-INF/BCKEY.DSA'
164        exclude 'META-INF/BCKEY.SF'
165    }
166}