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:
parent
61f8e2fca3
commit
a3d2efefbd
1 changed files with 23 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue