buildscript { repositories { jcenter() } dependencies { // https://github.com/melix/japicmp-gradle-plugin/issues/36 classpath 'com.google.guava:guava:28.2-jre' } } plugins { id 'me.champeau.gradle.japicmp' version '0.2.8' } apply plugin: 'com.github.johnrengelman.shadow' description = "Testcontainers Core" sourceSets { jarFileTest } idea.module.testSourceDirs += sourceSets.jarFileTest.allSource.srcDirs configurations { baseline shaded [runtime, compileOnly, testCompile]*.extendsFrom shaded } shadowJar { configurations = [project.configurations.shaded] mergeServiceFiles() exclude 'org/newsclub/**' [ 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/DEPENDENCIES', 'META-INF/maven/', 'META-INF/proguard/', 'META-INF/services/README.md', 'META-INF/services/com.fasterxml.jackson.core.*', 'META-INF/services/com.github.dockerjava.api.command.*', 'META-INF/services/javax.ws.rs.ext.*', 'META-INF/services/java.security.Provider', 'mozilla/public-suffix-list.txt', ].each { exclude(it) } project.afterEvaluate { dependencies { for (id in project.configurations.compile.resolvedConfiguration.resolvedArtifacts*.moduleVersion*.id) { exclude(dependency("${id.group}:${id.name}")) } } } } task jarFileTest(type: Test) { testClassesDirs = sourceSets.jarFileTest.output.classesDirs classpath = sourceSets.jarFileTest.runtimeClasspath systemProperty("jarFile", shadowJar.outputs.files.singleFile) dependsOn(shadowJar) } project.tasks.check.dependsOn(jarFileTest) task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) { dependsOn(tasks.jar) oldClasspath = configurations.baseline newClasspath = jar.outputs.files ignoreMissingClasses = true accessModifier = "protected" failOnModification = true failOnSourceIncompatibility = true // TODO cleanup excludes after we release the version based on docker-java 3.2.0 packageExcludes = [ "com.github.dockerjava.*", "org.testcontainers.shaded.*", ] classExcludes = [ // Changed to a non-deprecated `ResultCallbackTemplate` from docker-java-api instead of docker-java-core "org.testcontainers.containers.output.FrameConsumerResultCallback", "org.testcontainers.dockerclient.LogToStringContainerCallback", // Deprecated, shouldn't be public "org.testcontainers.dockerclient.AuditLoggingDockerClient", "org.testcontainers.dockerclient.auth.AuthDelegatingDockerClientConfig", // Deprecated docker-java-core class, should go to docker-java "org.testcontainers.dockerclient.transport.okhttp.OkHttpDockerCmdExecFactory", // Exposed `com.github.dockerjava.core.command.PullImageResultCallback` to the public API "org.testcontainers.images.TimeLimitedLoggedPullImageResultCallback", ] methodExcludes = [ // Was returning a type from "com.github.dockerjava.core.*" package "org.testcontainers.dockerclient.*ClientProviderStrategy#tryConfiguration(java.lang.String)", ] onlyBinaryIncompatibleModified = true htmlOutputFile = file("$buildDir/reports/japi.html") } project.tasks.check.dependsOn(japicmp) dependencies { baseline 'org.testcontainers:testcontainers:1.12.5', { exclude group: "*", module: "*" } compile 'junit:junit:4.12' compile 'org.slf4j:slf4j-api:1.7.30' compile 'org.jetbrains:annotations:17.0.0' compile 'javax.annotation:javax.annotation-api:1.3.2' compile 'org.apache.commons:commons-compress:1.19' // Added for JDK9 compatibility since it's missing this package compile 'javax.xml.bind:jaxb-api:2.3.1' compile ('org.rnorth.duct-tape:duct-tape:1.0.8') { exclude(group: 'org.jetbrains', module: 'annotations') } compile ('org.rnorth.visible-assertions:visible-assertions:2.1.2') { // Excluded in favor of jna-platform below exclude(group: "net.java.dev.jna", module: "jna") } compile ('org.rnorth:tcp-unix-socket-proxy:1.0.2') { exclude(group: "log4j", module: "log4j") } compile "net.java.dev.jna:jna-platform:5.5.0" shaded ('org.scala-sbt.ipcsocket:ipcsocket:1.0.0') { exclude(group: "net.java.dev.jna") } compile 'com.github.docker-java:docker-java-api:3.2.0-rc4' shaded ('com.github.docker-java:docker-java-transport-okhttp:3.2.0-rc4') { exclude(group: 'com.google.code.findbug') exclude(group: 'org.slf4j') exclude(group: 'org.apache.commons', module: 'commons-compress') exclude(group: 'com.github.docker-java', module: 'docker-java-api') exclude(group: 'com.fasterxml.jackson.core', module: 'jackson-annotations') } shaded "org.yaml:snakeyaml:1.25" shaded 'com.squareup.okhttp3:okhttp:3.14.4' shaded 'org.glassfish.main.external:trilead-ssh2-repackaged:4.1.2' shaded 'org.zeroturnaround:zt-exec:1.10', { exclude(group: 'org.slf4j') } testCompile 'org.apache.httpcomponents:httpclient:4.5.9' testCompile 'redis.clients:jedis:3.2.0' testCompile 'com.rabbitmq:amqp-client:5.8.0' testCompile 'org.mongodb:mongo-java-driver:3.12.1' testCompile ('org.mockito:mockito-core:3.2.4') { exclude(module: 'hamcrest-core') } // Synthetic JAR used for MountableFileTest and DirectoryTarResourceTest testCompile files('testlib/repo/fakejar/fakejar/0/fakejar-0.jar') testCompile 'org.assertj:assertj-core:3.15.0' testCompile project(':test-support') jarFileTestCompileOnly "org.projectlombok:lombok:${lombok.version}" jarFileTestAnnotationProcessor "org.projectlombok:lombok:${lombok.version}" jarFileTestCompile 'junit:junit:4.12' jarFileTestCompile 'org.assertj:assertj-core:3.14.0' jarFileTestCompile 'org.ow2.asm:asm-debug-all:5.2' }