Main goals are: 1. Ability to use mocks in unit tests instead of having to setup mock web server as if it was an integration test. 2. Cache Retrofit services in memory 3. Make it easier to read 4. Use OptIn where possible instead of propagating Experimental* annotations everywhere
181 lines
7.1 KiB
Groovy
181 lines
7.1 KiB
Groovy
plugins {
|
|
id 'kotlin-android'
|
|
id 'kotlin-kapt'
|
|
id 'com.android.application'
|
|
id 'androidx.navigation.safeargs.kotlin'
|
|
id 'dagger.hilt.android.plugin'
|
|
id 'org.jetbrains.kotlin.plugin.serialization'
|
|
}
|
|
|
|
android {
|
|
compileSdk 31
|
|
|
|
defaultConfig {
|
|
applicationId "gq.kirmanak.mealient"
|
|
minSdk 21
|
|
targetSdk 31
|
|
versionCode 5
|
|
versionName "0.1.4"
|
|
}
|
|
|
|
signingConfigs {
|
|
release {
|
|
rootProject.file("keystore.properties").with { keystorePropertiesFile ->
|
|
if (keystorePropertiesFile.canRead()) {
|
|
def keystoreProperties = new Properties()
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
} else {
|
|
println 'Unable to read keystore.properties'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'
|
|
}
|
|
release {
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
signingConfig signingConfigs.release
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = '1.8'
|
|
}
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
lintOptions {
|
|
disable 'ObsoleteLintCustomCheck', 'IconMissingDensityFolder'
|
|
enable 'ConvertToWebp', 'DuplicateStrings', 'EasterEgg', 'ExpensiveAssertion', 'IconExpectedSize', 'ImplicitSamInstance', 'InvalidPackage', 'KotlinPropertyAccess', 'LambdaLast', 'MinSdkTooLow', 'NegativeMargin', 'NoHardKeywords', 'Registered', 'RequiredSize', 'UnknownNullness', 'WrongThreadInterprocedural'
|
|
}
|
|
testOptions {
|
|
unitTests {
|
|
includeAndroidResources = true
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
kotlinOptions {
|
|
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// https://github.com/material-components/material-components-android
|
|
implementation "com.google.android.material:material:1.5.0"
|
|
|
|
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
|
|
implementation "androidx.navigation:navigation-runtime-ktx:$nav_version"
|
|
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
|
|
|
|
// https://developer.android.com/kotlin/ktx#core
|
|
implementation "androidx.core:core-ktx:1.7.0"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/appcompat
|
|
implementation "androidx.appcompat:appcompat:1.4.1"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/constraintlayout
|
|
implementation "androidx.constraintlayout:constraintlayout:2.1.3"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
|
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/lifecycle
|
|
def lifecycle_version = "2.4.1"
|
|
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
|
|
|
implementation "com.google.dagger:hilt-android:$hilt_version"
|
|
kapt "com.google.dagger:hilt-compiler:$hilt_version"
|
|
kaptTest "com.google.dagger:hilt-android-compiler:$hilt_version"
|
|
testImplementation "com.google.dagger:hilt-android-testing:$hilt_version"
|
|
|
|
// https://github.com/square/retrofit/tags
|
|
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
|
|
|
// https://github.com/JakeWharton/retrofit2-kotlinx-serialization-converter/tags
|
|
implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0"
|
|
|
|
// https://github.com/square/okhttp/tags
|
|
implementation platform("com.squareup.okhttp3:okhttp-bom:4.9.3")
|
|
implementation "com.squareup.okhttp3:okhttp"
|
|
debugImplementation "com.squareup.okhttp3:logging-interceptor"
|
|
|
|
// https://github.com/Kotlin/kotlinx.serialization/releases
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/preference
|
|
implementation "androidx.preference:preference-ktx:1.2.0"
|
|
|
|
// https://github.com/JakeWharton/timber/releases
|
|
implementation 'com.jakewharton.timber:timber:5.0.1'
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/paging
|
|
def paging_version = "3.1.1"
|
|
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
|
|
testImplementation "androidx.paging:paging-common-ktx:$paging_version"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/room
|
|
def room_version = "2.4.2"
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
implementation "androidx.room:room-ktx:$room_version"
|
|
implementation "androidx.room:room-paging:$room_version"
|
|
kapt "androidx.room:room-compiler:$room_version"
|
|
testImplementation "androidx.room:room-testing:$room_version"
|
|
|
|
// https://github.com/Kotlin/kotlinx-datetime/releases
|
|
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.3.1"
|
|
|
|
// https://github.com/square/picasso/releases
|
|
implementation "com.squareup.picasso:picasso:2.8"
|
|
|
|
// https://github.com/junit-team/junit4/releases
|
|
testImplementation "junit:junit:4.13.2"
|
|
|
|
// https://github.com/Kotlin/kotlinx.coroutines/releases
|
|
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0"
|
|
|
|
// https://github.com/robolectric/robolectric/releases
|
|
testImplementation "org.robolectric:robolectric:4.7.3"
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/test
|
|
testImplementation "androidx.test.ext:junit-ktx:1.1.3"
|
|
|
|
// https://mvnrepository.com/artifact/com.google.truth/truth
|
|
testImplementation "com.google.truth:truth:1.1.3"
|
|
|
|
// https://mockk.io/
|
|
testImplementation "io.mockk:mockk:1.12.3"
|
|
|
|
// https://github.com/androidbroadcast/ViewBindingPropertyDelegate/releases
|
|
implementation "com.github.kirich1409:viewbindingpropertydelegate-noreflection:1.5.6"
|
|
|
|
// https://github.com/facebook/flipper/releases
|
|
def flipper_version = "0.140.0"
|
|
debugImplementation "com.facebook.flipper:flipper:$flipper_version"
|
|
debugImplementation "com.facebook.flipper:flipper-leakcanary2-plugin:$flipper_version"
|
|
debugImplementation "com.facebook.flipper:flipper-network-plugin:$flipper_version"
|
|
|
|
// https://github.com/facebook/SoLoader/releases
|
|
debugImplementation "com.facebook.soloader:soloader:0.10.3"
|
|
|
|
// https://github.com/square/leakcanary/releases
|
|
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.8.1"
|
|
|
|
} |