forked from vymalo/keycloak-webhook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
100 lines (77 loc) · 2.56 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
kotlin("jvm") version "1.9.0"
id("org.openapi.generator") version "6.5.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("groovy")
}
group = "com.vymalo.keycloak.webhook"
version = "0.5.0"
val gsonVersion = "2.10.1"
val amqpVersion = "5.20.0"
val okhttp3Version = "4.12.0"
val okioVersion = "3.6.0"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
api("org.apache.commons", "commons-lang3", "3.14.0")
implementation(kotlin("stdlib"))
implementation("org.keycloak", "keycloak-services", "23.0.6")
implementation("org.keycloak", "keycloak-server-spi", "23.0.6")
implementation("org.keycloak", "keycloak-server-spi-private", "23.0.6")
api("com.squareup.okhttp3", "okhttp", okhttp3Version)
api("com.rabbitmq", "amqp-client", amqpVersion)
api("com.google.code.gson", "gson", gsonVersion)
api("org.slf4j", "slf4j-log4j12", "2.0.12")
api("com.squareup.okio", "okio-jvm", okioVersion)
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}
val generatedSourcesDir = "$buildDir/generated/openapi"
val openapiPackageName = "com.vymalo.keycloak.openapi.client"
openApiGenerate {
generatorName.set("kotlin")
inputSpec.set("$rootDir/openapi/webhook.open-api.yml")
outputDir.set(generatedSourcesDir)
packageName.set(openapiPackageName)
apiPackage.set("$openapiPackageName.handler")
invokerPackage.set("$openapiPackageName.invoker")
modelPackage.set("$openapiPackageName.model")
httpUserAgent.set("Keycloak/Kotlin")
configOptions.set(
mutableMapOf(
"dateLibrary" to "java8",
"serializationLibrary" to "gson"
)
)
}
sourceSets {
getByName("main") {
kotlin {
srcDir("$generatedSourcesDir/src/main/kotlin")
}
}
}
tasks {
val openApiGenerate by getting
val compileKotlin by getting {
dependsOn(openApiGenerate)
}
val shadowJar by existing(ShadowJar::class) {
dependencies {
include(dependency("com.squareup.okhttp3:okhttp:$okhttp3Version"))
include(dependency("com.squareup.okio:okio-jvm:$okioVersion"))
include(dependency("org.jetbrains.kotlin:kotlin-stdlib:1.9.0"))
include(dependency("org.jetbrains.kotlin:kotlin-reflect:1.9.0"))
include(dependency("com.rabbitmq:amqp-client:$amqpVersion"))
include(dependency("com.google.code.gson:gson:$gsonVersion"))
}
dependsOn(build)
}
}