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.0.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://jitpack.io"
 23    }
 24    maven {
 25        url "https://oss.sonatype.org/content/repositories/snapshots"
 26    }
 27}
 28
 29configurations {
 30    playstoreImplementation
 31    freeImplementation
 32}
 33
 34ext {
 35    supportLibVersion = '27.1.0'
 36}
 37
 38dependencies {
 39    implementation project(':libs:EnhancedListView')
 40    playstoreImplementation 'com.google.android.gms:play-services-gcm:11.8.0'
 41    implementation 'org.sufficientlysecure:openpgp-api:10.0'
 42    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
 43    implementation "com.android.support:support-v13:$supportLibVersion"
 44    implementation "com.android.support:appcompat-v7:$supportLibVersion"
 45    implementation "com.android.support:cardview-v7:$supportLibVersion"
 46    implementation "com.android.support:support-emoji-appcompat:$supportLibVersion"
 47    implementation "com.android.support:support-emoji:$supportLibVersion"
 48    implementation "com.android.support:design:$supportLibVersion"
 49    freeImplementation "com.android.support:support-emoji-bundled:$supportLibVersion"
 50    implementation 'org.bouncycastle:bcmail-jdk15on:1.58'
 51    implementation 'org.gnu.inet:libidn:1.15'
 52    implementation 'com.google.zxing:core:3.3.0'
 53    implementation 'de.measite.minidns:minidns-hla:0.2.4'
 54    implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
 55    implementation 'org.whispersystems:signal-protocol-java:2.6.2'
 56    implementation 'com.makeramen:roundedimageview:2.3.0'
 57    implementation "com.wefika:flowlayout:0.4.1"
 58    implementation 'net.ypresto.androidtranscoder:android-transcoder:0.2.0'
 59    implementation 'rocks.xmpp:xmpp-addr:0.8.0-SNAPSHOT'
 60}
 61
 62ext {
 63    travisBuild = System.getenv("TRAVIS") == "true"
 64    preDexEnabled = System.getProperty("pre-dex", "true")
 65}
 66
 67android {
 68    compileSdkVersion 27
 69    buildToolsVersion "27.0.3"
 70
 71    defaultConfig {
 72        minSdkVersion 19
 73        targetSdkVersion 25
 74        versionCode 259
 75        versionName "2.0.0-beta.4"
 76        archivesBaseName += "-$versionName"
 77        applicationId "eu.siacs.conversations"
 78        resValue "string", "applicationId", applicationId
 79        resValue "string", "app_name", "Conversations"
 80    }
 81
 82    dataBinding {
 83        enabled true
 84    }
 85
 86    dexOptions {
 87        // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
 88        preDexLibraries = preDexEnabled && !travisBuild
 89        jumboMode true
 90    }
 91
 92    compileOptions {
 93        sourceCompatibility JavaVersion.VERSION_1_8
 94        targetCompatibility JavaVersion.VERSION_1_8
 95    }
 96
 97    flavorDimensions("distribution")
 98
 99    productFlavors {
100        playstore {
101            dimension "distribution"
102        }
103        free {
104            dimension "distribution"
105        }
106    }
107
108    buildTypes {
109        release {
110            shrinkResources true
111            minifyEnabled true
112            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
113        }
114        debug {
115            shrinkResources true
116            minifyEnabled true
117            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
118        }
119    }
120
121
122
123    if(new File("signing.properties").exists()) {
124        Properties props = new Properties()
125        props.load(new FileInputStream(file("signing.properties")))
126
127        signingConfigs {
128            release {
129                storeFile file(props['keystore'])
130                storePassword props['keystore.password']
131                keyAlias props['keystore.alias']
132                keyPassword props['keystore.password']
133            }
134        }
135        buildTypes.release.signingConfig = signingConfigs.release
136    }
137
138    lintOptions {
139        disable 'MissingTranslation', 'InvalidPackage', 'MissingQuantity', 'AppCompatResource'
140    }
141
142    subprojects {
143
144        afterEvaluate {
145            if (getPlugins().hasPlugin('android') ||
146                    getPlugins().hasPlugin('android-library')) {
147
148                configure(android.lintOptions) {
149                    disable 'AndroidGradlePluginVersion', 'MissingTranslation'
150                }
151            }
152
153        }
154    }
155
156    packagingOptions {
157        exclude 'META-INF/BCKEY.DSA'
158        exclude 'META-INF/BCKEY.SF'
159    }
160}