-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ksp flag to kotlin generator to generate only KSP compatible clas…
…ses. Fixed test swagger files
- Loading branch information
Showing
21 changed files
with
184 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...c/main/groovy/io.micronaut.build.internal.openapi-kotlin-kapt-generator-test-suite.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import io.micronaut.build.internal.openapi.OpenApiGeneratorTask | ||
|
||
plugins { | ||
id 'io.micronaut.minimal.application' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
configurations { | ||
openapiGenerator { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
} | ||
} | ||
|
||
dependencies { | ||
openapiGenerator(project(":test-suite-generator-util")) | ||
} | ||
|
||
def openapiGenerate = tasks.register("generateOpenApi", OpenApiGeneratorTask) { | ||
lang = "kotlin" | ||
generatedAnnotation = true | ||
ksp = false | ||
classpath.from(configurations.openapiGenerator) | ||
openApiDefinition.convention(layout.projectDirectory.file("petstore.json")) | ||
outputDirectory.convention(layout.buildDirectory.dir("generated/openapi")) | ||
generatorKind.convention("client") | ||
outputKinds.convention(["models", "apis", "apiDocs", "modelDocs", "supportingFiles", "modelTests", "apiTests"]) | ||
parameterMappings.convention([]) | ||
responseBodyMappings.convention([]) | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java.srcDir(openapiGenerate.map(OpenApiGeneratorTask::getGeneratedSourcesDirectory)) | ||
} | ||
test { | ||
java.srcDir(openapiGenerate.map(OpenApiGeneratorTask::getGeneratedTestSourcesDirectory)) | ||
} | ||
} | ||
|
||
micronaut { | ||
version = libs.versions.micronaut.platform.get() | ||
runtime("netty") | ||
testRuntime("junit5") | ||
} | ||
|
||
dependencies { | ||
constraints { | ||
implementation("io.micronaut:micronaut-http-client:${libs.versions.micronaut.asProvider().get()}") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...tor/src/main/resources/templates/kotlin-micronaut/common/model/field_annotations.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.