-
Notifications
You must be signed in to change notification settings - Fork 95
Configure build logic and restructure gradle files #2827
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2827 +/- ##
=======================================
Coverage 78.28% 78.28%
=======================================
Files 330 330
Lines 12753 12753
Branches 1739 1739
=======================================
Hits 9984 9984
Misses 2038 2038
Partials 731 731 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tonidero
left a comment
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.
Looking amzing! Thanks for doing this! 🙇 I think the only important question is whether we're still publishing the customEntitlementComputation in the purchases module.
...ain/kotlin/com/revenuecat/purchases/android/buildlogic/convention/ConfigureAndroidLibrary.kt
Outdated
Show resolved
Hide resolved
| } | ||
| create("customEntitlementComputation") { | ||
| dimension = "apis" | ||
| missingDimensionStrategy("apis", "defaults") |
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.
Hmm I know this was like this before but is this needed? I would think that in this case, there wouldn't be a missing dimension case, since the dimension is created right?
| * Only applies publishing for variants that don't contain "customEntitlementComputation" | ||
| */ | ||
| internal fun Project.configureConditionalPublishing() { | ||
| if (!project.properties["ANDROID_VARIANT_TO_PUBLISH"].toString().contains("customEntitlementComputation")) { |
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.
Hmm I think this is applied to all public libraries, but we still want to be able to publish the CEC version of the purchases module right? We do want to skip it for the purchases-ui dependency + bom, so maybe we need to split this out somehow...
tonidero
left a comment
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.
So there were a bunch of conflicts with #2839 😢 sorry about that. Basically, I think it should just be applying the new flavor dimension billingclient (with bc8 and bc7 flavors) to the purchases, purchases-ui and purchase-store-amazon modules.
Otherwise, this PR looks good to me! Lmk if you need any help solving the conflicts, happy to help! 🙏
| */ | ||
| internal fun Project.configureApisFlavors() { | ||
| extensions.configure<LibraryExtension> { | ||
| flavorDimensions += "apis" |
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.
We will need to add another one like this for the billingclient dimension, that may have bc8 (default) or bc7 flavors. This should be configured for the purchases, purchases-ui and puchases-store-amazon dependencies. No need for the debugview dependency. Sorry for the conflicts 🙏
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.
Thank you for the detailed histories! 🙏 I just resolved the conflicts and configured the billingclient dimension on b011871.
Resolved conflicts by: - Adding billingclient dimension (bc7/bc8) to purchases, purchases-ui, and purchases-store-amazon modules - Removing duplicate 'apis' flavor dimension configuration (now handled by convention plugin) - Keeping debugview without billingclient dimension as it doesn't need it - Adding missingDimensionStrategy for billingclient to integration-tests - Removing old .gradle files in favor of .kts versions The billingclient dimension from PR #2839 is now integrated with the convention plugin structure from this PR.
The debugview module needs the billingclient dimension to match the ANDROID_VARIANT_TO_PUBLISH=defaultsBc8Release configuration in gradle.properties. Without this dimension, the maven publish plugin fails because it can't find the expected variant. Even though debugview doesn't have flavor-specific source code like purchases module does, it needs the dimension for publishing compatibility.
|
Amazing work! Nice to clean this up! 🙌 |
|
I am so excited about this! Thanks @skydoves 🙌 |
Extracted duplicated Gradle build configuration from individual module build files into a centralized build-logic convention plugin system with reusable plugins, the build-logic configuration. I followed our KMP project (https://github.com/RevenueCat/purchases-kmp) for the overall structures.
Advantages of this build logic structure: