refactor(convention): introduce internal android macrobenchmark convention plugin#509
Merged
Merged
Conversation
…ntion plugin Create AndroidMacroBenchmarkPlugin to consolidate and centralize shared configurations for macrobenchmark modules. - Extract common compile SDK, target SDK, and min SDK configurations. - Abstract the custom 'benchmark' build type setup. - Centralize required test and UI automator dependencies. - Apply the new mocca.android.macrobenchmark plugin to the mobile and wearos modules to drastically reduce boilerplate.
…benchmarks Introduces a specific macrobenchmark AndroidConfig configuration block within build-logic to decouple macrobenchmark SDK targets from the main mobile configuration. This sets the minimum SDK version for macrobenchmarks to API 24, as required by the library, and updates the AndroidMacroBenchmarkPlugin to utilize these new parameters. - Add macrobenchmark config with minSdkVersion = 24 - Update AndroidMacroBenchmarkPlugin to reference Config.macrobenchmark fields instead of Config.mobile
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the
AndroidMacroBenchmarkPluginto consolidate and centralize shared build configurations for our macrobenchmark modules. By abstracting this logic intobuild-logic, we remove significant boilerplate duplication from the mobile and Wear OS benchmark modules.Changes Made
AndroidMacroBenchmarkPlugin.ktto handlecom.android.testconfiguration, SDK versions viaConfig, custombenchmarkbuild types, and standard test/UI-automator dependencies.mocca.android.macrobenchmarkinbuild-logic/convention/build.gradle.kts.benchmarks/macro/mobile/build.gradle.ktsto use the new plugin ID and stripped out the redundant setup.benchmarks/macro/wearos/build.gradle.ktssimilarly, achieving identical build behavior with significantly less code.Verification Done
./gradlew :benchmarks:macro:mobile:assembleBenchmarkto ensure the mobile benchmark target compiles correctly../gradlew :benchmarks:macro:wearos:assembleBenchmarkto verify the Wear OS benchmark target setup.