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