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

split compile into api/implementation, stop depending on conjure #394

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-394.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: split compile into api/implementation, stop depending on conjure
links:
- https://github.com/palantir/docker-compose-rule/pull/394
6 changes: 3 additions & 3 deletions docker-compose-junit-jupiter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ build.dependsOn integrationTest

dependencies {
compile project(':docker-compose-rule-core')
compile 'org.junit.jupiter:junit-jupiter-api'
api 'org.junit.jupiter:junit-jupiter-api'

testCompile 'org.mockito:mockito-core'
testCompile 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.assertj:assertj-core'
}
34 changes: 19 additions & 15 deletions docker-compose-rule-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@ build.dependsOn integrationTest

dependencies {
api project(':docker-compose-rule-events-api:docker-compose-rule-events-api-objects')
compile 'com.jayway.awaitility:awaitility'
compile 'com.github.zafarkhaja:java-semver'
compile 'com.google.guava:guava'
compile 'commons-io:commons-io'
compile 'joda-time:joda-time'
compile 'org.apache.commons:commons-lang3:3.0'
compile 'org.hamcrest:hamcrest-core'
compile 'org.slf4j:slf4j-api'
api 'joda-time:joda-time'

implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
implementation 'com.palantir.conjure.java.runtime:conjure-java-jackson-serialization'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-guava'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
implementation 'commons-io:commons-io'
implementation 'com.github.zafarkhaja:java-semver'
implementation 'com.google.guava:guava'
implementation 'com.jayway.awaitility:awaitility'
implementation 'one.util:streamex'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.hamcrest:hamcrest-core'
implementation 'org.slf4j:slf4j-api'

testCompile 'com.github.stefanbirkner:system-rules'
testCompile 'junit:junit'
testCompile 'org.assertj:assertj-core'
testCompile 'org.mockito:mockito-core'
testCompile 'org.slf4j:slf4j-simple'
testImplementation 'com.github.stefanbirkner:system-rules'
testImplementation 'com.github.tomakehurst:wiremock'
testImplementation 'junit:junit'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.slf4j:slf4j-simple'

integrationTestCompile project.sourceSets.test.output
integrationTestImplementation project.sourceSets.test.output
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.palantir.docker.compose.execution.DockerComposeExecArgument.arguments;
import static com.palantir.docker.compose.execution.DockerComposeExecOption.noOptions;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeThat;

import com.github.zafarkhaja.semver.Version;
import com.palantir.docker.compose.connection.Container;
Expand All @@ -37,8 +36,8 @@
import java.util.concurrent.TimeoutException;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.mockito.internal.matchers.GreaterOrEqual;

public class DockerComposeManagerNativeHealthcheckIntegrationTest {

Expand All @@ -61,8 +60,12 @@ public void shutdownPool() {
@Test
public void dockerComposeManagerWaitsUntilHealthcheckPasses()
throws ExecutionException, IOException, InterruptedException, TimeoutException {
assumeThat("docker version", Docker.version(), new GreaterOrEqual<>(Version.forIntegers(1, 12, 0)));
assumeThat("docker-compose version", DockerCompose.version(), new GreaterOrEqual<>(Version.forIntegers(1, 10, 0)));
if (Docker.version().compareTo(Version.forIntegers(1, 12, 0)) < 0) {
throw new AssumptionViolatedException("docker version");
}
if (DockerCompose.version().compareTo(Version.forIntegers(1, 10, 0)) < 0) {
throw new AssumptionViolatedException("docker-compose version");
}

docker = new DockerComposeManager.Builder()
.file("src/test/resources/native-healthcheck.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static com.palantir.docker.compose.execution.DockerComposeExecOption.noOptions;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeThat;

import com.github.zafarkhaja.semver.Version;
import com.jayway.awaitility.core.ConditionFactory;
Expand All @@ -34,8 +33,8 @@
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.AssumptionViolatedException;
import org.junit.Test;
import org.mockito.internal.matchers.GreaterOrEqual;

public class ContainerIntegrationTests {

Expand Down Expand Up @@ -69,8 +68,12 @@ public void testStateChanges_withoutHealthCheck() throws IOException, Interrupte
*/
@Test
public void testStateChanges_withHealthCheck() throws IOException, InterruptedException {
assumeThat("docker version", Docker.version(), new GreaterOrEqual<>(Version.forIntegers(1, 12, 0)));
assumeThat("docker-compose version", DockerCompose.version(), new GreaterOrEqual<>(Version.forIntegers(1, 10, 0)));
if (Docker.version().compareTo(Version.forIntegers(1, 12, 0)) < 0) {
throw new AssumptionViolatedException("docker version");
}
if (DockerCompose.version().compareTo(Version.forIntegers(1, 10, 0)) < 0) {
throw new AssumptionViolatedException("docker-compose version");
}

DockerCompose dockerCompose = new DefaultDockerCompose(
DockerComposeFiles.from("src/test/resources/native-healthcheck.yaml"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.palantir.conjure.java.serialization.ObjectMappers;
import com.palantir.docker.compose.report.Report;

class ReportPoster {
private static final ObjectMapper OBJECT_MAPPER = ObjectMappers.newClientObjectMapper();
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this definitely produce the same json output?


private final HttpJsonPoster webhookPoster;

Expand Down
13 changes: 8 additions & 5 deletions docker-compose-rule-junit4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ testSets {
build.dependsOn integrationTest

dependencies {
compile project(':docker-compose-rule-core')
compile 'junit:junit'
api project(':docker-compose-rule-events-api:docker-compose-rule-events-api-objects')
api project(':docker-compose-rule-core')
api 'junit:junit'

testCompile 'org.hamcrest:hamcrest-core'
testCompile 'org.mockito:mockito-core'
testCompile 'org.assertj:assertj-core'
implementation 'com.google.guava:guava'

testImplementation 'org.hamcrest:hamcrest-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.assertj:assertj-core'
}
24 changes: 11 additions & 13 deletions versions.lock
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# Run ./gradlew --write-locks to regenerate this file
cglib:cglib-nodep:3.1 (1 constraints: 2a0e1330)
com.fasterxml.jackson.core:jackson-annotations:2.9.9 (4 constraints: 1c46760f)
com.fasterxml.jackson.core:jackson-core:2.9.9 (9 constraints: 48b9fc2a)
com.fasterxml.jackson.core:jackson-databind:2.9.9.3 (10 constraints: dcc1c2b0)
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.9 (1 constraints: 591c3588)
com.fasterxml.jackson.core:jackson-annotations:2.9.9 (3 constraints: da2fd835)
com.fasterxml.jackson.core:jackson-core:2.9.9 (7 constraints: 1e799181)
com.fasterxml.jackson.core:jackson-databind:2.9.9.3 (8 constraints: f67c19a3)
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.9 (1 constraints: 16051936)
com.fasterxml.jackson.datatype:jackson-datatype-guava:2.9.8 (1 constraints: 591c3588)
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8 (1 constraints: 591c3588)
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8 (1 constraints: 591c3588)
com.fasterxml.jackson.module:jackson-module-afterburner:2.9.8 (1 constraints: 591c3588)
com.fasterxml.jackson.datatype:jackson-datatype-guava:2.9.9 (1 constraints: 16051936)
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9 (1 constraints: 16051936)
com.github.zafarkhaja:java-semver:0.9.0 (1 constraints: 0b050636)
com.google.code.findbugs:jsr305:3.0.2 (1 constraints: 980fcc86)
com.google.errorprone:error_prone_annotations:2.3.3 (1 constraints: 041129c0)
com.google.guava:guava:21.0 (3 constraints: f528d884)
com.jayway.awaitility:awaitility:1.7.0 (1 constraints: 0a050536)
com.palantir.conjure.java:conjure-lib:4.7.0 (1 constraints: 0d051436)
com.palantir.conjure.java.api:errors:2.8.1 (1 constraints: f30f8399)
com.palantir.conjure.java.runtime:conjure-java-jackson-serialization:4.18.1 (1 constraints: 4005543b)
com.palantir.ri:resource-identifier:1.0.1 (1 constraints: ea0f6699)
com.palantir.safe-logging:preconditions:1.11.0 (3 constraints: b82da857)
com.palantir.safe-logging:safe-logging:1.11.0 (2 constraints: f420cc6c)
Expand All @@ -27,15 +23,15 @@ javax.ws.rs:javax.ws.rs-api:2.1 (1 constraints: 8d0fc779)
joda-time:joda-time:2.10.3 (1 constraints: 3805323b)
junit:junit:4.12 (4 constraints: 3526f5b6)
one.util:streamex:0.6.8 (1 constraints: 10050536)
org.apache.commons:commons-lang3:3.7 (3 constraints: 751ee657)
org.apache.commons:commons-lang3:3.7 (2 constraints: cf1952d8)
org.apiguardian:apiguardian-api:1.1.0 (2 constraints: 5121ba6d)
org.hamcrest:hamcrest:2.1 (1 constraints: 710b94d5)
org.hamcrest:hamcrest-core:2.1 (5 constraints: 04309b5c)
org.hamcrest:hamcrest-core:2.1 (4 constraints: 5725da19)
org.hamcrest:hamcrest-library:2.1 (1 constraints: 2a0e0f30)
org.immutables:value:2.7.5 (1 constraints: 10050f36)
org.junit.jupiter:junit-jupiter-api:5.5.0 (1 constraints: 0c051336)
org.junit.platform:junit-platform-commons:1.5.0 (1 constraints: 6a0f177d)
org.objenesis:objenesis:2.1 (2 constraints: d51811a4)
org.objenesis:objenesis:2.6 (2 constraints: dc181aa4)
org.opentest4j:opentest4j:1.2.0 (1 constraints: 670f0e7d)
org.slf4j:slf4j-api:1.7.25 (6 constraints: 4a4501d0)
org.yaml:snakeyaml:1.23 (1 constraints: 6e17f627)
Expand All @@ -51,6 +47,8 @@ commons-codec:commons-codec:1.10 (1 constraints: f10f8781)
commons-logging:commons-logging:1.2 (1 constraints: c20f9771)
javax.servlet:javax.servlet-api:3.1.0 (1 constraints: 830dcc28)
junit:junit-dep:4.11 (1 constraints: ba1063b3)
net.bytebuddy:byte-buddy:1.9.10 (1 constraints: 450b52de)
net.bytebuddy:byte-buddy-agent:1.9.10 (1 constraints: 450b52de)
net.minidev:accessors-smart:1.2 (1 constraints: e60926a4)
net.minidev:json-smart:2.3 (1 constraints: a40c49ff)
net.sf.jopt-simple:jopt-simple:5.0.3 (1 constraints: 100e9e3b)
Expand All @@ -68,7 +66,7 @@ org.eclipse.jetty:jetty-servlets:9.2.26.v20180806 (1 constraints: 8810fee5)
org.eclipse.jetty:jetty-util:9.2.26.v20180806 (4 constraints: fe3c89dd)
org.eclipse.jetty:jetty-webapp:9.2.26.v20180806 (1 constraints: 8810fee5)
org.eclipse.jetty:jetty-xml:9.2.26.v20180806 (1 constraints: e70f20cb)
org.mockito:mockito-core:1.9.5 (1 constraints: 11051036)
org.mockito:mockito-core:3.1.0 (1 constraints: 0605fd35)
org.ow2.asm:asm:7.0 (2 constraints: 061aea08)
org.slf4j:slf4j-simple:1.7.25 (1 constraints: 3d05433b)
org.xmlunit:xmlunit-core:2.6.2 (3 constraints: bd288e9d)
Expand Down
4 changes: 2 additions & 2 deletions versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ joda-time:joda-time = 2.10.3
junit:junit = 4.12
org.hamcrest:* = 2.1
org.immutables:* = 2.7.5
org.mockito:mockito-core = 1.9.5
org.mockito:* = 3.1.0
org.slf4j:* = 1.7.12
one.util:streamex = 0.6.8
org.assertj:assertj-core = 3.13.2
com.palantir.conjure:conjure = 4.7.0
com.palantir.conjure.java:* = 4.7.0
com.fasterxml.jackson.dataformat:* = 2.9.9
com.fasterxml.jackson.* = 2.9.9
one.util:streamex = 0.6.8
com.github.tomakehurst:wiremock = 2.24.0
org.junit.jupiter:* = 5.5.0
Expand Down