Skip to content

Commit

Permalink
Clean the openapi-code-generation target
Browse files Browse the repository at this point in the history
The `GenerateTask` doesn't clean the output before it runs. This change deletes the output directory before the generation actually starts.
  • Loading branch information
snazy committed Aug 22, 2024
1 parent dc98fba commit e764505
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions polaris-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ tasks.register<GenerateTask>("generatePolarisService").configure {
additionalProperties.put("apiNameSuffix", "Api")
additionalProperties.put("metricsPrefix", "polaris")
serverVariables = mapOf("basePath" to "api/v1")

doFirst {
delete(outputDir.get())
}
}

tasks.named("compileJava").configure { dependsOn("generatePolarisService") }
Expand Down
4 changes: 4 additions & 0 deletions polaris-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ tasks.register<GenerateTask>("generatePolarisService").configure {
additionalProperties.put("apiNameSuffix", "Api")
additionalProperties.put("metricsPrefix", "polaris")
serverVariables.put("basePath", "api/v1")

doFirst {
delete(outputDir.get())
}
}

tasks.named("compileJava").configure { dependsOn("openApiGenerate", "generatePolarisService") }
Expand Down

0 comments on commit e764505

Please sign in to comment.