-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
57 lines (48 loc) · 2.07 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// The GraphQL plugin is compiled with Spring Boot 2.7.
// If you want to use it with Spring Boot 3.x, you have to update these dependencies, like this buildscript block:
buildscript {
repositories {
// The GraphQL plugin depends on libraries that are available with maven
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-starter-graphql:${springBootVersion}"
}
}
plugins {
// CAUTION ! The id of the plugin has changed since 2.0RC1.
// It was 'com.graphql_java_generator.graphql-gradle-plugin'. It is now 'com.graphql-java-generator.graphql-gradle-plugin'
id "com.graphql-java-generator.graphql-gradle-plugin3" version "${graphQLPluginVersion}"
id 'java'
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version "${dependencyManagementPluginVersion}"
}
sourceCompatibility = '17'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot'
// THE VERSION MUST BE THE SAME AS THE PLUGIN's ONE
implementation "com.graphql-java-generator:graphql-java-client-runtime:${graphQLPluginVersion}"
}
// The line below adds the generated sources as a java source folder in the IDE
sourceSets.main.java.srcDirs += '/build/generated/sources/graphqlGradlePlugin'
sourceSets.main.java.srcDirs += '/build/generated/resources/graphqlGradlePlugin'
// Let's configure the GraphQL Gradle Plugin:
// All available parameters are described here:
// https://graphql-maven-plugin-project.graphql-java-generator.com/graphql-maven-plugin/generateClientCode-mojo.html
generateClientCodeConf {
packageName = 'org.forum.client'
customScalars = [ [
graphQLTypeName: "Date",
javaType: "java.util.Date",
graphQLScalarTypeStaticField: "com.graphql_java_generator.customscalars.GraphQLScalarTypeDate.Date"
] ]
// The parameters below are mandatory for 2.0RC1. These parameters will disappear in 2.0, and these values will be forced
copyRuntimeSources = false
generateDeprecatedRequestResponse = false
separateUtilityClasses = true
}