-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
71 lines (59 loc) · 2.17 KB
/
build.gradle.kts
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
import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateSDLTask
import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateTestClientTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.4.0"
kotlin("jvm") version "2.1.0"
kotlin("plugin.spring") version "2.1.0"
// graphql plugins
id("com.expediagroup.graphql") version "8.2.1"
// code quality plugins
id("io.gitlab.arturbosch.detekt") version "1.23.7"
jacoco
}
group = "com.example"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
dependencies {
implementation("com.expediagroup:graphql-kotlin-spring-server:8.2.1")
implementation("org.jetbrains.kotlin:kotlin-reflect")
testImplementation("com.expediagroup:graphql-kotlin-spring-client:8.2.1")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.1")
testImplementation("org.springframework.boot:spring-boot-starter-test:3.3.6")
graphqlSDL("com.expediagroup:graphql-kotlin-federated-hooks-provider:8.2.1")
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
withType<Test> {
dependsOn("graphqlGenerateTestClient") // test client is required for running tests
useJUnitPlatform()
}
named("build").configure {
dependsOn("graphqlGenerateSDL") // generate SDL file as part of the build lifecycle
}
named("jar") {
enabled = false
}
test {
finalizedBy("jacocoTestReport") // report is always generated after tests run
}
jacocoTestReport {
dependsOn("test") // tests are required to run before generating the report
}
}
val graphqlGenerateSDL by tasks.getting(GraphQLGenerateSDLTask::class) {
packages.set(listOf("com.example.template"))
}
val graphqlGenerateTestClient by tasks.getting(GraphQLGenerateTestClientTask::class) {
packageName.set("com.example.template.generated")
schemaFile.set(graphqlGenerateSDL.schemaFile)
}