1
0
Fork 0
mirror of https://github.com/MatomoCamp/matomocamp-companion-android.git synced 2024-09-19 16:13:46 +02:00

optimize desugaring to remove all unused classes

This commit is contained in:
Christophe Beyls 2022-01-09 17:26:07 +01:00
parent 61f8e2fca3
commit a3d2efefbd

View file

@ -76,6 +76,28 @@ android {
}
}
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.0"