From 60af1ea64f86512fb705561f382da83b8afbfcd9 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Fri, 8 Oct 2021 11:38:16 -0500 Subject: [PATCH] Polish build file and ensure module sources and javadocs jars are published --- .gitignore | 5 +- README.adoc | 4 +- build.gradle | 63 +++++++++++++++---- spring-credhub-integration-tests/build.gradle | 8 +-- .../build.gradle | 2 +- .../ReactiveCredentialIntegrationTests.java | 8 +-- 6 files changed, 65 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index d19c93b..3e4fd89 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,7 @@ bin build out -target \ No newline at end of file +target + +credhub-server/config/*.pem +credhub-server/uaa.yml \ No newline at end of file diff --git a/README.adoc b/README.adoc index 307e560..00d26c8 100644 --- a/README.adoc +++ b/README.adoc @@ -1,8 +1,6 @@ -image::https://build.spring.io/plugins/servlet/wittified/build-status/SPRINGCREDHUB-CORE[Build Status,link=https://build.spring.io/browse/SPRINGCREDHUB-CORE] - image::https://spring.io/badges/spring-credhub/snapshot.svg[link=https://projects.spring.io/spring-credhub#quick-start] -= Spring CredHub +== Spring CredHub Spring CredHub provides client-side support for storing, retrieving, and deleting credentials from a https://github.com/cloudfoundry-incubator/credhub[CredHub] server running in a https://www.cloudfoundry.org/[Cloud Foundry] platform. diff --git a/build.gradle b/build.gradle index d0f8026..dc7f90a 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ plugins { id 'checkstyle' id 'io.spring.nohttp' version '0.0.10' - id 'io.spring.dependency-management' version '1.0.10.RELEASE' + id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'io.spring.javaformat' version '0.0.29' } @@ -67,7 +67,7 @@ configure(allprojects) { } } -configure(allprojects - [project(':spring-credhub-docs')]) { +configure(allprojects) { apply plugin: 'checkstyle' apply plugin: 'io.spring.nohttp' apply plugin: 'io.spring.javaformat' @@ -86,10 +86,35 @@ configure(allprojects - [project(':spring-credhub-docs')]) { } } -configure(allprojects - [project(':spring-credhub-docs'), - project(':spring-credhub-integration-tests'), - project(':spring-credhub-reactive-integration-tests')]) { +configure(libraryProjects) { apply plugin: 'java-library' + + java { + withJavadocJar() + withSourcesJar() + } + + javadoc { + options.encoding = 'UTF-8' + options.memberLevel = JavadocMemberLevel.PROTECTED + options.author = true + options.header = project.name + } + + sourcesJar { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + archiveClassifier.set "sources" + from sourceSets.main.allJava + } + + javadocJar { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + archiveClassifier.set "javadoc" + from javadoc + } +} + +configure(publishedProjects) { apply from: "${rootProject.projectDir}/publish-maven.gradle" } @@ -119,13 +144,6 @@ subprojects { } } - javadoc { - options.encoding = 'UTF-8' - options.memberLevel = JavadocMemberLevel.PROTECTED - options.author = true - options.header = project.name - } - dependencies { testCompile("junit:junit:$junitVersion") testCompile("org.mockito:mockito-core:$mockitoVersion") @@ -201,3 +219,24 @@ configure(rootProject) { description = "Builds -dist and -docs distribution archives." } } + +def getDocumentationProjects() { + [project(":spring-credhub-docs")] as Set +} + +def getTestProjects() { + [project(":spring-credhub-integration-tests"), + project(":spring-credhub-reactive-integration-tests")] as Set +} + +def getJavaProjects() { + subprojects +} + +def getLibraryProjects() { + javaProjects - documentationProjects - testProjects +} + +def getPublishedProjects() { + libraryProjects + rootProject +} diff --git a/spring-credhub-integration-tests/build.gradle b/spring-credhub-integration-tests/build.gradle index 71b3a33..31c8ab6 100644 --- a/spring-credhub-integration-tests/build.gradle +++ b/spring-credhub-integration-tests/build.gradle @@ -41,15 +41,15 @@ dependencies { compile("org.springframework.security:spring-security-oauth2-client") if (project.hasProperty("useOkHttp3")) { - compile("com.squareup.okhttp3:okhttp:${okHttp3Version}") + compile("com.squareup.okhttp3:okhttp") } else if (project.hasProperty("useNetty")) { - compile("io.netty:netty-all:${nettyVersion}") + compile("io.netty:netty-all") } else { - compile("org.apache.httpcomponents:httpclient:${httpClientVersion}") + compile("org.apache.httpcomponents:httpclient") } testCompile("org.springframework.boot:spring-boot-starter-test") - testCompile("org.assertj:assertj-core:${assertJVersion}") + testCompile("org.assertj:assertj-core") } test { diff --git a/spring-credhub-reactive-integration-tests/build.gradle b/spring-credhub-reactive-integration-tests/build.gradle index ab1e93f..359de2f 100644 --- a/spring-credhub-reactive-integration-tests/build.gradle +++ b/spring-credhub-reactive-integration-tests/build.gradle @@ -43,7 +43,7 @@ dependencies { testCompile("org.springframework.boot:spring-boot-starter-test") testCompile("io.projectreactor:reactor-test") - testCompile("org.assertj:assertj-core:${assertJVersion}") + testCompile("org.assertj:assertj-core") } test { diff --git a/spring-credhub-reactive-integration-tests/src/test/java/org/springframework/credhub/integration/ReactiveCredentialIntegrationTests.java b/spring-credhub-reactive-integration-tests/src/test/java/org/springframework/credhub/integration/ReactiveCredentialIntegrationTests.java index 16955d0..35e3bdd 100644 --- a/spring-credhub-reactive-integration-tests/src/test/java/org/springframework/credhub/integration/ReactiveCredentialIntegrationTests.java +++ b/spring-credhub-reactive-integration-tests/src/test/java/org/springframework/credhub/integration/ReactiveCredentialIntegrationTests.java @@ -96,13 +96,13 @@ public class ReactiveCredentialIntegrationTests extends ReactiveCredHubIntegrati }).verifyComplete(); StepVerifier.create(this.credentials.findByName(new SimpleCredentialName("/test"))) - .assertNext((response) -> assertThat(response).extracting("name").extracting("name") - .containsExactly(CREDENTIAL_NAME.getName())) + .assertNext((response) -> assertThat(response).extracting("name").extracting("name").asString() + .contains(CREDENTIAL_NAME.getName())) .verifyComplete(); StepVerifier.create(this.credentials.findByPath("/spring-credhub/integration-test")) - .assertNext((response) -> assertThat(response).extracting("name").extracting("name") - .containsExactly(CREDENTIAL_NAME.getName())) + .assertNext((response) -> assertThat(response).extracting("name").extracting("name").asString() + .contains(CREDENTIAL_NAME.getName())) .verifyComplete(); }