Skip to content
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

Dependency updates 20200716 #6682

Merged
merged 4 commits into from Jul 16, 2020
Merged

Conversation

mikehardy
Copy link
Member

Pull Request template

Purpose / Description

Keep track of upstream dependencies, slowly pulling in external change as we can vs as we have to

This is kind of a big one:

  1. The jetbrains-annotations one was blocked by an external transitive dependency, which I use gradle to force (tested, working)
  2. Mockito 3.4.0 has static mocking capabilities (yay!) so I converted away from PowerMock for everything
  3. A gradle plugin update always sort of implies we all should upgrade Android Studio, so yeah get on that

Fixes

Fixes #6672

Approach

  1. I used a gradle resolutionStrategy to force our jetbrains-annotations version after an upstream PR looks like it's going nowhere
  2. I used Mockito.mockStatic()to re-implement our unit tests that mocked static things

How Has This Been Tested?

It's literally all tests and lint, so I was testing and linting all the time to do it :-)

Learning (optional, can help others)

  1. Upstream jetbrains-annotations PR: Update jetbrains-annotations dependency to current JakeWharton/timber#398 / resolution strategy https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html
  2. Mockito.mockStatic PR: Mockito #1013: Defines and implements API for static mocking. mockito/mockito#1955

Checklist

Please, go through these checks before submitting the PR.

  • You have not changed whitespace unnecessarily (it makes diffs hard to read)
  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • Your code follows the style of the project (e.g. never omit braces in if statements)
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code

@mikehardy
Copy link
Member Author

re-pushed with adverse results of codacy all handled

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Good to go assuming tests pass

One nit/improvement, totally optional

The mockito dependency upgrade is actually a big feature switch, so
the previous usage of PowerMock can be removed and mockito can do all
of our static mocking
@mikehardy mikehardy added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) labels Jul 16, 2020
@mikehardy mikehardy merged commit 4efa2a5 into ankidroid:master Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MockitoAnnotations.initMocks(Object) deprecated, blocks dependency update
2 participants