Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.9k
Gradle#574
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
Uh oh!
There was an error while loading. Please reload this page.
Gradle #574
Changes from all commits
35a32d6ccdb027c7f850ad0cc4f74c31cc0ac022ffeb3f1ee9c9a94d726bd3703632f6647b42b7ef12ddd71825f1e1a8ca7e0fc1987f3f566b926646b57b93092ba2eebe6c748905b2ee4481025f5c2dd248712ab77bffa6e623f24f098f38edc5eaa3a34ac8c2de5eae1dac4268d1ca8e92bd0ad536103d803e5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| *.sh text eol=lf | ||
| * text eol=lf |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -43,3 +43,6 @@ dependency-reduced-pom.xml | ||
| # Gitbook | ||
| _book/ | ||
| node_modules/ | ||
| .gradle/ | ||
| build/ | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| description = "Testcontainers :: BOM" | ||
| publishing { | ||
| publications { | ||
| mavenJava(MavenPublication) { publication -> | ||
| artifactId = "testcontainers-bom" | ||
| artifacts = [] | ||
| pom.withXml { | ||
| def dependencyManagementNode = asNode().appendNode('dependencyManagement').appendNode('dependencies') | ||
| rootProject.subprojects.findAll { it != project }.each { subProject -> | ||
| dependencyManagementNode.appendNode('dependency').with { | ||
| appendNode('groupId', subProject.group) | ||
| appendNode('artifactId',subProject.name) | ||
| appendNode('version', subProject.version) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| plugins { | ||
| id 'io.franzbecker.gradle-lombok' version '1.11' | ||
| id 'nebula.provided-base' version '3.0.3' | ||
| id 'com.github.johnrengelman.shadow' version '2.0.2' | ||
| id "com.jfrog.bintray" version "1.8.0" apply false | ||
| } | ||
| subprojects { | ||
| apply plugin: 'nebula.provided-base' | ||
| apply plugin: 'java' | ||
| apply plugin: 'idea' | ||
| apply plugin: 'io.franzbecker.gradle-lombok' | ||
| apply from: "$rootDir/gradle/publishing.gradle" | ||
| apply from: "$rootDir/gradle/bintray.gradle" | ||
| group = "org.testcontainers" | ||
| sourceCompatibility = 1.8 | ||
| targetCompatibility = 1.8 | ||
| compileJava.options.encoding = 'UTF-8' | ||
| lombok { | ||
| version = '1.16.20' | ||
| } | ||
| task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask) { | ||
| def outputDir = file("$buildDir/delombok") | ||
| outputs.dir(outputDir) | ||
| for (srcDir in project.sourceSets.main.java.srcDirs) { | ||
| inputs.dir(srcDir) | ||
| args(srcDir, "-d", outputDir) | ||
| } | ||
| } | ||
| project.tasks.sourceJar.from(delombok) | ||
| task release(dependsOn: bintrayUpload) | ||
| test { | ||
| testLogging { | ||
| displayGranularity 1 | ||
| showStackTraces = true | ||
| exceptionFormat = 'full' | ||
| events "STARTED", "PASSED", "FAILED", "SKIPPED" | ||
| } | ||
| } | ||
| repositories { | ||
| jcenter() | ||
| } | ||
| dependencies { | ||
| testCompile 'ch.qos.logback:logback-classic:1.2.3' | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,47 @@ | ||
| version: 2 | ||
| executorType: machine | ||
| jobs: | ||
| build: | ||
| core: | ||
| steps: | ||
| - checkout | ||
| - run: ./mvnw -B test | ||
| - run: ./gradlew testcontainers:check | ||
| - run: | ||
| name: Save test results | ||
| command: | | ||
| mkdir -p ~/junit/ | ||
| find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \; | ||
| when: always | ||
| - store_test_results: | ||
| path: ~/junit | ||
| modules: | ||
| steps: | ||
| - checkout | ||
| - run: ./gradlew check -x testcontainers:check -x selenium:check | ||
| - run: | ||
| name: Save test results | ||
| command: | | ||
| mkdir -p ~/junit/ | ||
| find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \; | ||
| when: always | ||
| - store_test_results: | ||
| path: ~/junit | ||
| selenium: | ||
| steps: | ||
| - checkout | ||
| - run: ./gradlew selenium:check | ||
| - run: | ||
| name: Save test results | ||
| command: | | ||
| mkdir -p ~/junit/ | ||
| find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \; | ||
| when: always | ||
| - store_test_results: | ||
| path: ~/junit | ||
| workflows: | ||
| version: 2 | ||
| test_all: | ||
| jobs: | ||
| - core | ||
| - modules | ||
| - selenium |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| apply plugin: 'com.github.johnrengelman.shadow' | ||
| description = "Testcontainers Core" | ||
| publishing { | ||
| publications { | ||
| mavenJava(MavenPublication) { publication -> | ||
| artifacts.removeAll { it.classifier == null } | ||
| artifact project.tasks.shadowJar | ||
| } | ||
| } | ||
| } | ||
| sourceSets { | ||
| jarFileTest | ||
| } | ||
| idea.module.testSourceDirs += sourceSets.jarFileTest.allSource.srcDirs | ||
| configurations { | ||
| shaded | ||
| [runtime, compileOnly, testCompile]*.extendsFrom shaded | ||
| } | ||
| shadowJar { | ||
| configurations = [project.configurations.shaded] | ||
| classifier = null | ||
| mergeServiceFiles() | ||
| [ | ||
| 'META-INF/io.netty.versions.properties', | ||
| 'META-INF/NOTICE', | ||
| 'META-INF/NOTICE.txt', | ||
| 'META-INF/LICENSE', | ||
| 'META-INF/LICENSE.txt', | ||
| 'META-INF/DEPENDENCIES', | ||
| 'META-INF/maven/', | ||
| '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/org.glassfish.hk2.extension.*', | ||
| 'META-INF/services/org.jvnet.hk2.external.generator.*', | ||
| 'META-INF/services/org.glassfish.jersey.internal.spi.*', | ||
| 'mozilla/public-suffix-list.txt', | ||
| ].each { exclude(it) } | ||
| relocate('META-INF/native/libnetty', 'META-INF/native/liborg-testcontainers-shaded-netty') | ||
| [ | ||
| "org.apache.http", | ||
| "org.apache.commons.lang", | ||
| "org.glassfish", | ||
| "org.aopalliance", | ||
| "org.jvnet", | ||
| "javax.annotation", | ||
| "javax.inject", | ||
| "javax.ws.rs", | ||
| "com.fasterxml.jackson", | ||
| "jersey.repackaged", | ||
| "com.google", | ||
| "io.netty", | ||
| "org.bouncycastle", | ||
| "org.newsclub", | ||
| "org.zeroturnaround" | ||
| ].each { relocate(it, "org.testcontainers.shaded.$it") } | ||
| dependencies { | ||
| include(dependency('org.apache.httpcomponents:.*')) | ||
| include(dependency('org.glassfish.*:.*')) | ||
| include(dependency('org.aopalliance.*:.*')) | ||
| include(dependency('javax.ws.rs:.*')) | ||
| include(dependency('com.fasterxml.*:.*')) | ||
| include(dependency('com.github.docker-java:.*')) | ||
| include(dependency('com.google.guava:.*')) | ||
| include(dependency('io.netty:.*')) | ||
| include(dependency('org.bouncycastle:.*')) | ||
| include(dependency('org.newsclub.*:.*')) | ||
| include(dependency('org.zeroturnaround:zt-exec')) | ||
| include(dependency('commons-lang:commons-lang')) | ||
| } | ||
| } | ||
| 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) | ||
| dependencies { | ||
| compile 'junit:junit:4.12' | ||
| compile 'org.slf4j:slf4j-api:1.7.25' | ||
| compile 'org.slf4j:slf4j-ext:1.7.25' | ||
| compile 'org.jetbrains:annotations:15.0' | ||
| compile 'javax.annotation:javax.annotation-api:1.3.1' | ||
| compile 'com.google.code.findbugs:jsr305:3.0.2' | ||
| compile 'org.apache.commons:commons-compress:1.15' | ||
| // Added for JDK9 compatibility since it's missing this package | ||
| compile 'javax.xml.bind:jaxb-api:2.3.0' | ||
| compile 'org.rnorth.duct-tape:duct-tape:1.0.6' | ||
| compile 'org.rnorth.visible-assertions:visible-assertions:2.1.0' | ||
| shaded ('com.github.docker-java:docker-java:3.0.12') { | ||
| exclude(group: 'org.glassfish.jersey.core') | ||
| exclude(group: 'org.glassfish.jersey.connectors') | ||
| exclude(group: 'log4j') | ||
| exclude(group: 'com.google.code.findbug') | ||
| } | ||
| shaded 'javax.ws.rs:javax.ws.rs-api:2.0.1' | ||
| shaded 'org.rnorth:tcp-unix-socket-proxy:1.0.1' | ||
| shaded 'org.zeroturnaround:zt-exec:1.8' | ||
| shaded 'commons-lang:commons-lang:2.6' | ||
| // docker-java uses SslConfigurator from jersey-common for TLS | ||
| shaded ('org.glassfish.jersey.core:jersey-common:2.23.1') { | ||
| // SslConfigurator doesn't use classes from dependencies | ||
| exclude(module: '*') | ||
| } | ||
| testCompile 'redis.clients:jedis:2.8.0' | ||
| testCompile 'com.rabbitmq:amqp-client:3.5.3' | ||
| testCompile 'org.mongodb:mongo-java-driver:3.0.2' | ||
| testCompile ('org.mockito:mockito-core:1.10.19') { | ||
| exclude(module: 'hamcrest-core') | ||
| } | ||
| // Synthetic JAR used for MountableFileTest and DirectoryTarResourceTest | ||
| testCompile files('testlib/repo/fakejar/fakejar/0/fakejar-0.jar') | ||
| jarFileTestCompileOnly 'org.projectlombok:lombok:1.16.20' | ||
| jarFileTestCompile 'junit:junit:4.12' | ||
| jarFileTestCompile 'org.assertj:assertj-core:3.8.0' | ||
| jarFileTestCompile 'org.ow2.asm:asm-debug-all:5.2' | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This plugin can normally be omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's not :) We have this line in
core/build.gradle:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we need this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you just.... errr... read it? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"add all sources of "jarFileTest" source set to module's test source dirs" :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I can read it, I was not aware that you have to do this manually, since i.e.
gradle-test-sets-pluginwas doing this automatically.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know the plugin, but thought to use as minimum plugins as possible to keep build simple :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally fine this way, I was just explaining my lack of knowledge regarding this configuration 🤤
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, ok, sorry :)