-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
106 lines (89 loc) · 2.71 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
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
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
plugins {
kotlin("jvm")
`java-gradle-plugin`
idea
id("io.gitlab.arturbosch.detekt") version "1.23.7"
id("com.gradle.plugin-publish") version "1.3.0"
signing
}
group = "ch.acanda.gradle"
version = "1.7.0-SNAPSHOT"
val generatedSources: Provider<Directory> = project.layout.buildDirectory.dir("generated/src/main/kotlin")
gradlePlugin {
website = "https://github.com/acanda/fabrikt-gradle-plugin"
vcsUrl = "https://github.com/acanda/fabrikt-gradle-plugin.git"
plugins {
create("fabriktPlugin") {
id = "$group.fabrikt"
implementationClass = "$group.fabrikt.FabriktPlugin"
displayName = "Fabrikt Gradle Plugin"
description = "The Fabrikt Gradle Plugin integrates Fabrikt into your Gradle builds. Fabrikt generates" +
" Kotlin data classes with support for advanced features, Spring or Micronaut controllers, and" +
" OkHttp or OpenFeign clients."
tags = listOf("openapi", "openapi-3.0", "codegen", "kotlin", "fabrikt")
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.cjbooms:fabrikt:17.4.0")
testImplementation(kotlin("test"))
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.7")
}
kotlin {
jvmToolchain(21)
}
sourceSets {
main {
kotlin {
srcDir(generatedSources)
}
}
}
idea {
module {
generatedSourceDirs.add(generatedSources.get().asFile)
}
}
detekt {
buildUponDefaultConfig = true
config.setFrom("$projectDir/config/detekt.yaml")
}
testing {
suites {
@Suppress("unused")
val test by getting(JvmTestSuite::class) {
useJUnitJupiter("5.10.0")
dependencies {
val kotestVersion = "5.9.1"
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
implementation("io.kotest:kotest-property:$kotestVersion")
runtimeOnly("org.junit.platform:junit-platform-launcher:1.11.3")
}
}
}
}
signing {
useGpgCmd()
}
tasks {
wrapper {
gradleVersion = "8.11"
}
withType<Detekt>().configureEach {
val compilation =
project.extensions.getByType<KotlinJvmProjectExtension>().target.compilations.getByName("test")
classpath.setFrom(compilation.output.classesDirs, compilation.compileDependencyFiles)
reports {
xml.required.set(false)
html.required.set(false)
txt.required.set(false)
sarif.required.set(false)
md.required.set(true)
}
}
}