Ion Carrera
05/17/2023, 2:25 PMplugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.library").version("8.0.1").apply(false)
kotlin("multiplatform").version("1.8.10").apply(false)
id("maven-publish")
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
publishing {
publications {
create<MavenPublication>("release") {
groupId = "com.ion.testkmm"
artifactId = "testkmmion"
version = "1.0"
}
}
}
Landry Norris
05/17/2023, 2:28 PMCasey Brooks
05/17/2023, 2:29 PMmaven-publish
needs to be applied to each submodule individually, not in the root projectLandry Norris
05/17/2023, 2:31 PMandroid {
publishLibraryVariants("debug", "release")
}
You'll need this when you set up the android target. I think there's a new gradle 8.0+ way, but this is what I've used.Ion Carrera
05/17/2023, 2:36 PMandroid {
namespace = "com.ion.testkmm"
compileSdk = 33
defaultConfig {
minSdk = 24
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
publishing {
singleVariant("release")
}
}
publishing {
publications {
create<MavenPublication>("release") {
groupId = "com.ion.testkmm"
artifactId = "testkmmion" //this is the "shared", that has been renamed
version = "1.0"
}
}
}
kotlin {
android {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
publishLibraryVariants("release")
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "testkmmion"
}
}
sourceSets {
...