ribesg
03/15/2022, 10:28 AMmbonnin
03/15/2022, 10:31 AM*.main.kts
and @file:DependsOn
. Kscript is still useful to package your scripts if you want to distribute themribesg
03/15/2022, 10:49 AMVampire
03/15/2022, 10:51 AM@file:Repository
Vampire
03/15/2022, 10:52 AMribesg
03/15/2022, 10:54 AMVampire
03/15/2022, 10:55 AMribesg
03/15/2022, 10:56 AMVampire
03/15/2022, 10:56 AMribesg
03/15/2022, 10:56 AMribesg
03/15/2022, 11:11 AMribesg
03/15/2022, 11:11 AMVampire
03/15/2022, 11:18 AMVampire
03/15/2022, 11:23 AMribesg
03/15/2022, 11:36 AM~/.m2/settings.xml
as usual, but if you want to do the bad thing of putting them right there in the script like me, you can use the options
parameter of the annotation, as described here: https://youtrack.jetbrains.com/issue/KT-27701#focus=Comments-27-5323682.0-0 (you can use options
once for Repository
annotation, don’t need to use it on each dependency if you have multiple)
I recommend reading this entire issue comments thread, it’s interesting.Vampire
03/15/2022, 11:37 AMVampire
03/15/2022, 11:37 AMRepostory
classribesg
03/15/2022, 11:39 AM.kts
file and I just need to have kotlin
installed on my machine for it to run, nicembonnin
03/15/2022, 1:27 PMmissing direct multiplatform dependency supportI filed this issue some time ago. Doesn't look like it's coming any time soon. But adding
-jvm
usually works so at least there's an easy workaroundephemient
03/18/2022, 4:42 PMephemient
03/18/2022, 4:44 PMpublishing {
publications {
val jvm = getByName<MavenPublication>("jvm")
getByName<MavenPublication>("kotlinMultiplatform") {
pom.withXml {
val root = asNode()
val dependencies = ((root["dependencies"] as NodeList).firstOrNull() as Node?)?.apply {
for (child in children().toList()) remove(child as Node)
} ?: root.appendNode("dependencies")
dependencies.appendNode("dependency").apply {
appendNode("groupId", jvm.groupId)
appendNode("artifactId", jvm.artifactId)
appendNode("version", jvm.version)
appendNode("scope", "compile")
}
}
}
}
}
in its build.gradle.kts
mbonnin
03/19/2022, 6:58 PM