Skip to content

Remove customEntitlementComputation flavor for non-purchases modules#1180

Merged
tonidero merged 1 commit into
mainfrom
remove-custom-entitlement-computation-flavor-for-non-purchases-modules
Aug 3, 2023
Merged

Remove customEntitlementComputation flavor for non-purchases modules#1180
tonidero merged 1 commit into
mainfrom
remove-custom-entitlement-computation-flavor-for-non-purchases-modules

Conversation

@tonidero

Copy link
Copy Markdown
Contributor

Description

This reverts the changes in #1169, and additionally makes some changes so we only apply the maven publish plugin when using the defaults flavor in non-purchases modules. This should avoid having to have extra flavors in those modules and having them support the customEntitlementComputation flavor.

This was becoming a bit of a problem as I was working in the debug view #1075. Since some of the functions I'm using aren't in the customEntitlementComputation flavor. I could have split the debug view library by flavor to make it compatible, but that seems like unnecessary work.

@tonidero tonidero added the build label Jul 27, 2023
}

if (!project.getProperties()["ANDROID_VARIANT_TO_PUBLISH"].contains("customEntitlementComputation")) {
apply plugin: "com.vanniktech.maven.publish"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't like how many hardcoded strings I had to add here (property name, property value, plugin name... But I think it should be ok? Open to thoughts if anyone has other ideas.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do the if inside the plugins block? I assume you can't and that's why you put it here.

Also, is it possible to do this?

if (!project.getProperties()["ANDROID_VARIANT_TO_PUBLISH"].contains("customEntitlementComputation")) {
	plugins {
	  alias libs.plugins.mavenPublish
	}
}

Alternatively, you can do this I think https://stackoverflow.com/a/53408667 , but I don't think it's better

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried putting the if inside the plugins block and it didn't work. Also tried using the alias format without luck, so was forced to use the old format :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for using flavors... That would only help for the condition, but not the format right? As in, we would still have to use apply plugin....

@codecov

codecov Bot commented Jul 27, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.75%. Comparing base (150ea37) to head (8671443).
Report is 550 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1180   +/-   ##
=======================================
  Coverage   85.75%   85.75%           
=======================================
  Files         180      180           
  Lines        6178     6178           
  Branches      893      893           
=======================================
  Hits         5298     5298           
  Misses        545      545           
  Partials      335      335           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tonidero tonidero marked this pull request as ready for review July 28, 2023 08:16
@tonidero tonidero requested a review from a team July 28, 2023 08:16
@tonidero

tonidero commented Aug 3, 2023

Copy link
Copy Markdown
Contributor Author

Merging this, but lmk if you have any other thoughts!

@tonidero tonidero merged commit 379c462 into main Aug 3, 2023
@tonidero tonidero deleted the remove-custom-entitlement-computation-flavor-for-non-purchases-modules branch August 3, 2023 07:53
tonidero added a commit that referenced this pull request Aug 3, 2023
### Description
Same as was added in iOS in
RevenueCat/purchases-ios#2567. Includes the
changes in #1180

This PR adds a debug view in the Android SDK and uses it in the
`MagicWeatherCompose` sample app. This debug view is meant to be a
Jetpack compose function, even though later we might add convenience
accessors for people not using jetpack compose. It's extracted to a
different module so it can be published separately from the main SDK. It
also attempts to keep all the code in the debug source set, to try to
include as few code in the release variants.

The provided API is currently 2 composable functions:
- `DebugRevenueCatDebugScreen`: This is the actual UI that is part of
the debug screen. In case devs want to use it in a custom UI.
- `DebugRevenueCatBottomSheet`: This will display the debug screen as a
bottom sheet. This is what's used in the `MagicWeatherCompose` sample
app.

##### TODO
- [ ] Allow visualizing offerings in debug menu
- [ ] Support non-composable apps by wrapping it into a fragment, with
utility launch methods.
- [ ] Split library for debug and release
- [ ] Add UI tests
- [ ] Support publishing the new module as different libraries for debug
and release.
- [ ] Remove module local substitution once debugview library has been
published


https://github.com/RevenueCat/purchases-android/assets/808417/b3a953e4-b96f-4b06-8294-d2bcf9b66c7d
tonidero pushed a commit that referenced this pull request Aug 10, 2023
**This is an automatic release.**

### Bugfixes
* Fix NoSuchElementException by using poll when accessing
serviceRequests (#1190) via Cesar de la Vega (@vegaro)
### Other Changes
* Debug view: rename package (#1191) via Toni Rico (@tonidero)
* Debugview: Add snapshot tests for debug view using Paparazzi (#1187)
via Toni Rico (@tonidero)
* Debug view: Add offerings section and purchasing capabilities (#1186)
via Toni Rico (@tonidero)
* Debug view: Initial UI + Usage in MagicWeatherCompose (#1075) via Toni
Rico (@tonidero)
* Remove customEntitlementComputation flavor for non-purchases modules
(#1180) via Toni Rico (@tonidero)

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
@vegaro vegaro added pr:other and removed pr:build labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants