Adam Cooper
05/17/2025, 8:08 PMapplication { mainClass.set("sh.adamcooper.MainKt") }
tasks.named<Copy>("javaProcessResources") {
val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
from(jsBrowserDistribution)
}
tasks.named<Jar>("javaJar") {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest { attributes["Main-Class"] = application.mainClass }
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
with(tasks.jar.get() as CopySpec)
}
tasks.named<JavaExec>("run") {
dependsOn(tasks.named<Jar>("javaJar"))
classpath(tasks.named<Jar>("javaJar"))
}
Is there a supported/canonical way to accomplish this now?ephemient
05/17/2025, 11:34 PMephemient
05/17/2025, 11:38 PMkotlin {
sourceSets {
jvmMain {
resources.srcDir(tasks.named("jsBrowserDistribution"))
Adam Cooper
05/17/2025, 11:50 PMtapchicoma
05/19/2025, 8:24 AMAdam Cooper
05/21/2025, 4:14 PMresources.setSrcDirs(listOf("src/jvm/main/resources", tasks.named("jsBrowserDistribution")))
The path is correct; I organize my repo a little differently. Previously, that path was the only resource dir I set and it worked fine