From 3c61449d4b0b9ea6215ba7aa3eeacba6716adcaf Mon Sep 17 00:00:00 2001 From: abl Date: Thu, 1 Feb 2024 22:58:17 +0100 Subject: [PATCH] delete all generated files before generation --- .../main/kotlin/boudicca-openapi-generate-client.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildSrc/src/main/kotlin/boudicca-openapi-generate-client.gradle.kts b/buildSrc/src/main/kotlin/boudicca-openapi-generate-client.gradle.kts index cdb01073..a796aca5 100644 --- a/buildSrc/src/main/kotlin/boudicca-openapi-generate-client.gradle.kts +++ b/buildSrc/src/main/kotlin/boudicca-openapi-generate-client.gradle.kts @@ -29,6 +29,9 @@ dependencies { val openApiPackageName = project.name.substring(0, project.name.lastIndexOf("-")) tasks.register("generateJavaClient") { + doFirst { + delete(layout.buildDirectory.dir("generated/java").get()) + } inputs.files(openapi) inputSpec.set(getInputSpecProvider()) outputDir.set(layout.buildDirectory.dir("generated/java").get().toString()) @@ -43,6 +46,9 @@ tasks.register("generateJavaClient") { } tasks.register("generateTypescriptClient") { + doFirst { + delete(layout.buildDirectory.dir("generated/typescript").get()) + } inputs.files(openapi) inputSpec.set(getInputSpecProvider()) outputDir.set(layout.buildDirectory.dir("generated/typescript").get().toString())