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

Update gradle 6 #1948

Merged
merged 8 commits into from Jun 16, 2020
Merged

Update gradle 6 #1948

merged 8 commits into from Jun 16, 2020

Conversation

TimvdLippe
Copy link
Contributor

This included a couple of breaking changes:

  • The build plugin is now part of the Gradle Enterprise plugin
  • The osgi plugin was removed, for which we have to use the bndtools
    plugin instead
  • Kotlin version has to be updated, including their coroutine
    library versions

Gradle 6 is required for us to build on Java 14.

Supersedes and closes #1923

This included a couple of breaking changes:
- The build plugin is now part of the Gradle Enterprise plugin
- The osgi plugin was removed, for which we have to use the bndtools
plugin instead
- Kotlin version has to be updated, including their coroutine
library versions

Gradle 6 is required for us to build on Java 14.

Supersedes and closes #1923
Gradle 6 does not like that we run a build twice, as part of a Gradle
task. Therefore, we have to move the checksum computation out of
the gradle task in a separate Bash script.
@TimvdLippe
Copy link
Contributor Author

@mrwilson I had to update our checksum computation, as Gradle 6 was not happy with tasks that rebuild :mockito as part of the build. PTAL

Otherwise we lose the code coverage, as we run a `gradle clean`
in the reproducibility check.
Comment on lines +37 to +38
- jdk: openjdk8
script: ./check_reproducibility.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- jdk: openjdk8
script: ./check_reproducibility.sh
- name: "Check reproducibility"
jdk: openjdk8
script: ./check_reproducibility.sh

Taking a look in Travis right now, it looks like "just" another Jdk 8 build and this would allow people to identify this particular job at a glance if it starts failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to do this in a follow-up, as we can do some more cleanup of the Travis tasks. Thanks for the suggestion 😄

@mrwilson
Copy link
Contributor

mrwilson commented Jun 15, 2020

Ah, I've hit this before (doing stuff with GradleBuild in 6).

Running it as a separate task is a good idea too 👍

I've added one small suggestion.

This script works for the JUnit 5 project, so if it's passing the builds then I'm content that it's behaving as expected.

@TimvdLippe
Copy link
Contributor Author

Thanks for the review, I will fix the Travis name. Meanwhile, CodeCov is not happy with this Gradle change, so I gotta figure why that is broken. (This happened with a previous Gradle upgrade as well)

This now also makes use of the build cache, which should significantly
speed up Travis builds.
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2020

Codecov Report

Merging #1948 into release/3.x will decrease coverage by 0.37%.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                @@
##             release/3.x    #1948      +/-   ##
=================================================
- Coverage          86.68%   86.30%   -0.38%     
- Complexity          2527     2542      +15     
=================================================
  Files                318      318              
  Lines               6652     6738      +86     
  Branches             833      838       +5     
=================================================
+ Hits                5766     5815      +49     
- Misses               685      712      +27     
- Partials             201      211      +10     
Impacted Files Coverage Δ Complexity Δ
...a/org/mockito/internal/creation/SuspendMethod.java 71.42% <0.00%> (-14.29%) 5.00% <0.00%> (-1.00%)
...d/internal/creation/AndroidByteBuddyMockMaker.java
...roid/internal/creation/AndroidLoadingStrategy.java
...roid/internal/creation/AndroidTempFileLocator.java
.../internal/util/concurrent/DetachedThreadLocal.java 5.71% <0.00%> (ø) 0.00% <0.00%> (?%)
...to/internal/util/concurrent/WeakConcurrentSet.java 31.03% <0.00%> (ø) 5.00% <0.00%> (?%)
...to/internal/util/concurrent/WeakConcurrentMap.java 41.48% <0.00%> (ø) 11.00% <0.00%> (?%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0e814b...4683c77. Read the comment docs.

@TimvdLippe
Copy link
Contributor Author

Coverage changes are as expected. We no longer include the android subproject in our files and the Kotlin experimental test suite has been upgraded. We can clean that up in a follow-up PR.

Given that this is mostly a mechanical change, I am going to go ahead and merge this. There is plenty of things we can clean up in follow-up PRs, but this PR is already getting quite big.

@TimvdLippe TimvdLippe merged commit e734fe6 into release/3.x Jun 16, 2020
@TimvdLippe TimvdLippe deleted the update-gradle-6 branch June 16, 2020 13:20
epeee pushed a commit to epeee/mockito that referenced this pull request Jun 22, 2020
* Upgrade to Gradle 6

This included a couple of breaking changes:
- The build plugin is now part of the Gradle Enterprise plugin
- The osgi plugin was removed, for which we have to use the bndtools
plugin instead
- Kotlin version has to be updated, including their coroutine
library versions

Gradle 6 is required for us to build on Java 14.

Supersedes and closes mockito#1923

* Remove commented plugin

* Move checksum computation out of Gradle

Gradle 6 does not like that we run a build twice, as part of a Gradle
task. Therefore, we have to move the checksum computation out of
the gradle task in a separate Bash script.

* Run reproducibility check as a separate Travis build

Otherwise we lose the code coverage, as we run a `gradle clean`
in the reproducibility check.

* Fix code coverage

This now also makes use of the build cache, which should significantly
speed up Travis builds.

* Fix disabling of projects for the coverage task

* Fix exclusion of errorprone subproject

* Reverse logic in coverage.gradle
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.

None yet

3 participants