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.2'
 10    }
 11}
 12
 13apply plugin: 'com.android.application'
 14
 15repositories {
 16    jcenter()
 17    mavenCentral()
 18    maven {
 19        url 'https://maven.google.com'
 20    }
 21    maven {
 22        url "https://oss.sonatype.org/content/repositories/snapshots"
 23    }
 24}
 25
 26configurations {
 27    playstoreImplementation
 28    freeImplementation
 29}
 30
 31ext {
 32    supportLibVersion = '27.1.1'
 33}
 34
 35dependencies {
 36    playstoreImplementation('com.google.firebase:firebase-messaging:15.0.2') {
 37        exclude group: 'com.google.firebase', module: 'firebase-core'
 38    }
 39    implementation 'org.sufficientlysecure:openpgp-api:10.0'
 40    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
 41    implementation "com.android.support:support-v13:$supportLibVersion"
 42    implementation "com.android.support:appcompat-v7:$supportLibVersion"
 43    implementation "com.android.support:cardview-v7:$supportLibVersion"
 44    implementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
 45    implementation "com.android.support:support-emoji:$supportLibVersion"
 46    implementation "com.android.support:design:$supportLibVersion"
 47    freeImplementation "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.21@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-SNAPSHOT'
 57    implementation 'org.osmdroid:osmdroid-android:6.0.1'
 58}
 59
 60ext {
 61    travisBuild = System.getenv("TRAVIS") == "true"
 62    preDexEnabled = System.getProperty("pre-dex", "true")
 63}
 64
 65android {
 66    compileSdkVersion 27
 67
 68    defaultConfig {
 69        minSdkVersion 19
 70        targetSdkVersion 25
 71        versionCode 272
 72        versionName "2.2.1"
 73        archivesBaseName += "-$versionName"
 74        applicationId "eu.siacs.conversations"
 75        resValue "string", "applicationId", applicationId
 76        resValue "string", "app_name", "Conversations"
 77    }
 78
 79    dataBinding {
 80        enabled true
 81    }
 82
 83    dexOptions {
 84        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
 85        preDexLibraries = preDexEnabled && !travisBuild
 86        jumboMode true
 87    }
 88
 89    compileOptions {
 90        sourceCompatibility JavaVersion.VERSION_1_8
 91        targetCompatibility JavaVersion.VERSION_1_8
 92    }
 93
 94    flavorDimensions("distribution")
 95
 96    productFlavors {
 97        playstore {
 98            dimension "distribution"
 99        }
100        free {
101            dimension "distribution"
102        }
103    }
104
105    buildTypes {
106        release {
107            shrinkResources true
108            minifyEnabled true
109            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
110        }
111        debug {
112            shrinkResources true
113            minifyEnabled true
114            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
115        }
116    }
117
118
119
120    if(new File("signing.properties").exists()) {
121        Properties props = new Properties()
122        props.load(new FileInputStream(file("signing.properties")))
123
124        signingConfigs {
125            release {
126                storeFile file(props['keystore'])
127                storePassword props['keystore.password']
128                keyAlias props['keystore.alias']
129                keyPassword props['keystore.password']
130            }
131        }
132        buildTypes.release.signingConfig = signingConfigs.release
133    }
134
135    lintOptions {
136        disable 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
137    }
138
139    subprojects {
140
141        afterEvaluate {
142            if (getPlugins().hasPlugin('android') ||
143                    getPlugins().hasPlugin('android-library')) {
144
145                configure(android.lintOptions) {
146                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
147                }
148            }
149
150        }
151    }
152
153    packagingOptions {
154        exclude 'META-INF/BCKEY.DSA'
155        exclude 'META-INF/BCKEY.SF'
156    }
157}