Skip to content

[Feature request] kmp support #26

Open

Description

@umesh0492
No description provided.

Activity

  1. 0xera commented on Feb 20, 2025

    @0xera
    Collaborator

    This seems to be supported already. Could you please share your thoughts or tell what the problem is here?

  2. umesh0492 commented on Feb 21, 2025

    @umesh0492
    Author

    Please share the sample code snippet @0xera . As I am getting the error of
    `A problem occurred configuring project ':moduleA'.

    Failed to notify project evaluation listener.
    Cannot query the value of property 'component' because it has no value available.
    Cannot query the value of property 'component' because it has no value available.
    `

  3. umesh0492 commented on Feb 21, 2025

    @umesh0492
    Author

    Just added in pluggin -> id("io.deepmedia.tools.grease") version ("0.3.4")
    Using -> com.vanniktech.maven.publish

    Kotlin 2.1.10
    gradle -> 8.11
    JVM 17

  4. umesh0492 commented on Feb 21, 2025

    @umesh0492
    Author
    plugins {
        alias(libs.plugins.kotlinMultiplatform)
        alias(libs.plugins.androidLibrary)
        alias(libs.plugins.kotlinxSerialization)
        alias(libs.plugins.dokka)
        alias(internal.plugins.maven.publish)
        alias(internal.plugins.binary.validator)
        id("io.deepmedia.tools.grease") version ("0.3.4")
    }
    
    version = "0.0.1"
    
    kotlin {
        // https://kotlinlang.org/docs/multiplatform-expect-actual.html#expected-and-actual-classes
        // To suppress this warning about usage of expected and actual classes
        @OptIn(ExperimentalKotlinGradlePluginApi::class)
        compilerOptions {
            freeCompilerArgs.add("-Xexpect-actual-classes")
        }
    
        androidTarget {
            publishLibraryVariants("release")
        }
        sourceSets {
    
            commonMain {
                dependencies {
                    api(someLib)
                }
            }
    
            androidMain {
               dependencies {
                    implementation(someLib)
              }
          }
      }
    }
    
    android {
        compileSdk = (findProperty("android.compileSdk") as String).toInt()
        namespace = "com.moduleA"
        sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    
        defaultConfig {
            minSdk = (findProperty("android.minSdk") as String).toInt()
        }
    
        buildFeatures {
            viewBinding = true
            buildConfig = true
        }
        compileOptions {
            sourceCompatibility = JavaVersion.VERSION_17
            targetCompatibility = JavaVersion.VERSION_17
        }
    }
    
    
    mavenPublishing {
        // Define coordinates for the published artifact
        configure(
            KotlinMultiplatform(
                javadocJar = JavadocJar.Dokka("dokkaGenerateModuleHtml"),
                sourcesJar = true,
            )
        )
        coordinates(
            artifactId = "moduleA",
        )
    }
    
  5. umesh0492 commented on Feb 24, 2025

    @umesh0492
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions