Hello ! I have a question regarding <advanced proj...
# multiplatform
n
Hello ! I have a question regarding advanced project structure. I need different variants of my multiplatform shared library : privateVariant and publicVariant. Here is my custom configuration (module “shared”) :
Copy code
kotlin {
    withSourcesJar(publish = false)

    androidTarget()

    sourceSets {
        val commonMain by getting {
        }
        val commonPrivateVariant by creating {
            dependsOn(commonMain)
        }
        val androidPrivateVariant by creating {
            dependsOn(commonPrivateVariant)
        }
        val androidMain by getting {
            dependsOn(commonMain)
        }
    }
}

android {
    flavorDimensions += "sdk"
    productFlavors {
        create("privateVariant") {
            dimension = "sdk"
        }
    }
}
And my app gradle file which uses my private variant :
Copy code
android {
    defaultConfig {
        missingDimensionStrategy("sdk", "privateVariant")
    }
}

dependencies {
    implementation(project(":shared"))
}
Problem is : I cannot access classes in
commonPrivateVariant
from
androidPrivateVariant
. Could it be possible ?