From 559c089516d4ad73fe360ee5fab80dcc51ddc421 Mon Sep 17 00:00:00 2001 From: Guy Davenport Date: Fri, 18 Oct 2024 17:29:13 +1300 Subject: [PATCH] updated gradle build --- generator/.gitignore | 3 ++- generator/build.gradle | 32 +++++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/generator/.gitignore b/generator/.gitignore index f06dfad6..2e384376 100644 --- a/generator/.gitignore +++ b/generator/.gitignore @@ -1,2 +1,3 @@ .gradle -build \ No newline at end of file +build +!gradle/wrapper/gradle-wrapper.jar \ No newline at end of file diff --git a/generator/build.gradle b/generator/build.gradle index dfffb336..7c9a4afd 100644 --- a/generator/build.gradle +++ b/generator/build.gradle @@ -1,7 +1,7 @@ apply plugin : "java" ext { javaMainClass = 'org.brapi.schematools.cli.BrAPICommand' - brapiSchemaToolsVersion = '0.5.0-SNAPSHOT' + brapiSchemaToolsVersion = '0.7.0-SNAPSHOT' } repositories { @@ -13,11 +13,37 @@ dependencies { implementation "org.brapi:brapi-schema-tools-cli:$brapiSchemaToolsVersion" } -tasks.register('validate', JavaExec) { +tasks.register("validate", JavaExec) { group = 'BrAPI' description = 'Validate the Json Schema' classpath = sourceSets.main.runtimeClasspath mainClass = javaMainClass workingDir = '../' - args = ['validate', 'Specification/BrAPI-Schema'] + args = ['validate', 'Specification/BrAPI-Schema', '-x'] +} + +tasks.register("generateGraphQL", JavaExec) { + group = 'BrAPI' + description = 'Generate GraphQL schema from the Json Schema' + classpath = sourceSets.main.runtimeClasspath + mainClass = javaMainClass + workingDir = '../' + args = ['generate', + 'Specification/BrAPI-Schema', + '-l', 'GRAPHQL', + '-f', 'Specification/Generated/schema.graphqls', + '-x'] +} + +tasks.register("generateOpenAPI", JavaExec) { + group = 'BrAPI' + description = 'Generate GraphQL schema from the Json Schema' + classpath = sourceSets.main.runtimeClasspath + mainClass = javaMainClass + workingDir = '../' + args = ['generate', 'Specification/BrAPI-Schema', + '-l', 'OPEN_API', + '-f', 'Specification/Generated/brapi_openapi.json', + '-c', 'Specification\\OpenAPI-Components', + '-x'] } \ No newline at end of file