Skip to content

Instantly share code, notes, and snippets.

@itsmefox
Forked from solohsu/macos-arm-workaround.gradle
Created January 11, 2022 08:30
Show Gist options
  • Save itsmefox/5626a3c7b63f399f424cd3ed5165621e to your computer and use it in GitHub Desktop.
Save itsmefox/5626a3c7b63f399f424cd3ed5165621e to your computer and use it in GitHub Desktop.
// apply this script into the build.gradle of modules which you have applied protobuf plugin
// also, this can be used to workaround others plugins not supporting macOS M1 soc, e.g. AndResGuard
// to support AndResGuard, append `|| it.name == "AndResGuardLocatorSevenZip"`
// to the configuration matching condition sentence
configurations.matching {
it.name.startsWith("protobufToolsLocator_")
}.configureEach {
withDependencies { deps ->
deps.matching { it instanceof ExternalDependency }.configureEach {
it.artifacts.each {
if (it.classifier == "osx-aarch_64") {
it.setClassifier("osx-x86_64")
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment