Publishing¶
Publishing to Maven doesn't require anything special.
The only exception is with the JVM - you need to publish separate packages with platform natives.
To do this, you need to add a Jar task to your publications.
build.gradle.kts
publishing {
publications.getByName<MavenPublication>("jvm") {
artifact(natives.jvmNativesJarTask)
}
}
After this, you can use these natives as follows:
build.gradle.kts
kotlin {
// ...
sourceSets {
commonMain.dependencies {
implementation("${groupId}:${name}:${version}")
}
jvmMain.dependencies {
implementation("${groupId}:${name}-jvm:${version}:windows-x64")
}
}
}
Available platforms:
OS:
windowsmacoslinux
Arch:
x64x86arm64riscvuniversal(if universal .dylib is enabled for macOS)