-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
142 lines (125 loc) · 4.92 KB
/
build.gradle.kts
File metadata and controls
142 lines (125 loc) · 4.92 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
`java-library`
groovy
kotlin
alias(libs.plugins.versions)
alias(libs.plugins.sonar)
alias(libs.plugins.updates)
id("openapiprocessor.test")
id("openapiprocessor.testInt")
id("openapiprocessor.publish")
id("openapiprocessor.coverage")
id("openapiprocessor.newapi")
}
group = "io.openapiprocessor"
version = libs.versions.processor.get()
println("version: $version")
versions {
packageName = "io.openapiprocessor.spring"
entries.putAll(mapOf(
"version" to libs.versions.processor.get()
))
}
java {
withJavadocJar ()
withSourcesJar ()
}
kotlin {
jvmToolchain(libs.versions.build.jdk.get().toInt())
compilerOptions {
freeCompilerArgs.add("-Xannotation-default-target=param-property")
jvmTarget = JvmTarget.fromTarget(libs.versions.target.jdk.get())
}
}
tasks.compileTestGroovy {
classpath += sourceSets.main.get().compileClasspath
classpath += files(tasks.compileKotlin.get().destinationDirectory)
classpath += files(tasks.compileTestKotlin.get().destinationDirectory)
}
dependencies {
implementation (libs.openapi.processor.api)
implementation (libs.openapi.processor.core)
implementation (libs.openapi.processor.test.api)
implementation (libs.openapi.processor.parser.api)
implementation (libs.openapi.processor.parser.swagger)
implementation (libs.openapi.processor.parser.openapi4j)
implementation (libs.slf4j)
testImplementation (libs.openapi.processor.api)
testImplementation (libs.openapi.processor.core)
testImplementation (libs.openapi.processor.test.api)
testImplementation (libs.openapi.processor.test.base)
testImplementation (libs.openapi.processor.parser.api)
testImplementation (libs.openapi.processor.parser.swagger)
testImplementation (libs.openapi.processor.parser.openapi4j)
testImplementation (platform(libs.groovy.bom))
testImplementation ("org.apache.groovy:groovy")
testImplementation ("org.apache.groovy:groovy-nio")
testImplementation (libs.spock)
testImplementation (platform(libs.kotest.bom))
testImplementation (libs.kotest.runner)
testImplementation (libs.kotest.table)
testImplementation (libs.mockk)
testImplementation (libs.logback)
testImplementation (libs.jimfs)
testIntImplementation (libs.openapi.processor.api)
testIntImplementation (libs.openapi.processor.core)
testIntImplementation (libs.openapi.processor.test.api)
testIntImplementation (libs.openapi.processor.test.base)
testIntImplementation (libs.openapi.processor.parser.api)
testIntImplementation (libs.openapi.processor.parser.swagger)
testIntImplementation (libs.openapi.processor.parser.openapi4j)
testIntImplementation (platform(libs.groovy.bom))
testIntImplementation ("org.apache.groovy:groovy")
testIntImplementation ("org.apache.groovy:groovy-nio")
testIntImplementation (libs.spock)
testIntImplementation (platform(libs.kotest.bom))
testIntImplementation (libs.kotest.runner)
testIntImplementation (libs.kotest.table)
testIntImplementation (libs.mockk)
testIntImplementation (libs.logback)
testIntImplementation (libs.jimfs)
testIntImplementation (libs.spring.web)
testIntImplementation (libs.spring.data)
}
//tasks.named("dependencyUpdates").configure {
// rejectVersionIf {
// String v = it.candidate.version
// println "candidate: $v"
// return v.endsWith ("-M1") || v.contains ("alpha") || v.contains ("beta")
// }
//}
tasks.withType<Test>().configureEach {
jvmArgs(listOf(
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
))
finalizedBy(tasks.named("jacocoTestReport"))
}
jacoco {
toolVersion = libs.versions.jacoco.get()
}
tasks.jacocoTestReport {
executionData.from(tasks.named<Test>("test").map<File> {
it.extensions.getByType(JacocoTaskExtension::class.java).destinationFile as File
})
executionData.from(tasks.named<Test>("testInt").map<File> {
it.extensions.getByType(JacocoTaskExtension::class.java).destinationFile as File
})
reports {
xml.required = true
html.required = true
}
}
sonarqube {
properties {
property("sonar.projectKey", "openapi-processor_openapi-processor-spring")
property("sonar.organization", "openapi-processor")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.coverage.jacoco.xmlReportPaths", layout.buildDirectory.dir("reports/jacoco/test/jacocoTestReport.xml").get().toString())
}
}