Skip to content

Commit

Permalink
Merge pull request gradle#26977 Update Jacoco Default to 0.8.11
Browse files Browse the repository at this point in the history
<!--- The issue this PR addresses -->
<!-- Fixes #? -->

### Context
Jacoco 0.8.11 supports running on Java 21 out of the box. Update to 0.8.11 so that it all supports running on Java 21.

### Contributor Checklist
- [x] [Review Contribution Guidelines](https://github.com/gradle/gradle/blob/master/CONTRIBUTING.md)
- [x] Make sure that all commits are [signed off](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) to indicate that you agree to the terms of [Developer Certificate of Origin](https://developercertificate.org/).
- [x] Make sure all contributed code can be distributed under the terms of the [Apache License 2.0](https://github.com/gradle/gradle/blob/master/LICENSE), e.g. the code was written by yourself or the original code is licensed under [a license compatible to Apache License 2.0](https://apache.org/legal/resolved.html).
- [x] Check ["Allow edit from maintainers" option](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) in pull request so that additional changes can be pushed by Gradle team
- [x] Provide integration tests (under `<subproject>/src/integTest`) to verify changes from a user perspective
- [x] Provide unit tests (under `<subproject>/src/test`) to verify logic
- [x] Update User Guide, DSL Reference, and Javadoc for public-facing changes
- [x] Ensure that tests pass sanity check: `./gradlew sanityCheck`
- [x] Ensure that tests pass locally: `./gradlew <changed-subproject>:quickTest`

### Reviewing cheatsheet

Before merging the PR, comments starting with
- ❌ ❓**must** be fixed
- 🤔 💅 **should** be fixed
- 💭 **may** be fixed
- 🎉 celebrate happy things

Co-authored-by: Octavia Togami <[email protected]>
  • Loading branch information
bot-gradle and octylFractal committed Nov 17, 2023
2 parents b500fa4 + 443ca95 commit 77d562c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public abstract class JacocoPlugin implements Plugin<Project> {
*
* @since 3.4
*/
public static final String DEFAULT_JACOCO_VERSION = "0.8.9";
public static final String DEFAULT_JACOCO_VERSION = "0.8.11";
public static final String AGENT_CONFIGURATION_NAME = "jacocoAgent";
public static final String ANT_CONFIGURATION_NAME = "jacocoAnt";
public static final String PLUGIN_EXTENSION_NAME = "jacoco";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class JacocoAgentJarTest extends Specification {
'0.8.7' | true
'0.8.8' | true
'0.8.9' | true
'0.8.10' | true
'0.8.11' | true
}

def "versions >= 0.7.6 support include no location classes #version -> #incNoLocationClassesSupport"() {
Expand All @@ -69,5 +71,7 @@ class JacocoAgentJarTest extends Specification {
'0.8.7' | true
'0.8.8' | true
'0.8.9' | true
'0.8.10' | true
'0.8.11' | true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ final class JacocoCoverage {
// Order matters here, as we want to test the latest version first
// Relies on Groovy keeping the order of the keys in a map literal
private static final Map<JavaVersion, JacocoVersion> JDK_CUTOFFS = [
(JavaVersion.VERSION_21): JacocoVersion.SUPPORTS_JDK_21,
(JavaVersion.VERSION_20): JacocoVersion.SUPPORTS_JDK_20,
(JavaVersion.VERSION_18): JacocoVersion.SUPPORTS_JDK_18,
(JavaVersion.VERSION_17): JacocoVersion.SUPPORTS_JDK_17,
Expand Down Expand Up @@ -59,6 +60,7 @@ final class JacocoCoverage {
static final SUPPORTS_JDK_17 = new JacocoVersion(0, 8, 7)
static final SUPPORTS_JDK_18 = new JacocoVersion(0, 8, 8)
static final SUPPORTS_JDK_20 = new JacocoVersion(0, 8, 9)
static final SUPPORTS_JDK_21 = new JacocoVersion(0, 8, 11)

private final int major
private final int minor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</thead>
<tr>
<td>toolVersion</td>
<td><literal>0.8.9</literal></td>
<td><literal>0.8.11</literal></td>
</tr>
<tr>
<td>reportsDirectory</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ The previous step will help you identify potential problems by issuing deprecati
[[changes_8.6]]
== Upgrading from 8.5 and earlier

=== Potential breaking changes

==== Upgrade to JaCoCo 0.8.11

JaCoCo has been updated to https://www.jacoco.org/jacoco/trunk/doc/changes.html[0.8.11].


=== Deprecations

[[deprecated_artifact_identifier]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {

// tag::jacoco-configuration[]
jacoco {
toolVersion = "0.8.9"
toolVersion = "0.8.11"
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
}
// end::jacoco-configuration[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

// tag::jacoco-configuration[]
jacoco {
toolVersion = "0.8.9"
toolVersion = "0.8.11"
reportsDirectory = layout.buildDirectory.dir("customJacocoReportDir")
}
// end::jacoco-configuration[]
Expand Down

0 comments on commit 77d562c

Please sign in to comment.