Skip to content

Commit

Permalink
Add japicmp to every module (#4364)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup authored Aug 6, 2021
1 parent c6f0eaa commit 1699e47
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 35 deletions.
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 @@ -57,17 +41,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 @@ -78,14 +52,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

0 comments on commit 1699e47

Please sign in to comment.