-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
40 lines (33 loc) · 983 Bytes
/
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
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
plugins {
kotlin("jvm") version "1.9.21"
id("org.openapi.generator") version "7.2.0"
}
group = "events.boudicca.samples"
version = "0.1-SNAPSHOT"
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(21)
}
val openapiSpec: Configuration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
}
dependencies {
openapiSpec("events.boudicca:search-api:0.5.0:openapi@json")
}
tasks.register<GenerateTask>("generateTypescriptClient") {
inputs.files(openapiSpec)
inputSpec.set(provider { openapiSpec.files.firstOrNull()?.path })
outputDir.set(layout.buildDirectory.dir("generated/typescript").get().toString())
generatorName.set("typescript-axios")
configOptions.putAll(
mapOf(
"npmName" to "@boudicca/search-api-client",
"npmVersion" to "${project.version}",
"supportsES6" to "true",
)
)
}