Skip to content

Commit d2b8500

Browse files
committed
Merge remote-tracking branch 'origin/master' into deprecated-directive-is-checked-for-location-correctedness
# Conflicts: # src/main/java/graphql/schema/idl/SchemaGeneratorHelper.java
2 parents d54745b + a39aec8 commit d2b8500

161 files changed

Lines changed: 4893 additions & 2243 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import java.text.SimpleDateFormat
22

33
plugins {
44
id "com.jfrog.bintray" version "1.8.4"
5+
id 'java'
6+
id 'java-library'
7+
id 'maven'
8+
id 'maven-publish'
9+
id 'antlr'
10+
11+
// id 'osgi' doesn't work anymore for gradle 6.6
12+
513
}
614

7-
apply plugin: 'java'
8-
apply plugin: 'maven'
9-
apply plugin: 'maven-publish'
10-
apply plugin: 'antlr'
11-
apply plugin: 'osgi'
1215

1316
def getDevelopmentVersion() {
1417
def output = new StringBuilder()
@@ -29,7 +32,7 @@ def getDevelopmentVersion() {
2932
sourceCompatibility = 1.8
3033
targetCompatibility = 1.8
3134
def reactiveStreamsVersion = '1.0.2'
32-
def slf4jVersion = '1.7.25'
35+
def slf4jVersion = '1.7.30'
3336
def releaseVersion = System.env.RELEASE_VERSION
3437
version = releaseVersion ? releaseVersion : getDevelopmentVersion()
3538
group = 'com.graphql-java'
@@ -48,33 +51,36 @@ jar {
4851
from "src/main/antlr/GraphqlOperation.g4"
4952
from "src/main/antlr/GraphqlSDL.g4"
5053
from "src/main/antlr/GraphqlCommon.g4"
54+
manifest {
55+
attributes('Automatic-Module-Name': 'com.graphql-java')
56+
}
5157
}
5258

5359
dependencies {
54-
compile 'org.antlr:antlr4-runtime:4.7.2'
55-
compile 'org.slf4j:slf4j-api:' + slf4jVersion
56-
compile 'com.graphql-java:java-dataloader:2.2.3'
57-
compile 'org.reactivestreams:reactive-streams:' + reactiveStreamsVersion
58-
antlr "org.antlr:antlr4:4.7.2"
59-
testCompile group: 'junit', name: 'junit', version: '4.12'
60-
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
61-
testCompile 'org.codehaus.groovy:groovy-all:2.4.13'
62-
testCompile 'cglib:cglib-nodep:3.3.0'
63-
testCompile 'org.objenesis:objenesis:2.1'
64-
testCompile 'com.google.code.gson:gson:2.8.0'
65-
testCompile 'org.eclipse.jetty:jetty-server:9.4.26.v20200117'
66-
testCompile 'com.fasterxml.jackson.core:jackson-databind:2.10.0'
67-
testCompile 'org.slf4j:slf4j-simple:' + slf4jVersion
68-
testCompile 'org.awaitility:awaitility-groovy:3.0.0'
69-
testCompile 'com.github.javafaker:javafaker:0.13'
60+
implementation 'org.antlr:antlr4-runtime:4.8'
61+
implementation 'org.slf4j:slf4j-api:' + slf4jVersion
62+
api 'com.graphql-java:java-dataloader:2.2.3'
63+
api 'org.reactivestreams:reactive-streams:' + reactiveStreamsVersion
64+
antlr "org.antlr:antlr4:4.8"
65+
testImplementation group: 'junit', name: 'junit', version: '4.12'
66+
testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5'
67+
testImplementation 'org.codehaus.groovy:groovy-all:2.5.13'
68+
testImplementation 'cglib:cglib-nodep:3.3.0'
69+
testImplementation 'org.objenesis:objenesis:2.1'
70+
testImplementation 'com.google.code.gson:gson:2.8.0'
71+
testImplementation 'org.eclipse.jetty:jetty-server:9.4.26.v20200117'
72+
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.11.2'
73+
testImplementation 'org.slf4j:slf4j-simple:' + slf4jVersion
74+
testImplementation 'org.awaitility:awaitility-groovy:3.0.0'
75+
testImplementation 'com.github.javafaker:javafaker:0.13'
7076

71-
testCompile 'org.reactivestreams:reactive-streams-tck:' + reactiveStreamsVersion
72-
testCompile "io.reactivex.rxjava2:rxjava:2.1.5"
77+
testImplementation 'org.reactivestreams:reactive-streams-tck:' + reactiveStreamsVersion
78+
testImplementation "io.reactivex.rxjava2:rxjava:2.1.5"
7379

74-
testCompile 'org.testng:testng:6.1.1' // use for reactive streams test inheritance
80+
testImplementation 'org.testng:testng:6.1.1' // use for reactive streams test inheritance
7581

76-
testCompile 'org.openjdk.jmh:jmh-core:1.21'
77-
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.21'
82+
testImplementation 'org.openjdk.jmh:jmh-core:1.21'
83+
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.21'
7884
}
7985

8086

@@ -93,6 +99,7 @@ generateGrammarSource {
9399
}
94100
generateGrammarSource.inputs.dir('src/main/antlr')
95101

102+
96103
task sourcesJar(type: Jar) {
97104
dependsOn classes
98105
classifier 'sources'
@@ -217,7 +224,7 @@ tasks.withType(PublishToMavenRepository) {
217224
}
218225

219226

220-
task wrapper(type: Wrapper) {
221-
gradleVersion = '4.10.2'
227+
task myWrapper(type: Wrapper) {
228+
gradleVersion = '6.6.1'
222229
distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
223230
}

gradle/wrapper/gradle-wrapper.jar

4.76 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

gradlew

Lines changed: 33 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 24 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/graphql/DirectivesUtil.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ public static Map<String, GraphQLDirective> directivesByName(List<GraphQLDirecti
1515
return FpKit.getByName(directiveList, GraphQLDirective::getName, FpKit.mergeFirst());
1616
}
1717

18+
public static Optional<GraphQLDirective> directiveByName(List<GraphQLDirective> directives, String directiveName) {
19+
for (GraphQLDirective directive : directives) {
20+
if (directive.getName().equals(directiveName)) {
21+
return Optional.of(directive);
22+
}
23+
}
24+
return Optional.empty();
25+
}
26+
1827
public static Optional<GraphQLArgument> directiveWithArg(List<GraphQLDirective> directiveList, String directiveName, String argumentName) {
19-
GraphQLDirective directive = directivesByName(directiveList).get(directiveName);
28+
GraphQLDirective directive = directiveByName(directiveList, directiveName).orElse(null);
2029
GraphQLArgument argument = null;
2130
if (directive != null) {
2231
argument = directive.getArgument(argumentName);

src/main/java/graphql/ExceptionWhileDataFetching.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ private Map<String, Object> mkExtensions(Throwable exception) {
4646
if (exception instanceof GraphQLError) {
4747
Map<String, Object> map = ((GraphQLError) exception).getExtensions();
4848
if (map != null) {
49-
extensions = new LinkedHashMap<>();
50-
extensions.putAll(map);
49+
extensions = new LinkedHashMap<>(map);
5150
}
5251
}
5352
return extensions;

0 commit comments

Comments
 (0)