Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OpenAPI codegen #552

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("com.android.library") apply false
id("org.jetbrains.kotlin.android") apply false
id ("org.openapi.generator") version "7.2.0"
}

group = "io.embrace"
Expand Down
28 changes: 28 additions & 0 deletions embrace-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,33 @@ dokkaHtml {
suppressObviousFunctions.set(true)
}

openApiGenerate {
// Set the OpenAPI specification file path
inputSpec = "envelope.yaml"

// Set the desired output directory for generated code
outputDir = "$buildDir/generated"

// Set the generator to use (e.g., java, kotlin, etc.)
generatorName = 'kotlin'

packageName = 'io.embrace.android.embracesdk.internal.generated'

globalProperties.set([
modelDocs: "false",
apis: "false",
models: ""
])

// see further options for configuring kotlin codegen here:
// https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/kotlin.md
additionalProperties = [
"enumPropertyNaming": "UPPERCASE",
"supportAndroidApiLevel25AndBelow": true,
"nonPublicApi": true, // mark classes as internal
"omitGradleWrapper": "true"
]
}

task publishLocal { dependsOn("publishMavenPublicationToMavenLocal") }
task publishQa { dependsOn("publishMavenPublicationToQaRepository") }
Loading