diff --git a/build.gradle b/build.gradle index 128bd07a..03e0699e 100644 --- a/build.gradle +++ b/build.gradle @@ -37,15 +37,19 @@ sonarqube { } } +def bomProjectName = "graphql-spring-boot-dependencies" + subprojects { apply plugin: 'idea' - apply plugin: 'jacoco' - apply plugin: 'org.sonarqube' - apply plugin: 'java' - apply plugin: 'java-library' + if (it.name != bomProjectName) { + apply plugin: 'jacoco' + apply plugin: 'org.sonarqube' + apply plugin: 'java' + apply plugin: 'java-library' + apply plugin: "io.spring.dependency-management" + } apply plugin: 'maven-publish' apply plugin: "com.jfrog.bintray" - apply plugin: "io.spring.dependency-management" apply plugin: 'com.jfrog.artifactory' group "$PROJECT_GROUP" @@ -60,60 +64,62 @@ subprojects { maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local" } } - dependencyManagement { - imports { - mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER" + if (it.name != bomProjectName) { + dependencyManagement { + imports { + mavenBom "org.springframework.boot:spring-boot-starter-parent:$LIB_SPRING_BOOT_VER" + } } - } - dependencies { - compileOnly "org.projectlombok:lombok" - annotationProcessor "org.projectlombok:lombok" + dependencies { + compileOnly "org.projectlombok:lombok" + annotationProcessor "org.projectlombok:lombok" - testCompileOnly "org.projectlombok:lombok" - testAnnotationProcessor "org.projectlombok:lombok" - } + testCompileOnly "org.projectlombok:lombok" + testAnnotationProcessor "org.projectlombok:lombok" + } - test { - useJUnitPlatform() - testLogging { - events TestLogEvent.FAILED, - TestLogEvent.PASSED, - TestLogEvent.SKIPPED, - TestLogEvent.STANDARD_ERROR, - TestLogEvent.STANDARD_OUT - exceptionFormat TestExceptionFormat.FULL - showCauses true - showExceptions true - showStackTraces true + test { + useJUnitPlatform() + testLogging { + events TestLogEvent.FAILED, + TestLogEvent.PASSED, + TestLogEvent.SKIPPED, + TestLogEvent.STANDARD_ERROR, + TestLogEvent.STANDARD_OUT + exceptionFormat TestExceptionFormat.FULL + showCauses true + showExceptions true + showStackTraces true + } } - } - jacoco { - toolVersion = "0.8.7-SNAPSHOT" - } + jacoco { + toolVersion = "0.8.7-SNAPSHOT" + } - jacocoTestReport { - reports { - xml.enabled = true - html.enabled = false - csv.enabled = false + jacocoTestReport { + reports { + xml.enabled = true + html.enabled = false + csv.enabled = false + } } - } - idea { - module { - downloadJavadoc = true - downloadSources = true + idea { + module { + downloadJavadoc = true + downloadSources = true + } } - } - compileJava { - sourceCompatibility = SOURCE_COMPATIBILITY - targetCompatibility = TARGET_COMPATIBILITY - } + compileJava { + sourceCompatibility = SOURCE_COMPATIBILITY + targetCompatibility = TARGET_COMPATIBILITY + } - compileJava.dependsOn(processResources) + compileJava.dependsOn(processResources) + } if (!it.name.startsWith('example')) { @@ -122,19 +128,23 @@ subprojects { enabled = false } - jar { - from "LICENSE.md" - } + if (it.name != bomProjectName) { + jar { + from "LICENSE.md" + } - java { - withSourcesJar() - withJavadocJar() + java { + withSourcesJar() + withJavadocJar() + } } publishing { publications { mainProjectPublication(MavenPublication) { - from components.java + if (project.name != bomProjectName) { + from components.java + } // to avoid "Publication only contains dependencies and/or constraints without a version" error // see https://docs.gradle.org/6.2.1/userguide/publishing_maven.html#publishing_maven:resolved_dependencies diff --git a/graphql-spring-boot-dependencies/build.gradle b/graphql-spring-boot-dependencies/build.gradle new file mode 100644 index 00000000..8ba03b89 --- /dev/null +++ b/graphql-spring-boot-dependencies/build.gradle @@ -0,0 +1,31 @@ +apply plugin: "java-platform" + +dependencies { + constraints { + api "com.graphql-java:graphql-java-extended-scalars:$LIB_EXTENDED_SCALARS_VERSION" + api "com.graphql-java:graphql-java:$LIB_GRAPHQL_JAVA_VER" + api "com.graphql-java-kickstart:graphql-java-servlet:$LIB_GRAPHQL_SERVLET_VER" + api "com.graphql-java-kickstart:graphql-java-kickstart:$LIB_GRAPHQL_SERVLET_VER" + api "com.graphql-java-kickstart:graphql-java-tools:$LIB_GRAPHQL_JAVA_TOOLS_VER" + api "io.github.graphql-java:graphql-java-annotations:$LIB_GRAPHQL_ANNOTATIONS_VER" + api project(":graphql-spring-boot-starter") + runtime project(":altair-spring-boot-starter") + runtime project(":graphiql-spring-boot-starter") + runtime project(":voyager-spring-boot-starter") + runtime project(":playground-spring-boot-starter") + api project(":graphql-spring-boot-starter-test") + api project(":graphql-kickstart-spring-boot-starter-webflux") + api project(":graphql-kickstart-spring-boot-starter-tools") + api project(":graphql-kickstart-spring-boot-starter-graphql-annotations") + } +} + +publishing { + publications { + mainProjectPublication(MavenPublication) { + from components.javaPlatform + } + } +} + + diff --git a/settings.gradle b/settings.gradle index 9b81e8b9..03f5209b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -38,6 +38,8 @@ include ":voyager-spring-boot-starter" include ":playground-spring-boot-autoconfigure" include ":playground-spring-boot-starter" +include ':graphql-spring-boot-dependencies' + include ':graphql-kickstart-spring-boot-autoconfigure-graphql-annotations' include ':graphql-kickstart-spring-boot-starter-graphql-annotations' include ':graphql-kickstart-spring-boot-autoconfigure-tools'