Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Mar 7, 2023

Enables the -Werror flag on the Java compilation step, fixing and suppressing the existing issues.

Unlike most other packages where we've enabled this, this consists almost entirely of sweeping suppressions (specifically, deprecation), since the package was updated to the v5 billing library but still uses many APIs from v4 that are deprecated in v5. While this is more suppression than we would normally want to do, it still sets us up to catch other kinds of warnings going forward. It may also help when the full migration to v5 API is done, since just removing the deprecation suppressions will make it easy to find all of the code than needs to be updated. Given that, I believe this is still a net improvement over having -Werror off.

Part of flutter/flutter#91868

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@stuartmorgan-g stuartmorgan-g requested a review from reidbaker March 7, 2023 18:43
@stuartmorgan-g stuartmorgan-g requested a review from gmackall as a code owner March 7, 2023 18:43
@stuartmorgan-g stuartmorgan-g added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Mar 7, 2023
@stuartmorgan-g
Copy link
Collaborator Author

Overriding version/changelog: the non-test-file changes are exclusively:

  • adding suppressions, and
  • inlining namespaces

both of which are dev-only changes, thus exempt by policy even though the tooling can't detect that.

private HashMap<String, SkuDetails> cachedSkus = new HashMap<>();
// TODO(stuartmorgan): Migrate this code. See TODO on querySkuDetailsAsync.
@SuppressWarnings("deprecation")
private HashMap<String, com.android.billingclient.api.SkuDetails> cachedSkus = new HashMap<>();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Having to inline namespaces everywhere is the most annoying part of the change, but having -Werror is more important IMO. And all of this will go away when the code is migrated to v5.

Copy link
Contributor

Choose a reason for hiding this comment

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

v5 of what?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

v5 of the Google Play Billing Library, which this plugin wraps.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 8, 2023
@auto-submit auto-submit bot merged commit 46c6333 into flutter:main Mar 8, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 9, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 9, 2023
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
[in_app_purchase] Enable -Werror for Android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: in_app_purchase platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants