Created
December 1, 2023 14:25
-
-
Save cbeyls/c67cc6b3eacba9313ff0774844f55ff3 to your computer and use it in GitHub Desktop.
Automatically patch Android desugaring configuration to set "support_all_callbacks_from_library" flag to false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun patchDesugarConfig(config: Property<String>) { | |
val defaultConfig = config as org.gradle.api.internal.provider.DefaultProperty<String> | |
val patchedDesugarConfig = defaultConfig.provider.map { | |
it.replace( | |
"\"support_all_callbacks_from_library\":true", | |
"\"support_all_callbacks_from_library\":false" | |
) | |
} | |
config.set(patchedDesugarConfig) | |
} | |
afterEvaluate { | |
tasks.withType(com.android.build.gradle.internal.tasks.R8Task::class).configureEach { | |
patchDesugarConfig(coreLibDesugarConfig) | |
} | |
tasks.withType(com.android.build.gradle.internal.tasks.L8DexDesugarLibTask::class).configureEach { | |
patchDesugarConfig(libConfiguration) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment