How can I specify an alternate name for the output...
# gradle
d
How can I specify an alternate name for the output artfact (e.g.
someModule-jvm.jar
) in my Kotlin Multiplatform project? Asking because I restructured my project to have submodules for Clean architecture layers, so now I have multiple JARs named e.g.
domain-
,
presentation-
,
service-
b
Either tweak names in jar task or rename modules in settings.kts via project(":path").name = "xxx"
👍 1
d
Thanks, I ended up defining a small function within
settings.gradle.kts
to help with this:
Copy code
fun includeAliased(path: String, aliasName: String) {
    include(path)
    project(path).name = aliasName
}
Bless Kotlin DSL 😁, keeps the rest tidy
p
I prefer the solution with customizing
jvmJar
task because the other solution influences how one can refer to the module from another modules. I went with: https://kotlinlang.slack.com/archives/C3PQML5NU/p1669629784679459?thread_ts=1669626349.157219&cid=C3PQML5NU