Skip to content

Instantly share code, notes, and snippets.

@cbeyls
Last active April 20, 2023 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbeyls/464abb0d8d6cefa55fbad2d9f30c07ac to your computer and use it in GitHub Desktop.
Save cbeyls/464abb0d8d6cefa55fbad2d9f30c07ac to your computer and use it in GitHub Desktop.
Automatically patch Android desugaring configuration to set "support_all_callbacks_from_library" flag to false
static def patchDesugarConfig(Property<String> config) {
def patchedDesugarConfig = config.getProvider().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).configureEach {
patchDesugarConfig(coreLibDesugarConfig)
}
tasks.withType(com.android.build.gradle.internal.tasks.L8DexDesugarLibTask).configureEach {
patchDesugarConfig(libConfiguration)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment