Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions gradle/config/japicmp/accepted-breaking-changes.txt

This file was deleted.

1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ download = { id = "de.undercouch.download", version = "5.6.0" }
errorProne = { id = "net.ltgt.errorprone", version = "4.3.0" }
foojayResolver = { id = "org.gradle.toolchains.foojay-resolver", version = "1.0.0" }
gitPublish = { id = "org.ajoberstar.git-publish", version = "5.1.3" }
japicmp = { id = "me.champeau.gradle.japicmp", version = "0.4.6" }
jmh = { id = "me.champeau.jmh", version = "0.7.3" }
jreleaser = { id = "org.jreleaser", version = "1.21.0" }
# check if workaround in gradle.properties can be removed when updating
Expand Down
1 change: 0 additions & 1 deletion gradle/plugins/backward-compatibility/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins {
dependencies {
implementation("junitbuild.base:dsl-extensions")
implementation(libs.plugins.download.markerCoordinates)
implementation(libs.plugins.japicmp.markerCoordinates)
implementation(libs.jackson.dataformat.yaml)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@

import de.undercouch.gradle.tasks.download.Download
import junitbuild.compatibility.BackwardCompatibilityChecksExtension
import junitbuild.compatibility.japicmp.AcceptedViolationSuppressor
import junitbuild.compatibility.japicmp.AcceptedViolationsPostProcessRule
import junitbuild.compatibility.japicmp.BreakingSuperClassChangeRule
import junitbuild.compatibility.japicmp.InternalApiFilter
import junitbuild.compatibility.japicmp.SourceIncompatibleRule
import junitbuild.compatibility.roseau.RoseauDiff
import junitbuild.extensions.dependencyFromLibs
import junitbuild.extensions.javaModuleName
import me.champeau.gradle.japicmp.JapicmpTask
import me.champeau.gradle.japicmp.report.stdrules.BinaryIncompatibleRule
import me.champeau.gradle.japicmp.report.stdrules.RecordSeenMembersSetup
import org.gradle.internal.os.OperatingSystem

plugins {
java
id("de.undercouch.download")
id("me.champeau.gradle.japicmp")
}

val roseauDependencies = configurations.dependencyScope("roseau")
Expand All @@ -38,16 +27,6 @@ dependencies {

val extension = extensions.create<BackwardCompatibilityChecksExtension>("backwardCompatibilityChecks").apply {
enabled.convention(true)
acceptedIncompatibilities.apply {
val acceptedBreakingChangesFile = rootProject.layout.projectDirectory.file("gradle/config/japicmp/accepted-breaking-changes.txt")
if (acceptedBreakingChangesFile.asFile.exists()) {
convention(providers.fileContents(acceptedBreakingChangesFile).asText
.map { it.lineSequence().filter { line -> line.startsWith(project.javaModuleName) }.toList() })
} else {
empty()
}
finalizeValueOnRead()
}
previousVersion.apply {
convention(providers.gradleProperty("apiBaselineVersion"))
finalizeValueOnRead()
Expand All @@ -61,7 +40,7 @@ val downloadPreviousReleaseJar by tasks.registering(Download::class) {
onlyIf { extension.enabled.get() }
val previousVersion = extension.previousVersion.get()
src("https://repo1.maven.org/maven2/${project.group.toString().replace(".", "/")}/${project.name}/$previousVersion/${project.name}-$previousVersion.jar")
dest(layout.buildDirectory.dir("japicmp"))
dest(layout.buildDirectory.dir("previousRelease"))
overwrite(false)
quiet(true)
retries(2)
Expand Down Expand Up @@ -89,48 +68,10 @@ val roseau by tasks.registering(RoseauDiff::class) {
reportDir = layout.buildDirectory.dir("reports/roseau")
}

val japicmp by tasks.registering(JapicmpTask::class) {
if (gradle.startParameter.isOffline) {
enabled = false
}
onlyIf { extension.enabled.get() }
shouldRunAfter(roseau)

oldClasspath.from(downloadPreviousReleaseJar.map { it.outputFiles })
newClasspath.from(tasks.jar)
onlyModified = true
ignoreMissingClasses = true
htmlOutputFile = layout.buildDirectory.file("reports/japicmp/plain-report.html")
addExcludeFilter(InternalApiFilter::class.java)
packageExcludes.add("*.shadow.*")
inputs.property("acceptedIncompatibilities", extension.acceptedIncompatibilities)
richReport {
title = "Compatibility report"
description = extension.previousVersion.map { "and source compatibility compared against $it" }
destinationDir = layout.buildDirectory.dir("reports/japicmp")
addSetupRule(RecordSeenMembersSetup::class.java)
addRule(BreakingSuperClassChangeRule::class.java)
addRule(BinaryIncompatibleRule::class.java)
addRule(SourceIncompatibleRule::class.java)
}
}

val checkBackwardCompatibility by tasks.registering {
dependsOn(roseau, japicmp)
dependsOn(roseau)
}

tasks.check {
dependsOn(checkBackwardCompatibility)
}

afterEvaluate {
val params = mapOf(
"acceptedIncompatibilities" to extension.acceptedIncompatibilities.get().joinToString(",")
)
japicmp {
richReport {
addViolationTransformer(AcceptedViolationSuppressor::class.java, params)
addPostProcessRule(AcceptedViolationsPostProcessRule::class.java, params)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package junitbuild.compatibility

import org.gradle.api.provider.Property
import org.gradle.api.provider.SetProperty

abstract class BackwardCompatibilityChecksExtension {

abstract val enabled: Property<Boolean>

abstract val previousVersion: Property<String>

abstract val acceptedIncompatibilities: SetProperty<String>

}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions junit-jupiter-api/junit-jupiter-api.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ tasks {
compileJava {
options.compilerArgs.add("-Xlint:-module") // due to qualified exports
}
japicmp {
classExcludes.addAll($$"*.AssertionsKt$assert*", $$"*.AssertionsKt$evaluate*")
}
jar {
bundle {
val version = project.version
Expand Down