2014-08-18 18:43:13 +00:00
|
|
|
apply plugin: 'com.android.application'
|
2019-05-06 07:01:33 +00:00
|
|
|
apply plugin: 'com.jaredsburrows.spoon'
|
2015-12-20 18:11:06 +00:00
|
|
|
apply plugin: 'kotlin-android'
|
2016-10-23 15:07:32 +00:00
|
|
|
apply plugin: 'kotlin-android-extensions'
|
2016-09-19 21:22:28 +00:00
|
|
|
apply plugin: 'kotlin-kapt'
|
2015-10-17 21:03:26 +00:00
|
|
|
apply plugin: 'de.mobilej.unmock'
|
2015-11-15 19:28:36 +00:00
|
|
|
apply plugin: 'com.github.ben-manes.versions'
|
2016-12-02 21:25:43 +00:00
|
|
|
apply plugin: 'com.github.triplet.play'
|
2013-08-01 18:50:41 +00:00
|
|
|
|
|
|
|
repositories {
|
2014-08-12 18:56:31 +00:00
|
|
|
jcenter()
|
2015-03-03 02:28:35 +00:00
|
|
|
mavenLocal()
|
2019-05-06 07:01:33 +00:00
|
|
|
google()
|
2019-09-17 12:40:34 +00:00
|
|
|
maven { url 'https://www.jitpack.io' }
|
2019-05-06 07:01:33 +00:00
|
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // For Spoon snapshot, until 2.0.0 is released
|
2013-08-01 18:50:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2015-01-25 23:07:50 +00:00
|
|
|
|
2019-05-06 07:01:33 +00:00
|
|
|
compileSdkVersion 28
|
|
|
|
buildToolsVersion "28.0.3"
|
2015-01-25 23:07:50 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
2018-09-13 17:25:47 +00:00
|
|
|
versionCode 349
|
|
|
|
versionName "3.4.9"
|
2019-05-06 07:01:33 +00:00
|
|
|
minSdkVersion 14
|
|
|
|
targetSdkVersion 28
|
2015-01-25 23:07:50 +00:00
|
|
|
applicationId "org.ligi.passandroid"
|
2016-10-24 17:13:03 +00:00
|
|
|
testInstrumentationRunner "org.ligi.passandroid.AppReplacingRunner"
|
2015-07-02 13:05:00 +00:00
|
|
|
archivesBaseName = "PassAndroid-$versionName"
|
2016-03-07 18:21:12 +00:00
|
|
|
vectorDrawables.useSupportLibrary = true
|
2015-01-25 23:07:50 +00:00
|
|
|
}
|
|
|
|
|
2014-04-27 03:51:18 +00:00
|
|
|
flavorDimensions "maps", "analytics", "distribution"
|
2014-01-15 23:42:39 +00:00
|
|
|
|
2013-08-19 12:24:41 +00:00
|
|
|
productFlavors {
|
2013-08-23 01:39:42 +00:00
|
|
|
|
2013-08-19 12:24:41 +00:00
|
|
|
withMaps {
|
2015-05-09 16:49:50 +00:00
|
|
|
dimension "maps"
|
2013-08-19 12:24:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
noMaps {
|
2015-05-09 16:49:50 +00:00
|
|
|
dimension "maps"
|
2013-08-19 12:24:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
withAnalytics {
|
2015-05-09 16:49:50 +00:00
|
|
|
dimension "analytics"
|
2013-08-19 12:24:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
noAnalytics {
|
2015-05-09 16:49:50 +00:00
|
|
|
dimension "analytics"
|
2013-08-19 12:24:41 +00:00
|
|
|
}
|
|
|
|
|
2014-01-16 00:34:32 +00:00
|
|
|
forFDroid {
|
2015-05-09 16:49:50 +00:00
|
|
|
dimension "distribution"
|
2014-01-16 00:34:32 +00:00
|
|
|
}
|
2014-01-15 23:42:39 +00:00
|
|
|
|
2014-01-16 00:34:32 +00:00
|
|
|
forPlay {
|
2015-05-09 16:49:50 +00:00
|
|
|
dimension "distribution"
|
2014-01-16 00:34:32 +00:00
|
|
|
}
|
2017-03-23 12:03:42 +00:00
|
|
|
forAmazon {
|
|
|
|
dimension "distribution"
|
|
|
|
}
|
|
|
|
|
2013-08-19 12:24:41 +00:00
|
|
|
}
|
2019-05-06 07:01:33 +00:00
|
|
|
|
|
|
|
// hacky workaround to add spoon task that executes all variants
|
|
|
|
task spoon {
|
|
|
|
dependsOn {
|
|
|
|
tasks.findAll { task -> task.name != 'spoon' && task.name.startsWith('spoon') }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-25 02:35:39 +00:00
|
|
|
android.variantFilter { variant ->
|
|
|
|
def maps = variant.getFlavors().get(0).name
|
|
|
|
def analytics = variant.getFlavors().get(1).name
|
|
|
|
def distribution = variant.getFlavors().get(2).name
|
|
|
|
|
2017-04-07 17:44:57 +00:00
|
|
|
variant.setIgnore((project.hasProperty("singleFlavor") && (distribution != 'forPlay'))
|
|
|
|
|| ((distribution == 'forAmazon' || distribution == 'forPlay') && analytics == 'noAnalytics')
|
2017-03-25 02:35:39 +00:00
|
|
|
|| ((distribution == 'forAmazon' || distribution == 'forPlay') && maps == 'noMaps')
|
|
|
|
|| (distribution == 'forFDroid' && analytics == 'withAnalytics')
|
2017-04-07 17:44:57 +00:00
|
|
|
|| (distribution == 'forFDroid' && maps == 'withMaps'))
|
2017-03-25 02:35:39 +00:00
|
|
|
}
|
2013-08-19 12:24:41 +00:00
|
|
|
|
2014-09-04 22:24:50 +00:00
|
|
|
packagingOptions {
|
2015-01-03 21:38:42 +00:00
|
|
|
// needed for assertJ
|
|
|
|
exclude 'asm-license.txt'
|
|
|
|
exclude 'LICENSE'
|
|
|
|
exclude 'NOTICE'
|
|
|
|
|
|
|
|
// hack for instrumentation testing :-(
|
|
|
|
exclude 'LICENSE.txt'
|
2015-12-21 01:21:42 +00:00
|
|
|
|
|
|
|
exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
|
|
|
|
exclude 'META-INF/maven/com.google.guava/guava/pom.xml'
|
2014-09-04 22:24:50 +00:00
|
|
|
}
|
|
|
|
|
2015-02-14 17:09:52 +00:00
|
|
|
lintOptions {
|
2015-10-04 19:07:35 +00:00
|
|
|
warning 'MissingTranslation'
|
|
|
|
warning 'InvalidPackage'
|
2015-02-14 17:09:52 +00:00
|
|
|
}
|
2016-01-25 23:19:15 +00:00
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled true
|
|
|
|
shrinkResources true
|
2016-02-18 21:18:16 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
|
2016-01-25 23:19:15 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-06 07:01:33 +00:00
|
|
|
compileOptions {
|
2019-10-28 13:46:04 +00:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
2019-05-06 07:01:33 +00:00
|
|
|
}
|
2017-04-10 13:24:59 +00:00
|
|
|
}
|
|
|
|
|
2013-11-25 22:19:53 +00:00
|
|
|
dependencies {
|
2019-10-28 07:15:41 +00:00
|
|
|
implementation 'org.permissionsdispatcher:permissionsdispatcher:4.5.0'
|
|
|
|
kapt 'org.permissionsdispatcher:permissionsdispatcher-processor:4.5.0'
|
2019-05-06 07:01:33 +00:00
|
|
|
|
|
|
|
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'
|
2019-10-28 13:49:37 +00:00
|
|
|
androidTestImplementation 'androidx.test:core:1.2.0'
|
2019-10-28 14:01:15 +00:00
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
2019-10-28 14:01:31 +00:00
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
|
2019-05-06 07:01:33 +00:00
|
|
|
androidTestImplementation 'com.squareup.assertj:assertj-android:1.2.0'
|
|
|
|
androidTestImplementation "org.mockito:mockito-core:$mockito_version"
|
2019-10-28 10:48:39 +00:00
|
|
|
androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito:2.25.0'
|
2019-05-06 07:01:33 +00:00
|
|
|
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'
|
2019-10-28 06:44:10 +00:00
|
|
|
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'
|
2019-05-06 07:01:33 +00:00
|
|
|
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'
|
|
|
|
|
2019-10-28 14:11:16 +00:00
|
|
|
implementation 'com.chibatching.kotpref:kotpref:2.9.2'
|
|
|
|
implementation 'com.chibatching.kotpref:initializer:2.9.2'
|
2019-10-28 14:11:51 +00:00
|
|
|
testImplementation 'androidx.annotation:annotation:1.1.0'
|
2019-05-06 07:01:33 +00:00
|
|
|
testImplementation 'com.squareup.assertj:assertj-android:1.2.0'
|
|
|
|
testImplementation 'junit:junit:4.12'
|
|
|
|
testImplementation "org.mockito:mockito-core:$mockito_version"
|
2019-10-28 11:45:33 +00:00
|
|
|
testImplementation 'org.threeten:threetenbp:1.4.0'
|
2015-08-11 12:36:10 +00:00
|
|
|
|
2018-01-21 15:40:32 +00:00
|
|
|
// https://github.com/ligi/PassAndroid/issues/181
|
2019-05-06 07:01:33 +00:00
|
|
|
// Don't upgrade before minSDK 19 - or replace zxing
|
|
|
|
//noinspection GradleDependency
|
|
|
|
implementation 'com.google.zxing:core:3.3.0'
|
2014-06-05 12:30:08 +00:00
|
|
|
|
2019-05-06 07:01:33 +00:00
|
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
|
|
|
|
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
|
2015-06-15 21:50:58 +00:00
|
|
|
|
2019-05-06 07:01:33 +00:00
|
|
|
// 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'
|
2013-11-25 22:19:53 +00:00
|
|
|
}
|
2015-09-08 22:04:58 +00:00
|
|
|
|
|
|
|
spoon {
|
|
|
|
debug = true
|
2019-05-06 07:01:33 +00:00
|
|
|
grantAll = true
|
|
|
|
baseOutputDir = "build/spoon"
|
2015-09-08 22:04:58 +00:00
|
|
|
}
|
|
|
|
|
2016-12-02 21:25:43 +00:00
|
|
|
play {
|
|
|
|
jsonFile = file('/media/ligi/USBCRED/play.json')
|
|
|
|
uploadImages = true
|
2019-05-06 07:01:33 +00:00
|
|
|
}
|