1
0
Fork 0
mirror of https://github.com/MatomoCamp/matomocamp-companion-android.git synced 2024-09-19 16:13:46 +02:00
matomocamp-companion-android/app/build.gradle
Christophe Beyls a6e65aee19
Remove SavedStateHandle implementation
Restore ViewModel state manually from View state instead
+ upgrade various libraries.
2022-01-21 10:32:47 +01:00

137 lines
4.7 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
applicationId "be.digitalia.fosdem"
minSdkVersion 19
targetSdkVersion 31
multiDexEnabled = true
versionCode 1700205
versionName "2.0.5"
// Supported languages
resConfigs "en"
vectorDrawables.useSupportLibrary = true
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.incremental": "true"]
}
}
}
sourceSets {
main {
res.srcDirs += 'src/main/res-override'
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles 'proguard-defaults.txt', 'proguard-rules.pro'
kotlinOptions {
freeCompilerArgs = [
'-Xno-param-assertions',
'-Xno-call-assertions',
'-Xno-receiver-assertions'
]
}
packagingOptions {
exclude 'androidsupportmultidexversion.txt'
exclude 'DebugProbesKt.bin'
exclude 'kotlin-tooling-metadata.json'
}
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
freeCompilerArgs = [
'-Xopt-in=kotlin.RequiresOptIn'
]
jvmTarget = "1.8"
}
packagingOptions {
exclude 'kotlin/**'
exclude 'META-INF/*.kotlin_module'
exclude 'META-INF/*.version'
}
}
afterEvaluate {
// Update configuration of the R8 tasks to optimize desugaring shrinker
def originalSetting = "\"support_all_callbacks_from_library\": true"
def replacementSetting = "\"support_all_callbacks_from_library\": false"
tasks.findAll { task -> task.getClass().getSimpleName().startsWith("R8Task") }.each { task ->
task.configure {
def patchedDesugarConfig = coreLibDesugarConfig.getProvider().map {
it.replace(originalSetting, replacementSetting)
}
coreLibDesugarConfig.set(patchedDesugarConfig)
}
}
tasks.findAll { task -> task.getClass().getSimpleName().startsWith("L8DexDesugarLibTask") }.each { task ->
task.configure {
def patchedDesugarConfig = libConfiguration.getProvider().map {
it.replace(originalSetting, replacementSetting)
}
libConfiguration.set(patchedDesugarConfig)
}
}
}
dependencies {
def lifecycle_version = "2.4.0"
def room_version = "2.4.1"
def okhttp_version = "3.12.13"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation "androidx.multidex:multidex:2.0.1"
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.activity:activity-ktx:1.4.0'
implementation 'androidx.fragment:fragment-ktx:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.browser:browser:1.4.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation 'androidx.paging:paging-runtime-ktx:2.1.2'
implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.datastore:datastore-preferences:1.0.0"
kapt "androidx.room:room-compiler:$room_version"
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation("com.squareup.okhttp3:okhttp-tls:$okhttp_version") {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
}
implementation 'com.squareup.okio:okio:3.0.0'
implementation 'com.squareup.moshi:moshi:1.13.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
}