-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a version skipping mechanism for the AGP patch #111
Conversation
// Do a strict version check to ensure that our monkey-patching will work correctly. | ||
check(Version.ANDROID_GRADLE_PLUGIN_VERSION == TARGET_AGP_VERSION) { | ||
"This version of the Android Gradle Plugin (${Version.ANDROID_GRADLE_PLUGIN_VERSION}) is not supported by the better-dynamic-features plugin. Only version $TARGET_AGP_VERSION is supported." | ||
target.afterEvaluate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any chance this might not be needed, given that this callback should be called only when modules apply the application plugin? i'm always reluctant to add more afterEvaluate
blocks 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe push it out of here into its own global check, if it'd be a good idea to ensure an Android plugin is always applied for a module applying this plugin:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our use case, the agp-patch plugin is only applied to our main application module so that this version check runs.
The actual work of applying the "patch" is done by just including the plugin on the build classpath.
technically this block will also only run if the com.android.application
plugin is applied in the first place! (there's a plugins.withId()
block)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Usage: BDF targets 8.2.1 and you want to upgrade to 8.2.2 which you know is safe
betterDynamicFeaturesPatch { suppressVersionCheck("8.2.2") }