PassAndroid/android/build.gradle
2019-10-28 16:15:41 +09:00

204 lines
No EOL
7.1 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'com.jaredsburrows.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()
google()
maven { url 'https://www.jitpack.io' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // For Spoon snapshot, until 2.0.0 is released
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
versionCode 349
versionName "3.4.9"
minSdkVersion 14
targetSdkVersion 28
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"
}
}
// hacky workaround to add spoon task that executes all variants
task spoon {
dependsOn {
tasks.findAll { task -> task.name != 'spoon' && task.name.startsWith('spoon') }
}
}
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
implementation 'org.permissionsdispatcher:permissionsdispatcher:4.5.0'
kapt 'org.permissionsdispatcher:permissionsdispatcher-processor:4.5.0'
implementation 'com.github.salomonbrys.kodein:kodein:4.1.0'
compileOnly 'org.glassfish:javax.annotation:3.1.1'
// spoon snapshot, until 2.0.0 is released
androidTestImplementation 'com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT'
androidTestImplementation 'com.github.ligi:trulesk:0.28'
androidTestImplementation 'androidx.test:core:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.1'
androidTestImplementation 'com.squareup.assertj:assertj-android:1.2.0'
androidTestImplementation "org.mockito:mockito-core:$mockito_version"
androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.21.0'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.2'
androidTestImplementation 'androidx.appcompat:appcompat:1.0.2'
androidTestImplementation 'com.google.android.material:material:1.0.0'
implementation 'com.github.ligi:TouchImageView:2.1'
implementation 'com.github.ligi:ExtraCompats:0.5'
implementation 'net.lingala.zip4j:zip4j:1.3.2'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.annotation:annotation:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'net.i2p.android.ext:floatingactionbutton:1.10.1'
implementation 'com.github.ligi:KAXT:0.22'
implementation 'com.github.ligi:KAXTUI:0.8'
implementation 'com.github.ligi:loadtoast:1.10.11'
implementation 'com.github.ligi:tracedroid:2.1'
forPlayImplementation 'com.github.ligi.snackengage:snackengage-playrate:0.18'
forFDroidImplementation 'com.github.ligi.snackengage:snackengage-playrate:0.18'
forAmazonImplementation 'com.github.ligi.snackengage:snackengage-amazonrate:0.18'
// https://medium.com/square-corner-blog/okhttp-3-13-requires-android-5-818bb78d07ce
// Don't update to >=3.13 before minSDK 21 + Java 8
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.larswerkman:HoloColorPicker:1.5'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
// https://github.com/square/moshi/issues/738
// either wait for ProGuard update or use R8 instead (android.enableR8=true)
//noinspection GradleDependency
implementation 'com.squareup.moshi:moshi:1.7.0'
implementation 'com.chibatching.kotpref:kotpref:2.6.0'
implementation 'com.chibatching.kotpref:initializer:2.6.0'
testImplementation 'androidx.annotation:annotation:1.0.2'
testImplementation 'com.squareup.assertj:assertj-android:1.2.0'
testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation 'org.threeten:threetenbp:1.3.8'
// https://github.com/ligi/PassAndroid/issues/181
// Don't upgrade before minSDK 19 - or replace zxing
//noinspection GradleDependency
implementation 'com.google.zxing:core:3.3.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
// requires minSDK 16 according to docs, not sure if it causes an issue
withAnalyticsImplementation 'com.google.android.gms:play-services-analytics:16.0.8'
withMapsImplementation 'com.google.android.gms:play-services-maps:16.1.0'
}
spoon {
debug = true
grantAll = true
baseOutputDir = "build/spoon"
}
play {
jsonFile = file('/media/ligi/USBCRED/play.json')
uploadImages = true
}