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.1'
 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.android.gms:play-services-gcm:15.0.0'
 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}
 56
 57ext {
 58    travisBuild = System.getenv("TRAVIS") == "true"
 59    preDexEnabled = System.getProperty("pre-dex", "true")
 60}
 61
 62android {
 63    compileSdkVersion 27
 64
 65    defaultConfig {
 66        minSdkVersion 19
 67        targetSdkVersion 25
 68        versionCode 266
 69        versionName "2.1.2"
 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")
 92
 93    productFlavors {
 94        playstore {
 95            dimension "distribution"
 96        }
 97        free {
 98            dimension "distribution"
 99        }
100    }
101
102    buildTypes {
103        release {
104            shrinkResources true
105            minifyEnabled true
106            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
107        }
108        debug {
109            shrinkResources true
110            minifyEnabled true
111            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
112        }
113    }
114
115
116
117    if(new File("signing.properties").exists()) {
118        Properties props = new Properties()
119        props.load(new FileInputStream(file("signing.properties")))
120
121        signingConfigs {
122            release {
123                storeFile file(props['keystore'])
124                storePassword props['keystore.password']
125                keyAlias props['keystore.alias']
126                keyPassword props['keystore.password']
127            }
128        }
129        buildTypes.release.signingConfig = signingConfigs.release
130    }
131
132    lintOptions {
133        disable 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
134    }
135
136    subprojects {
137
138        afterEvaluate {
139            if (getPlugins().hasPlugin('android') ||
140                    getPlugins().hasPlugin('android-library')) {
141
142                configure(android.lintOptions) {
143                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
144                }
145            }
146
147        }
148    }
149
150    packagingOptions {
151        exclude 'META-INF/BCKEY.DSA'
152        exclude 'META-INF/BCKEY.SF'
153    }
154}