199 lines
6.4 KiB
Groovy
199 lines
6.4 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'spoon'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
apply plugin: 'kotlin-kapt'
|
|
apply plugin: 'de.mobilej.unmock'
|
|
apply plugin: 'com.github.ben-manes.versions'
|
|
apply plugin: 'com.github.triplet.play'
|
|
|
|
repositories {
|
|
jcenter()
|
|
mavenLocal()
|
|
maven { url 'https://jitpack.io' }
|
|
maven { url 'https://maven.google.com' }
|
|
}
|
|
|
|
android {
|
|
|
|
compileSdkVersion 25
|
|
buildToolsVersion "25.0.3"
|
|
|
|
defaultConfig {
|
|
versionCode 346
|
|
versionName "3.4.6"
|
|
minSdkVersion 9
|
|
targetSdkVersion 25
|
|
applicationId "org.ligi.passandroid"
|
|
testInstrumentationRunner "org.ligi.passandroid.AppReplacingRunner"
|
|
archivesBaseName = "PassAndroid-$versionName"
|
|
vectorDrawables.useSupportLibrary = true
|
|
}
|
|
|
|
flavorDimensions "maps", "analytics", "distribution"
|
|
|
|
productFlavors {
|
|
|
|
withMaps {
|
|
dimension "maps"
|
|
}
|
|
|
|
noMaps {
|
|
dimension "maps"
|
|
}
|
|
|
|
withAnalytics {
|
|
dimension "analytics"
|
|
}
|
|
|
|
noAnalytics {
|
|
dimension "analytics"
|
|
}
|
|
|
|
forFDroid {
|
|
dimension "distribution"
|
|
}
|
|
|
|
forPlay {
|
|
dimension "distribution"
|
|
}
|
|
forAmazon {
|
|
dimension "distribution"
|
|
}
|
|
|
|
}
|
|
android.variantFilter { variant ->
|
|
def maps = variant.getFlavors().get(0).name
|
|
def analytics = variant.getFlavors().get(1).name
|
|
def distribution = variant.getFlavors().get(2).name
|
|
|
|
variant.setIgnore((project.hasProperty("singleFlavor") && (distribution != 'forPlay'))
|
|
|| ((distribution == 'forAmazon' || distribution == 'forPlay') && analytics == 'noAnalytics')
|
|
|| ((distribution == 'forAmazon' || distribution == 'forPlay') && maps == 'noMaps')
|
|
|| (distribution == 'forFDroid' && analytics == 'withAnalytics')
|
|
|| (distribution == 'forFDroid' && maps == 'withMaps'))
|
|
}
|
|
|
|
packagingOptions {
|
|
// needed for assertJ
|
|
exclude 'asm-license.txt'
|
|
exclude 'LICENSE'
|
|
exclude 'NOTICE'
|
|
|
|
// hack for instrumentation testing :-(
|
|
exclude 'LICENSE.txt'
|
|
|
|
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
|
|
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
|
|
|
|
}
|
|
|
|
lintOptions {
|
|
warning 'MissingTranslation'
|
|
warning 'InvalidPackage'
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
|
|
}
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
|
|
// http://stackoverflow.com/questions/30578243/why-would-adding-espresso-contrib-cause-an-inflateexception
|
|
androidTestCompile.exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
androidTestCompile.exclude group: 'com.android.support', module: 'design'
|
|
androidTestCompile.exclude group: 'com.android.support', module: 'support-v4'
|
|
androidTestCompile.exclude group: 'com.android.support', module: 'support-annotations'
|
|
androidTestCompile.exclude group: 'com.android.support', module: 'preference-v7'
|
|
androidTestCompile.exclude module: 'recyclerview-v7'
|
|
androidTestCompile.exclude module: 'kotlin-stdlib'
|
|
}
|
|
|
|
dependencies {
|
|
compile 'com.github.hotchemi:permissionsdispatcher:2.3.2'
|
|
kapt 'com.github.hotchemi:permissionsdispatcher-processor:2.3.2'
|
|
|
|
compile 'com.github.salomonbrys.kodein:kodein:4.1.0'
|
|
|
|
provided 'org.glassfish:javax.annotation:10.0-b28'
|
|
|
|
androidTestCompile 'com.github.ligi:trulesk:0.21'
|
|
|
|
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:3.0.1'
|
|
|
|
androidTestCompile 'com.squareup.assertj:assertj-android:1.1.1'
|
|
|
|
androidTestCompile "org.mockito:mockito-core:$mockito_version"
|
|
androidTestCompile 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0'
|
|
|
|
androidTestCompile 'com.google.code.findbugs:jsr305:3.0.2'
|
|
|
|
androidTestCompile "com.android.support:appcompat-v7:$support_version"
|
|
androidTestCompile "com.android.support:design:$support_version"
|
|
|
|
compile 'com.github.ligi:TouchImageView:2.1'
|
|
compile 'com.github.ligi:ExtraCompats:0.4'
|
|
|
|
compile 'net.lingala.zip4j:zip4j:1.3.2'
|
|
compile 'com.jakewharton.threetenabp:threetenabp:1.1.0'
|
|
compile 'org.greenrobot:eventbus:3.0.0'
|
|
|
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
|
|
compile "com.android.support:support-annotations:$support_version"
|
|
compile "com.android.support:recyclerview-v7:$support_version"
|
|
compile "com.android.support:appcompat-v7:$support_version"
|
|
compile "com.android.support:cardview-v7:$support_version"
|
|
compile "com.android.support:design:$support_version"
|
|
compile "com.android.support:preference-v7:$support_version"
|
|
|
|
compile 'net.i2p.android.ext:floatingactionbutton:1.10.1'
|
|
|
|
compile 'com.github.ligi:KAXT:0.19'
|
|
compile 'com.github.ligi:KAXTUI:0.4'
|
|
compile 'com.github.ligi:loadtoast:1.10.11'
|
|
compile 'com.github.ligi:tracedroid:1.4'
|
|
|
|
forPlayCompile 'com.github.ligi.snackengage:snackengage-playrate:0.15'
|
|
forFDroidCompile 'com.github.ligi.snackengage:snackengage-playrate:0.15'
|
|
forAmazonCompile 'com.github.ligi.snackengage:snackengage-amazonrate:0.15'
|
|
|
|
compile 'com.squareup.okhttp3:okhttp:3.11.0'
|
|
compile 'com.larswerkman:HoloColorPicker:1.5'
|
|
compile 'com.google.code.findbugs:jsr305:3.0.2'
|
|
compile 'com.squareup.moshi:moshi:1.4.0'
|
|
|
|
compile "com.chibatching.kotpref:kotpref:2.5.0"
|
|
compile "com.chibatching.kotpref:initializer:2.5.0"
|
|
|
|
testCompile "com.android.support:support-annotations:$support_version"
|
|
testCompile 'com.squareup.assertj:assertj-android:1.1.1'
|
|
testCompile 'junit:junit:4.12'
|
|
testCompile "org.mockito:mockito-core:${mockito_version}"
|
|
testCompile 'org.threeten:threetenbp:1.3.6'
|
|
|
|
// https://github.com/ligi/PassAndroid/issues/181
|
|
// Don't update to 3.3.1 before minSDK 19 - or replace zxing
|
|
compile 'com.google.zxing:core:3.3.0'
|
|
|
|
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4'
|
|
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4'
|
|
|
|
withAnalyticsCompile "com.google.android.gms:play-services-analytics:$play_version"
|
|
withMapsCompile "com.google.android.gms:play-services-maps:$play_version"
|
|
}
|
|
|
|
spoon {
|
|
debug = true
|
|
grantAllPermissions = true
|
|
}
|
|
|
|
play {
|
|
jsonFile = file('/media/ligi/USBCRED/play.json')
|
|
uploadImages = true
|
|
}
|