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

Add japicmp to every module #4364

Merged
merged 1 commit into from
Aug 6, 2021
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
18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
buildscript {
repositories {
mavenCentral()
}

dependencies {
// https://github.com/melix/japicmp-gradle-plugin/issues/36
classpath 'com.google.guava:guava:30.1.1-jre'
}
}

plugins {
id 'io.franzbecker.gradle-lombok' version '4.0.0'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'me.champeau.gradle.japicmp' version '0.2.9' apply false
}

apply from: "$rootDir/gradle/ci-support.gradle"
Expand Down Expand Up @@ -46,6 +58,12 @@ subprojects {
// specific modules should be excluded from publication
if ( ! ["test-support", "jdbc-test"].contains(it.name) && !it.path.startsWith(":docs:") && it != project(":docs") ) {
apply from: "$rootDir/gradle/publishing.gradle"

if (it.name != "bom") {
apply plugin: "me.champeau.gradle.japicmp"
tasks.register('japicmp', me.champeau.gradle.japicmp.JapicmpTask)
apply from: "$rootDir/gradle/japicmp.gradle"
}
}

test {
Expand Down
36 changes: 1 addition & 35 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
buildscript {
repositories {
jcenter()
}

dependencies {
// https://github.com/melix/japicmp-gradle-plugin/issues/36
classpath 'com.google.guava:guava:30.1.1-jre'
}
}

plugins {
id 'me.champeau.gradle.japicmp' version '0.2.9'
}

apply plugin: 'com.github.johnrengelman.shadow'

description = "Testcontainers Core"
Expand All @@ -24,7 +9,6 @@ sourceSets {
idea.module.testSourceDirs += sourceSets.jarFileTest.allSource.srcDirs

configurations {
baseline
shaded
[api, compileOnly, testCompile]*.extendsFrom shaded
}
Expand Down Expand Up @@ -56,17 +40,7 @@ task jarFileTest(type: Test) {
}
project.tasks.check.dependsOn(jarFileTest)

task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
dependsOn(tasks.shadowJar)

oldClasspath = configurations.baseline
newClasspath = shadowJar.outputs.files
ignoreMissingClasses = true

accessModifier = "protected"
failOnModification = true
failOnSourceIncompatibility = true

tasks.japicmp {
packageExcludes = [
"com.github.dockerjava.*",
"org.testcontainers.shaded.*",
Expand All @@ -77,14 +51,6 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
methodExcludes = []

fieldExcludes = []

onlyBinaryIncompatibleModified = true
htmlOutputFile = file("$buildDir/reports/japi.html")
}
// do not run on Windows by default
// TODO investigate zip issue on Windows
if (!org.gradle.internal.os.OperatingSystem.current().isWindows()) {
project.tasks.check.dependsOn(japicmp)
}

configurations.all {
Expand Down
29 changes: 29 additions & 0 deletions gradle/japicmp.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
configurations {
baseline
}

dependencies {
baseline "org.testcontainers:${project.name}:1.16.0", {
exclude group: "*", module: "*"
}
}

tasks.japicmp {
dependsOn(tasks.shadowJar)

oldClasspath = configurations.baseline
newClasspath = shadowJar.outputs.files
ignoreMissingClasses = true

accessModifier = "protected"
failOnModification = true
failOnSourceIncompatibility = true

onlyBinaryIncompatibleModified = true
htmlOutputFile = file("$buildDir/reports/japi.html")
}
// do not run on Windows by default
// TODO investigate zip issue on Windows
if (!org.gradle.internal.os.OperatingSystem.current().isWindows()) {
project.tasks.check.dependsOn(japicmp)
}
9 changes: 9 additions & 0 deletions modules/kafka/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
description = "Testcontainers :: Kafka"

tasks.japicmp {
// TODO clean after 1.17.0 is released
methodExcludes = [
// Overrides removed, not a breaking change per se
"org.testcontainers.containers.KafkaContainer#containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse,boolean)",
"org.testcontainers.containers.KafkaContainer#doStart()",
]
}

dependencies {
api project(':testcontainers')

Expand Down