From b6cc9e4dd5087b4e34f51e97f5df31c5b85f416b Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Mon, 26 Apr 2021 21:55:30 +0100 Subject: [PATCH] Remove spring-graphql-core module Move its contents into the spring-graphql module. --- graphql-spring-boot-starter/build.gradle | 1 - .../boot/GraphQLAutoConfiguration.java | 2 +- settings.gradle | 3 +- spring-graphql-core/build.gradle | 48 ------------------- spring-graphql/build.gradle | 5 +- .../data}/ReactorDataFetcherAdapter.java | 2 +- .../graphql/data/package-info.java | 21 ++++++++ .../web/AbstractWebGraphQLService.java | 2 +- .../data}/ReactorDataFetcherAdapterTests.java | 2 +- .../src/test/resources/log4j2-test.xml | 0 10 files changed, 27 insertions(+), 59 deletions(-) delete mode 100644 spring-graphql-core/build.gradle rename {spring-graphql-core/src/main/java/org/springframework/graphql/core => spring-graphql/src/main/java/org/springframework/graphql/data}/ReactorDataFetcherAdapter.java (99%) create mode 100644 spring-graphql/src/main/java/org/springframework/graphql/data/package-info.java rename {spring-graphql-core/src/test/java/org/springframework/graphql/core => spring-graphql/src/test/java/org/springframework/graphql/data}/ReactorDataFetcherAdapterTests.java (99%) rename {spring-graphql-core => spring-graphql}/src/test/resources/log4j2-test.xml (100%) diff --git a/graphql-spring-boot-starter/build.gradle b/graphql-spring-boot-starter/build.gradle index 779570d2..f0c72f2c 100644 --- a/graphql-spring-boot-starter/build.gradle +++ b/graphql-spring-boot-starter/build.gradle @@ -24,7 +24,6 @@ dependencyManagement { } dependencies { - api project(':spring-graphql-core') api project(':spring-graphql') api 'com.graphql-java:graphql-java:16.2' api 'io.projectreactor:reactor-core' diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQLAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQLAutoConfiguration.java index d48c5a79..b51d53d6 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQLAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/GraphQLAutoConfiguration.java @@ -37,7 +37,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import org.springframework.graphql.core.ReactorDataFetcherAdapter; +import org.springframework.graphql.data.ReactorDataFetcherAdapter; @Configuration @ConditionalOnClass(GraphQL.class) diff --git a/settings.gradle b/settings.gradle index 2e2c7982..c1194735 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,8 +15,7 @@ pluginManagement { } rootProject.name = 'spring-graphql' -include 'spring-graphql-core', - 'spring-graphql', +include 'spring-graphql', 'spring-graphql-test', 'graphql-spring-boot-starter', 'samples:webmvc-http', diff --git a/spring-graphql-core/build.gradle b/spring-graphql-core/build.gradle deleted file mode 100644 index 4649ad90..00000000 --- a/spring-graphql-core/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ - -plugins { - id 'io.spring.dependency-management' version '1.0.10.RELEASE' - id 'java-library' - id 'maven' -} - -description = "Basic Support and Utilities for Spring GraphQL Applications" - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencyManagement { - imports { - mavenBom "io.projectreactor:reactor-bom:2020.0.6" - mavenBom "org.springframework:spring-framework-bom:5.3.6" - } - generatedPomCustomization { - enabled = false - } -} - -dependencies { - api 'com.graphql-java:graphql-java:16.2' - api 'io.projectreactor:reactor-core' - api 'org.springframework:spring-context' - - compileOnly "javax.annotation:javax.annotation-api:1.3.2" - - testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1' - testImplementation 'org.assertj:assertj-core:3.19.0' - testImplementation 'org.mockito:mockito-core:3.8.0' - testImplementation 'io.projectreactor:reactor-test' - - testRuntime 'org.apache.logging.log4j:log4j-core:2.14.1' - testRuntime 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1' -} - -test { - useJUnitPlatform() - testLogging { - events "passed", "skipped", "failed" - } -} - -apply from: "${rootDir}/gradle/publishing.gradle" diff --git a/spring-graphql/build.gradle b/spring-graphql/build.gradle index 88b813ec..6f644791 100644 --- a/spring-graphql/build.gradle +++ b/spring-graphql/build.gradle @@ -24,7 +24,6 @@ dependencyManagement { } dependencies { - api project(':spring-graphql-core') api 'com.graphql-java:graphql-java:16.2' api 'io.projectreactor:reactor-core' api 'org.springframework:spring-context' @@ -37,13 +36,11 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1' testImplementation 'org.assertj:assertj-core:3.19.0' - testImplementation 'com.jayway.jsonpath:json-path:2.5.0' - testImplementation 'org.skyscreamer:jsonassert:1.5.0' + testImplementation 'io.projectreactor:reactor-test' testImplementation 'org.springframework:spring-webflux' testImplementation 'org.springframework:spring-webmvc' testImplementation 'org.springframework:spring-websocket' testImplementation 'org.springframework:spring-test' - testImplementation 'io.projectreactor:reactor-test' testImplementation 'javax.servlet:javax.servlet-api:4.0.1' testImplementation 'com.fasterxml.jackson.core:jackson-databind' } diff --git a/spring-graphql-core/src/main/java/org/springframework/graphql/core/ReactorDataFetcherAdapter.java b/spring-graphql/src/main/java/org/springframework/graphql/data/ReactorDataFetcherAdapter.java similarity index 99% rename from spring-graphql-core/src/main/java/org/springframework/graphql/core/ReactorDataFetcherAdapter.java rename to spring-graphql/src/main/java/org/springframework/graphql/data/ReactorDataFetcherAdapter.java index e5dce782..91b59de0 100644 --- a/spring-graphql-core/src/main/java/org/springframework/graphql/core/ReactorDataFetcherAdapter.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/data/ReactorDataFetcherAdapter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.graphql.core; +package org.springframework.graphql.data; import java.lang.reflect.Method; diff --git a/spring-graphql/src/main/java/org/springframework/graphql/data/package-info.java b/spring-graphql/src/main/java/org/springframework/graphql/data/package-info.java new file mode 100644 index 00000000..080057b7 --- /dev/null +++ b/spring-graphql/src/main/java/org/springframework/graphql/data/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2020-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@NonNullApi +@NonNullFields +package org.springframework.graphql.data; + +import org.springframework.lang.NonNullApi; +import org.springframework.lang.NonNullFields; diff --git a/spring-graphql/src/main/java/org/springframework/graphql/web/AbstractWebGraphQLService.java b/spring-graphql/src/main/java/org/springframework/graphql/web/AbstractWebGraphQLService.java index 69d79706..bfb7d5e1 100644 --- a/spring-graphql/src/main/java/org/springframework/graphql/web/AbstractWebGraphQLService.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/web/AbstractWebGraphQLService.java @@ -23,7 +23,7 @@ import graphql.ExecutionInput; import graphql.ExecutionResult; import reactor.core.publisher.Mono; -import org.springframework.graphql.core.ReactorDataFetcherAdapter; +import org.springframework.graphql.data.ReactorDataFetcherAdapter; /** * Base class for {@link WebGraphQLService} implementations, providing support diff --git a/spring-graphql-core/src/test/java/org/springframework/graphql/core/ReactorDataFetcherAdapterTests.java b/spring-graphql/src/test/java/org/springframework/graphql/data/ReactorDataFetcherAdapterTests.java similarity index 99% rename from spring-graphql-core/src/test/java/org/springframework/graphql/core/ReactorDataFetcherAdapterTests.java rename to spring-graphql/src/test/java/org/springframework/graphql/data/ReactorDataFetcherAdapterTests.java index c0548efa..ea1d4cf1 100644 --- a/spring-graphql-core/src/test/java/org/springframework/graphql/core/ReactorDataFetcherAdapterTests.java +++ b/spring-graphql/src/test/java/org/springframework/graphql/data/ReactorDataFetcherAdapterTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.graphql.core; +package org.springframework.graphql.data; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/spring-graphql-core/src/test/resources/log4j2-test.xml b/spring-graphql/src/test/resources/log4j2-test.xml similarity index 100% rename from spring-graphql-core/src/test/resources/log4j2-test.xml rename to spring-graphql/src/test/resources/log4j2-test.xml