Jeff
01/08/2024, 4:07 PMAnton Prokhorov
01/09/2024, 2:09 PMproduct:
type: lib
platforms: [...]
You already have gradle tasks for publication
You will probably want to set up repositories, credentials, you could do it using gradle interop:
Just create build.gradle.kts
alongside with module.yaml
and you could write anything you want, so to define repositories, you could do something like this
publishing {
repositories {
maven {
// change to point to your repo, e.g. <http://my.org/repo> and setup credentials if you want
url = uri(layout.buildDirectory.dir("repo"))
}
}
}
The only issue left, is android publication, because it requires to enable publication of variants you want to publish separately, and since, Amper creates androidTarget
for you, you don't need to create this target once again, but to configure existing one:
something like this:
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
kotlin {
targets
.filterIsInstance<KotlinAndroidTarget>()
.forEach { it.publishLibraryVariants("release") }
}
Hope it helps, if you have follow up questions, don't hesitate to ask!