diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 938e92d1c5..7f24b587a8 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { implementation("com.squareup.wire:wire-gradle-plugin:4.3.0") implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18") implementation("gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0") - implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.0") + implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.1") implementation("me.champeau.jmh:jmh-gradle-plugin:0.6.6") implementation("net.ltgt.gradle:gradle-errorprone-plugin:2.0.2") implementation("net.ltgt.gradle:gradle-nullaway-plugin:1.3.0") diff --git a/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts b/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts index 407bf9263e..37b176efb7 100644 --- a/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts @@ -35,17 +35,6 @@ val latestReleasedVersion: String by lazy { class AllowDefaultMethodRule : AbstractRecordingSeenMembers() { override fun maybeAddViolation(member: JApiCompatibility): Violation? { for (change in member.compatibilityChanges) { - if (change == JApiCompatibilityChange.METHOD_NEW_DEFAULT) { - // JApiCmp treats this as incompatible for the situation where an existing subclass may have - // a method with the same name and different signature. We accept this corner case for - // semver. - continue - } - if (change == JApiCompatibilityChange.METHOD_ABSTRACT_NOW_DEFAULT) { - // Adding default implementations to interface methods previously abstract is not a breaking - // change. - continue - } if (isAbstractMethodOnAutoValue(member, change)) { continue } @@ -125,9 +114,10 @@ if (!project.hasProperty("otel.release") && !project.name.startsWith("bom")) { ) // Reproduce defaults from https://github.com/melix/japicmp-gradle-plugin/blob/09f52739ef1fccda6b4310cf3f4b19dc97377024/src/main/java/me/champeau/gradle/japicmp/report/ViolationsGenerator.java#L130 - // only changing the BinaryIncompatibleRule to our custom one that allows new default methods - // on interfaces, and adding default implementations to interface methods previously - // abstract. + // but allow new default methods on interfaces, adding default implementations to + // interface methods previously abstract, and select additional customizations defined in + // AllowDefaultMethodRule. + compatibilityChangeExcludes.set(listOf("METHOD_NEW_DEFAULT", "METHOD_ABSTRACT_NOW_DEFAULT")) richReport { addSetupRule(RecordSeenMembersSetup::class.java) addRule(JApiChangeStatus.NEW, SourceCompatibleRule::class.java)