-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
60 lines (51 loc) · 2.43 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
58
59
60
buildscript {
repositories {
// The GraphQL plugin depends on libraries that are available with maven
mavenLocal()
mavenCentral()
}
}
plugins {
id 'java'
// 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 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version "${dependencyManagementPluginVersion}"
}
sourceCompatibility = '17'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// The graphql-java-runtime module agregates all dependencies for the generated code, including the plugin runtime
// CAUTION: this version should be exactly the same as the graphql-gradle-plugin's version
implementation "com.graphql-java-generator:graphql-java-server-runtime:${graphQLPluginVersion}"
implementation 'com.github.dozermapper:dozer-core:6.5.2'
// Then, the dependencies that are specific to this project
implementation "org.springframework.boot:spring-boot-starter-websocket" // Mandatory to activate the web sockets (mandatory for subscription)
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
runtimeOnly "com.h2database:h2"
}
// 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.resources.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/generateServerCode-mojo.html
generateServerCodeConf {
packageName = 'org.forum.server.graphql'
scanBasePackages = 'org.forum.server.impl, org.forum.server.jpa'
schemaPersonalizationFile = 'src/main/graphql/forum_personalization.json'
useJakartaEE9 = true
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
generateBatchLoaderEnvironment = true
separateUtilityClasses = true
}