-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
107 lines (93 loc) · 3.71 KB
/
build.gradle
File metadata and controls
107 lines (93 loc) · 3.71 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
plugins {
id 'java'
id 'java-test-fixtures'
id 'org.springframework.boot' version '3.+'
id 'io.spring.dependency-management' version '1.+'
id "io.github.kobylynskyi.graphql.codegen" version "5.+"
id "org.sonarqube" version "5.+"
id "jacoco"
}
group = 'de.unistuttgart.iste.meitrex'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '21'
def jacocoEnabled = System.properties.getProperty("jacocoEnabled") ?: "true"
// Apply JaCoCo settings only if jacaco is enable
if (jacocoEnabled.toBoolean()) {
project.logger.lifecycle('Applying jacoco settings from jacoco.gradle')
apply from: rootProject.file("jacoco.gradle")
}
sonarqube {
properties {
property("sonar.projectKey", "MEITREX_common")
property("sonar.organization", "meitrex")
property("sonar.host.url", "https://sonarcloud.io")
}
}
// Automatically generate DTOs from GraphQL schema:
graphqlCodegen {
// all config options:
// https://github.com/kobylynskyi/graphql-java-codegen/blob/main/docs/codegen-options.md
outputDir = new File("$buildDir/generated")
packageName = "de.unistuttgart.iste.meitrex.generated.dto"
generatedAnnotation = "jakarta.annotation.Generated"
modelValidationAnnotation = "jakarta.validation.constraints.NotNull"
generateJacksonTypeIdResolver = true // allows graphql .toEntity() conversion with Jackson for interfaces and unions
generateApis = false // set to false as the generator does not support spring boot graphQL
customTypesMapping = [
"DateTime" : "java.time.OffsetDateTime",
"Date" : "java.time.LocalDate",
"Time" : "java.time.OffsetTime",
"LocalTime": "java.time.LocalTime",
"UUID" : "java.util.UUID",
"Url" : "java.net.URL",
]
generateEqualsAndHashCode = true
generateToString = true
fieldsWithResolvers = ["@OnDemand"]
}
// Automatically generate GraphQL code on project build:
compileJava.dependsOn 'graphqlCodegen'
// Add generated sources to your project source sets:
sourceSets.main.java.srcDir "$buildDir/generated"
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:3.4.5'
implementation 'org.springframework.boot:spring-boot-starter-web:3.4.5'
implementation 'org.springframework.boot:spring-boot-starter-graphql:3.4.5'
implementation 'com.graphql-java:graphql-java-extended-validation:22.0'
implementation 'jakarta.validation:jakarta.validation-api:3.1.1'
implementation 'io.dapr:dapr-sdk:1.14.1' // Dapr's core SDK with all features, except Actors.
implementation 'io.dapr:dapr-sdk-springboot:1.14.1' // Dapr's SDK integration with SpringBoot
implementation 'org.modelmapper:modelmapper:3.2.3'
implementation "io.github.kobylynskyi:graphql-java-codegen:5.10.0"
implementation 'org.jetbrains:annotations:26.0.1'
implementation 'org.ahocorasick:ahocorasick:0.6.3'
implementation "com.fasterxml.jackson.module:jackson-module-jsonSchema:2.20.0"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0" // Support for Java 8 Date & Time API types in Jackson
compileOnly 'org.projectlombok:lombok:1.18.38'
developmentOnly 'org.springframework.boot:spring-boot-devtools:3.4.5'
runtimeOnly 'org.postgresql:postgresql:42.7.5'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:3.4.5'
annotationProcessor 'org.projectlombok:lombok:1.18.38'
testImplementation 'org.springframework.boot:spring-boot-starter-test:3.4.5'
testImplementation "org.mockito:mockito-core:5.17.0"
testImplementation 'org.hamcrest:hamcrest:2.2'
}
tasks.named('test') {
useJUnitPlatform()
}
// Disable bootJar since this is a library, not an executable app
bootJar {
enabled = false
}
// Enable normal jar
jar {
enabled = true
}