Open s101d1 opened 4 years ago
Ideally, we would also need a 2nd parameter (say outputDirPreserveFiles
) to provide a list of files to not delete (e.g. Jenkinsfile
)
Looks like a good option for any plugin.
just use:
tasks.register("openApiClean", Delete::class) {
delete("${projectDir.path}/src/main/kotlin/org/example/models/dto")
delete("${projectDir.path}/src/main/kotlin/org/example/api")
}
openApiGenerate {
dependsOn("openApiClean")
...
}
For openapi-generator-gradle-plugin, could you add option to automatically delete all files and folders in outputDir before generating the code files?
The option can be called "cleanOputputDir" (boolean) or such.