OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.57k stars 6.52k forks source link

[REQ] Missing androidTarget in Kotlin Multiplatform #19833

Open blackwiz4rd opened 2 days ago

blackwiz4rd commented 2 days ago

Is your feature request related to a problem? Please describe.

The androidTarget() is missing in the generation of kotlin multiplatform code, as well as proguard rules.

Describe the solution you'd like

Changes requested:

build.gradle.kts

plugins {
    id("com.android.library")
}

kotlin {
 ...
 androidTarget()
 ...
}

android {
    namespace = "${moduleName}"

    buildTypes {
        getByName("release") {
            isMinifyEnabled = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
.... (defaultConfig, compileOptions)

    kotlin {
        jvmToolchain(LATEST_JAVA_VERSION)
    }
}

proguard-rules.pro:

-dontwarn java.lang.invoke.StringConcatFactory

Describe alternatives you've considered

Manually add to gradle config.

wing328 commented 2 days ago

can you please file a PR with the suggested change? thanks