Last active
April 20, 2023 19:07
-
-
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
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
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