From 75e99429a7bdcfd01ce06dd3e389400120d0aaaa Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Wed, 10 Apr 2024 14:02:25 +0530 Subject: [PATCH] Update the dependency versions to latest timestamps --- build.gradle | 6 +-- gradle.properties | 38 +++++++++---------- graphql-cli/build.gradle | 6 +-- .../graphql/validator/QueryValidator.java | 4 +- graphql-cli/src/main/java/module-info.java | 1 - .../ballerina/FunctionBodyGeneratorTest.java | 24 ++++++------ .../ExtendedOperationDefinitionTest.java | 4 +- graphql-code-generator/build.gradle | 16 ++++---- graphql-schema-file-generator/build.gradle | 4 +- graphql-tool-idl-plugin/build.gradle | 19 +++++----- settings.gradle | 26 +++++++++++++ 11 files changed, 88 insertions(+), 60 deletions(-) diff --git a/build.gradle b/build.gradle index 3c813858..8c0ee636 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,9 @@ plugins { id 'java-library' id 'jacoco' - id "com.github.johnrengelman.shadow" version "${githubJohnrengelmanShadowVersion}" - id "de.undercouch.download" version "${underCouchDownloadVersion}" - id "net.researchgate.release" version "${researchgateReleaseVersion}" + id "com.github.johnrengelman.shadow" + id "de.undercouch.download" + id "net.researchgate.release" } def packageName = "graphql" diff --git a/gradle.properties b/gradle.properties index e49773bc..9d78f0b6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,23 +1,23 @@ org.gradle.caching=true group=io.ballerina version=0.10.0-SNAPSHOT +org.gradle.jvmargs=-Xmx4096M #dependency -ballerinaLangVersion=2201.9.0-20240321-130200-5b03581e -puppycrawlCheckstyleVersion=10.12.1 -githubJohnrengelmanShadowVersion=8.1.1 -underCouchDownloadVersion=5.4.0 -researchgateReleaseVersion=2.8.0 +ballerinaLangVersion=2201.9.0-20240405-165800-4b163f78 +checkstylePluginVersion=10.12.1 +shadowJarPluginVersion=8.1.1 +downloadPluginVersion=5.4.0 +releasePluginVersion=2.8.0 testngVersion=7.6.1 slf4jVersion=1.7.30 commonsLang3Version=3.9 commonsLoggingVersion=1.2 commonsIoVersion=2.11.0 -graphqlJavaVersion=17.2 +graphqlJavaVersion=21.5 snakeYamlVersion=2.0 orgJsonVersion=20231013 picocliVersion=4.7.4 -org.gradle.jvmargs=-Xmx4096M # Standard Library Dependencies # Level 01 @@ -26,32 +26,32 @@ stdlibTimeVersion=2.4.0 stdlibUrlVersion=2.4.0 # Level 02 -stdlibConstraintVersion=1.4.0 -stdlibCryptoVersion=2.5.0 +stdlibConstraintVersion=1.5.0 +stdlibCryptoVersion=2.7.0-20240410-115200-2ae9fd5 stdlibLogVersion=2.9.0 stdlibOsVersion=1.8.0 stdlibTaskVersion=2.5.0 # Level 03 -stdlibCacheVersion=3.7.0 +stdlibCacheVersion=3.8.0-20240409-101100-e2d7f4e stdlibFileVersion=1.9.0 stdlibMimeVersion=2.9.0 -stdlibUuidVersion=1.7.0 +stdlibUuidVersion=1.8.0-20240410-125400-bbe7ac5 # Level 04 -stdlibAuthVersion=2.10.0 -stdlibJwtVersion=2.10.0 -stdlibOAuth2Version=2.10.0 +stdlibAuthVersion=2.11.0-20240410-121600-c514b62 +stdlibJwtVersion=2.11.0-20240410-124800-1a4eb44 +stdlibOAuth2Version=2.11.0-20240410-121700-502990d # Level 05 -stdlibHttpVersion=2.10.4 +stdlibHttpVersion=2.11.0-20240410-121300-ae1095d # Level 06 -stdlibWebsocketVersion=2.10.1 +stdlibWebsocketVersion=2.11.0-20240409-202400-9d7e032 # Level 07 -stdlibGraphqlVersion=1.11.0 +stdlibGraphqlVersion=1.12.0-20240410-115600-7fa8ba3 # Ballerinax Observer -observeVersion=1.2.0 -observeInternalVersion=1.2.1 +observeVersion=1.2.3-20240408-194900-a0e331f +observeInternalVersion=1.2.2-20240408-195500-1436319 diff --git a/graphql-cli/build.gradle b/graphql-cli/build.gradle index bf83e08e..5dcdc3ec 100644 --- a/graphql-cli/build.gradle +++ b/graphql-cli/build.gradle @@ -34,7 +34,7 @@ configurations { dependencies { checkstyle project(':checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${project.puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${project.checkstylePluginVersion}" implementation project(':graphql-schema-file-generator') implementation project(':graphql-code-generator') @@ -50,9 +50,7 @@ dependencies { implementation "commons-logging:commons-logging:${commonsLoggingVersion}" implementation "org.yaml:snakeyaml:${snakeYamlVersion}" implementation "com.graphql-java:graphql-java:${graphqlJavaVersion}" - implementation "org.json:json:${orgJsonVersion}" dist "com.graphql-java:graphql-java:${graphqlJavaVersion}" - dist "org.json:json:${orgJsonVersion}" dist "io.ballerina.stdlib:graphql-commons:${stdlibGraphqlVersion}" balTools ("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") { @@ -66,7 +64,7 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "${project.puppycrawlCheckstyleVersion}" + toolVersion "${project.checkstylePluginVersion}" configFile rootProject.file("config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile" : file("${rootDir}/config/checkstyle/build/suppressions.xml")] } diff --git a/graphql-cli/src/main/java/io/ballerina/graphql/validator/QueryValidator.java b/graphql-cli/src/main/java/io/ballerina/graphql/validator/QueryValidator.java index 6be64338..fa1a56a1 100644 --- a/graphql-cli/src/main/java/io/ballerina/graphql/validator/QueryValidator.java +++ b/graphql-cli/src/main/java/io/ballerina/graphql/validator/QueryValidator.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.util.List; +import java.util.Locale; /** * This class is used to validate the GraphQL query files. @@ -78,7 +79,8 @@ private void validateDocument(GraphQLSchema graphQLSchema, String document, Stri Document parsedDocument = Utils.getGraphQLQueryDocument(document); Validator validator = new Validator(); - List validationErrors = validator.validateDocument(graphQLSchema, parsedDocument); + List validationErrors = validator.validateDocument(graphQLSchema, parsedDocument, + Locale.getDefault()); if (validationErrors.size() > 0) { throw new QueryValidationException("Graph query validation failed.", validationErrors, projectName); } diff --git a/graphql-cli/src/main/java/module-info.java b/graphql-cli/src/main/java/module-info.java index 8d6efbd8..474349e2 100644 --- a/graphql-cli/src/main/java/module-info.java +++ b/graphql-cli/src/main/java/module-info.java @@ -21,7 +21,6 @@ requires org.yaml.snakeyaml; requires io.ballerina.cli; requires info.picocli; - requires org.json; requires java.net.http; requires io.ballerina.parser; requires com.graphqljava; diff --git a/graphql-cli/src/test/java/io/ballerina/graphql/generator/ballerina/FunctionBodyGeneratorTest.java b/graphql-cli/src/test/java/io/ballerina/graphql/generator/ballerina/FunctionBodyGeneratorTest.java index af448c13..357811b4 100644 --- a/graphql-cli/src/test/java/io/ballerina/graphql/generator/ballerina/FunctionBodyGeneratorTest.java +++ b/graphql-cli/src/test/java/io/ballerina/graphql/generator/ballerina/FunctionBodyGeneratorTest.java @@ -247,23 +247,23 @@ public Object[][] dataProviderForInitFunctionBody() { @DataProvider(name = "dataProviderForRemoteFunctionBody") public Object[][] dataProviderForRemoteFunctionBody() { return new Object[][]{ - {"graphql.config.yaml", "{stringquery=string`query country($code:ID!) {country(code:$code) " + + {"graphql.config.yaml", "{stringquery=string`query country($code:ID!){country(code:$code)" + "{capital name}}`;mapvariables={\"code\":code};" + "jsongraphqlResponse=checkself.graphqlClient->executeWithType(query,variables);" + "return check performDataBinding(graphqlResponse, CountryResponse);}"}, - {"graphql-config-with-auth-apikeys-config.yaml", "{stringquery=string`query country($code:ID!) " + - "{country(code:$code) {capital name}}`;mapvariables={\"code\":code};" + + {"graphql-config-with-auth-apikeys-config.yaml", "{stringquery=string`query country($code:ID!)" + + "{country(code:$code){capital name}}`;mapvariables={\"code\":code};" + "mapheaderValues={\"Header1\":self.apiKeysConfig.header1,\"Header2\":" + "self.apiKeysConfig.header2};maphttpHeaders=getMapForHeaders(headerValues);" + "jsongraphqlResponse=checkself.graphqlClient->executeWithType(query,variables," + "headers=httpHeaders);" + "return check performDataBinding(graphqlResponse, CountryResponse);}"}, - {"graphql-config-with-auth-client-config.yaml", "{stringquery=string`query country($code:ID!) " + - "{country(code:$code) {capital name}}`;mapvariables={\"code\":code};" + + {"graphql-config-with-auth-client-config.yaml", "{stringquery=string`query country($code:ID!)" + + "{country(code:$code){capital name}}`;mapvariables={\"code\":code};" + "jsongraphqlResponse=checkself.graphqlClient->executeWithType(query,variables);" + "return check performDataBinding(graphqlResponse, CountryResponse);}"}, {"graphql-config-with-auth-apikeys-and-client-config.yaml", "{stringquery=string`query " + - "country($code:ID!) {country(code:$code) {capital name}}`;" + + "country($code:ID!){country(code:$code){capital name}}`;" + "mapvariables={\"code\":code};mapheaderValues={\"Header1\":" + "self.apiKeysConfig.header1,\"Header2\":self.apiKeysConfig.header2};" + "maphttpHeaders=getMapForHeaders(headerValues);" + @@ -279,9 +279,9 @@ public Object[][] dataProviderForRemoteFunctionBodyWithRequiredParameters() { {"graphql-config-to-test-arguments.yaml", "{stringquery=string`query operation1($argument1:Boolean!," + "$argument2:String!,$argument3:Int!,$argument4:Float!,$argument5:ID!," + "$argument6:CustomScalar!,$argument7:CustomInput!,$argument8:[CustomInput]!," + - "$argument9:[CustomInput!]!) {operation1(argument1:$argument1,argument2:$argument2," + + "$argument9:[CustomInput!]!){operation1(argument1:$argument1,argument2:$argument2," + "argument3:$argument3,argument4:$argument4,argument5:$argument5,argument6:$argument6," + - "argument7:$argument7,argument8:$argument8,argument9:$argument9) {field1 field2}}`;" + + "argument7:$argument7,argument8:$argument8,argument9:$argument9){field1 field2}}`;" + "mapvariables={\"argument9\":argument9,\"argument5\":argument5," + "\"argument6\":argument6,\"argument7\":argument7,\"argument8\":argument8," + "\"argument1\":argument1,\"argument2\":argument2,\"argument3\":argument3," + @@ -295,8 +295,8 @@ public Object[][] dataProviderForRemoteFunctionBodyWithRequiredParameters() { public Object[][] dataProviderForRemoteFunctionBodyWithOptionalParameters() { return new Object[][]{ {"graphql-config-to-test-arguments.yaml", "{stringquery=string`query operation2(" + - "$argument1:CustomInput,$argument2:[CustomInput],$argument3:[CustomInput!]) " + - "{operation2(argument1:$argument1,argument2:$argument2,argument3:$argument3) " + + "$argument1:CustomInput,$argument2:[CustomInput],$argument3:[CustomInput!])" + + "{operation2(argument1:$argument1,argument2:$argument2,argument3:$argument3)" + "{field1 field2}}`;mapvariables={\"argument1\":argument1," + "\"argument2\":argument2,\"argument3\":argument3};jsongraphqlResponse=" + "checkself.graphqlClient->executeWithType(query,variables);" + @@ -308,8 +308,8 @@ public Object[][] dataProviderForRemoteFunctionBodyWithOptionalParameters() { public Object[][] dataProviderForRemoteFunctionBodyWithRequiredAndOptionalParameters() { return new Object[][]{ {"graphql-config-to-test-arguments.yaml", "{stringquery=string`query operation3(" + - "$argument1:CustomInput!,$argument2:CustomInput) {operation3(argument1:$argument1," + - "argument2:$argument2) {field1 field2}}`;mapvariables={\"argument1\":argument1," + + "$argument1:CustomInput!,$argument2:CustomInput){operation3(argument1:$argument1," + + "argument2:$argument2){field1 field2}}`;mapvariables={\"argument1\":argument1," + "\"argument2\":argument2};jsongraphqlResponse=checkself.graphqlClient->" + "executeWithType(query,variables);return " + "check performDataBinding(graphqlResponse, Operation3Response);}"} diff --git a/graphql-cli/src/test/java/io/ballerina/graphql/generator/graphql/components/ExtendedOperationDefinitionTest.java b/graphql-cli/src/test/java/io/ballerina/graphql/generator/graphql/components/ExtendedOperationDefinitionTest.java index f8b31080..f706b117 100644 --- a/graphql-cli/src/test/java/io/ballerina/graphql/generator/graphql/components/ExtendedOperationDefinitionTest.java +++ b/graphql-cli/src/test/java/io/ballerina/graphql/generator/graphql/components/ExtendedOperationDefinitionTest.java @@ -214,9 +214,9 @@ public void testGetQueryString() String generatedQueryString = queryOperation1Definition.getQueryString(); String expectedQueryString = "query operation1($argument1:Boolean!,$argument2:String!,$argument3:Int!," + "$argument4:Float!,$argument5:ID!,$argument6:CustomScalar!,$argument7:CustomInput!," + - "$argument8:[CustomInput]!,$argument9:[CustomInput!]!) {operation1(argument1:$argument1," + + "$argument8:[CustomInput]!,$argument9:[CustomInput!]!){operation1(argument1:$argument1," + "argument2:$argument2,argument3:$argument3,argument4:$argument4,argument5:$argument5," + - "argument6:$argument6,argument7:$argument7,argument8:$argument8,argument9:$argument9) {field1 field2}}"; + "argument6:$argument6,argument7:$argument7,argument8:$argument8,argument9:$argument9){field1 field2}}"; Assert.assertEquals(generatedQueryString, expectedQueryString); } } diff --git a/graphql-code-generator/build.gradle b/graphql-code-generator/build.gradle index 98fc236f..69e965e7 100644 --- a/graphql-code-generator/build.gradle +++ b/graphql-code-generator/build.gradle @@ -15,7 +15,9 @@ * */ -apply plugin: "com.github.johnrengelman.shadow" +plugins { + id "com.github.johnrengelman.shadow" +} configurations { balTools @@ -26,7 +28,7 @@ configurations { dependencies { checkstyle project(':checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${project.puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${project.checkstylePluginVersion}" implementation "org.ballerinalang:ballerina-lang:${ballerinaLangVersion}" implementation "org.ballerinalang:ballerina-parser:${ballerinaLangVersion}" @@ -35,11 +37,11 @@ dependencies { implementation "org.ballerinalang:formatter-core:${ballerinaLangVersion}" implementation "io.ballerina.stdlib:graphql-commons:${stdlibGraphqlVersion}" implementation "commons-io:commons-io:${commonsIoVersion}" - implementation "org.json:json:${orgJsonVersion}" // NEW - implementation "com.graphql-java:graphql-java:${graphqlJavaVersion}" // NEW - implementation "commons-logging:commons-logging:${commonsLoggingVersion}" // NEW + implementation "org.json:json:${orgJsonVersion}" + implementation "com.graphql-java:graphql-java:${graphqlJavaVersion}" + implementation "commons-logging:commons-logging:${commonsLoggingVersion}" testImplementation "org.testng:testng:${testngVersion}" - dist "com.graphql-java:graphql-java:${graphqlJavaVersion}" // NEW + dist "com.graphql-java:graphql-java:${graphqlJavaVersion}" balTools ("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") { transitive = false @@ -52,7 +54,7 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "${project.puppycrawlCheckstyleVersion}" + toolVersion "${project.checkstylePluginVersion}" configFile rootProject.file("config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile" : file("${rootDir}/config/checkstyle/build/suppressions.xml")] } diff --git a/graphql-schema-file-generator/build.gradle b/graphql-schema-file-generator/build.gradle index 42dc47b6..0bf43d3b 100644 --- a/graphql-schema-file-generator/build.gradle +++ b/graphql-schema-file-generator/build.gradle @@ -29,7 +29,7 @@ configurations { dependencies { checkstyle project(':checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${project.puppycrawlCheckstyleVersion}" + checkstyle "com.puppycrawl.tools:checkstyle:${project.checkstylePluginVersion}" implementation "org.ballerinalang:ballerina-lang:${ballerinaLangVersion}" implementation "org.ballerinalang:ballerina-parser:${ballerinaLangVersion}" @@ -48,7 +48,7 @@ tasks.withType(Checkstyle) { } checkstyle { - toolVersion "${project.puppycrawlCheckstyleVersion}" + toolVersion "${project.checkstylePluginVersion}" configFile rootProject.file("config/checkstyle/build/checkstyle.xml") configProperties = ["suppressionFile" : file("${rootDir}/config/checkstyle/build/suppressions.xml")] } diff --git a/graphql-tool-idl-plugin/build.gradle b/graphql-tool-idl-plugin/build.gradle index b4ffdd8b..bb715a99 100644 --- a/graphql-tool-idl-plugin/build.gradle +++ b/graphql-tool-idl-plugin/build.gradle @@ -15,8 +15,10 @@ * */ -apply plugin: "com.github.johnrengelman.shadow" -apply plugin: "jacoco" +plugins { + id "com.github.johnrengelman.shadow" + id "jacoco" +} configurations { balTools @@ -36,13 +38,12 @@ dependencies { testImplementation "org.testng:testng:${testngVersion}" testImplementation "org.apache.commons:commons-lang3:${commonsLang3Version}" implementation "commons-io:commons-io:${commonsIoVersion}" - implementation "commons-logging:commons-logging:${commonsLoggingVersion}" // NEW - implementation "org.yaml:snakeyaml:${snakeYamlVersion}" // NEW - implementation "com.graphql-java:graphql-java:${graphqlJavaVersion}" // NEW - implementation "org.json:json:${orgJsonVersion}" // NEW - dist "com.graphql-java:graphql-java:${graphqlJavaVersion}" // NEW - dist "com.google.guava:guava:${googleGuavaVersion}" // NEW - dist "org.json:json:${orgJsonVersion}" // NEW + implementation "commons-logging:commons-logging:${commonsLoggingVersion}" + implementation "org.yaml:snakeyaml:${snakeYamlVersion}" + implementation "com.graphql-java:graphql-java:${graphqlJavaVersion}" + implementation "org.json:json:${orgJsonVersion}" + implementation "com.graphql-java:graphql-java:${graphqlJavaVersion}" + implementation "org.json:json:${orgJsonVersion}" balTools ("org.ballerinalang:jballerina-tools:${ballerinaLangVersion}") { transitive = false diff --git a/settings.gradle b/settings.gradle index 9b4317a4..8c4bbf69 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,29 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you 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 + * + * http://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. + */ + +pluginManagement { + plugins { + id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}" + id "de.undercouch.download" version "${downloadPluginVersion}" + id "net.researchgate.release" version "${releasePluginVersion}" + } +} + plugins { id "com.gradle.enterprise" version "3.13.2" }