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    implementation 'org.sufficientlysecure:openpgp-api:10.0'
 38    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
 39    implementation "com.android.support:support-v13:$supportLibVersion"
 40    implementation "com.android.support:appcompat-v7:$supportLibVersion"
 41    implementation "com.android.support:cardview-v7:$supportLibVersion"
 42    implementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
 43    implementation "com.android.support:support-emoji:$supportLibVersion"
 44    implementation "com.android.support:design:$supportLibVersion"
 45    freeImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
 46    implementation 'org.bouncycastle:bcmail-jdk15on:1.58'
 47    implementation 'com.google.zxing:core:3.3.0'
 48    implementation 'de.measite.minidns:minidns-hla:0.2.4'
 49    implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
 50    implementation 'org.whispersystems:signal-protocol-java:2.6.2'
 51    implementation 'com.makeramen:roundedimageview:2.3.0'
 52    implementation "com.wefika:flowlayout:0.4.1"
 53    implementation 'net.ypresto.androidtranscoder:android-transcoder:0.2.0'
 54    implementation 'rocks.xmpp:xmpp-addr:0.8.0-SNAPSHOT'
 55    implementation 'org.osmdroid:osmdroid-android:6.0.1'
 56}
 57
 58ext {
 59    travisBuild = System.getenv("TRAVIS") == "true"
 60    preDexEnabled = System.getProperty("pre-dex", "true")
 61}
 62
 63android {
 64    compileSdkVersion 27
 65
 66    defaultConfig {
 67        minSdkVersion 19
 68        targetSdkVersion 25
 69        versionCode 272
 70        versionName "2.2.1"
 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")
 93
 94    productFlavors {
 95        playstore {
 96            dimension "distribution"
 97        }
 98        free {
 99            dimension "distribution"
100        }
101    }
102
103    buildTypes {
104        release {
105            shrinkResources true
106            minifyEnabled true
107            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
108        }
109        debug {
110            shrinkResources true
111            minifyEnabled true
112            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
113        }
114    }
115
116
117
118    if(new File("signing.properties").exists()) {
119        Properties props = new Properties()
120        props.load(new FileInputStream(file("signing.properties")))
121
122        signingConfigs {
123            release {
124                storeFile file(props['keystore'])
125                storePassword props['keystore.password']
126                keyAlias props['keystore.alias']
127                keyPassword props['keystore.password']
128            }
129        }
130        buildTypes.release.signingConfig = signingConfigs.release
131    }
132
133    lintOptions {
134        disable 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
135    }
136
137    subprojects {
138
139        afterEvaluate {
140            if (getPlugins().hasPlugin('android') ||
141                    getPlugins().hasPlugin('android-library')) {
142
143                configure(android.lintOptions) {
144                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
145                }
146            }
147
148        }
149    }
150
151    packagingOptions {
152        exclude 'META-INF/BCKEY.DSA'
153        exclude 'META-INF/BCKEY.SF'
154    }
155}