Skip to content

Commit 1699e47

Browse files
authored
Add japicmp to every module (#4364)
1 parent c6f0eaa commit 1699e47

File tree

4 files changed

+57
-35
lines changed

4 files changed

+57
-35
lines changed

build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
6+
dependencies {
7+
// https://github.com/melix/japicmp-gradle-plugin/issues/36
8+
classpath 'com.google.guava:guava:30.1.1-jre'
9+
}
10+
}
11+
112
plugins {
213
id 'io.franzbecker.gradle-lombok' version '4.0.0'
314
id 'com.github.johnrengelman.shadow' version '7.0.0'
15+
id 'me.champeau.gradle.japicmp' version '0.2.9' apply false
416
}
517

618
apply from: "$rootDir/gradle/ci-support.gradle"
@@ -46,6 +58,12 @@ subprojects {
4658
// specific modules should be excluded from publication
4759
if ( ! ["test-support", "jdbc-test"].contains(it.name) && !it.path.startsWith(":docs:") && it != project(":docs") ) {
4860
apply from: "$rootDir/gradle/publishing.gradle"
61+
62+
if (it.name != "bom") {
63+
apply plugin: "me.champeau.gradle.japicmp"
64+
tasks.register('japicmp', me.champeau.gradle.japicmp.JapicmpTask)
65+
apply from: "$rootDir/gradle/japicmp.gradle"
66+
}
4967
}
5068

5169
test {

core/build.gradle

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
buildscript {
2-
repositories {
3-
jcenter()
4-
}
5-
6-
dependencies {
7-
// https://github.com/melix/japicmp-gradle-plugin/issues/36
8-
classpath 'com.google.guava:guava:30.1.1-jre'
9-
}
10-
}
11-
12-
plugins {
13-
id 'me.champeau.gradle.japicmp' version '0.2.9'
14-
}
15-
161
apply plugin: 'com.github.johnrengelman.shadow'
172

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

2611
configurations {
27-
baseline
2812
shaded
2913
[api, compileOnly, testCompile]*.extendsFrom shaded
3014
}
@@ -57,17 +41,7 @@ task jarFileTest(type: Test) {
5741
}
5842
project.tasks.check.dependsOn(jarFileTest)
5943

60-
task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
61-
dependsOn(tasks.shadowJar)
62-
63-
oldClasspath = configurations.baseline
64-
newClasspath = shadowJar.outputs.files
65-
ignoreMissingClasses = true
66-
67-
accessModifier = "protected"
68-
failOnModification = true
69-
failOnSourceIncompatibility = true
70-
44+
tasks.japicmp {
7145
packageExcludes = [
7246
"com.github.dockerjava.*",
7347
"org.testcontainers.shaded.*",
@@ -78,14 +52,6 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
7852
methodExcludes = []
7953

8054
fieldExcludes = []
81-
82-
onlyBinaryIncompatibleModified = true
83-
htmlOutputFile = file("$buildDir/reports/japi.html")
84-
}
85-
// do not run on Windows by default
86-
// TODO investigate zip issue on Windows
87-
if (!org.gradle.internal.os.OperatingSystem.current().isWindows()) {
88-
project.tasks.check.dependsOn(japicmp)
8955
}
9056

9157
configurations.all {

gradle/japicmp.gradle

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
configurations {
2+
baseline
3+
}
4+
5+
dependencies {
6+
baseline "org.testcontainers:${project.name}:1.16.0", {
7+
exclude group: "*", module: "*"
8+
}
9+
}
10+
11+
tasks.japicmp {
12+
dependsOn(tasks.shadowJar)
13+
14+
oldClasspath = configurations.baseline
15+
newClasspath = shadowJar.outputs.files
16+
ignoreMissingClasses = true
17+
18+
accessModifier = "protected"
19+
failOnModification = true
20+
failOnSourceIncompatibility = true
21+
22+
onlyBinaryIncompatibleModified = true
23+
htmlOutputFile = file("$buildDir/reports/japi.html")
24+
}
25+
// do not run on Windows by default
26+
// TODO investigate zip issue on Windows
27+
if (!org.gradle.internal.os.OperatingSystem.current().isWindows()) {
28+
project.tasks.check.dependsOn(japicmp)
29+
}

modules/kafka/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
description = "Testcontainers :: Kafka"
22

3+
tasks.japicmp {
4+
// TODO clean after 1.17.0 is released
5+
methodExcludes = [
6+
// Overrides removed, not a breaking change per se
7+
"org.testcontainers.containers.KafkaContainer#containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse,boolean)",
8+
"org.testcontainers.containers.KafkaContainer#doStart()",
9+
]
10+
}
11+
312
dependencies {
413
api project(':testcontainers')
514

0 commit comments

Comments
 (0)