Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime dependencies not included in --package option #425

Open
Dogacel opened this issue Oct 16, 2024 · 0 comments
Open

Runtime dependencies not included in --package option #425

Dogacel opened this issue Oct 16, 2024 · 0 comments

Comments

@Dogacel
Copy link

Dogacel commented Oct 16, 2024

|tasks.jar {
| manifest {
| attributes["Main-Class"] = "$capsuleApp"
| }
| archiveBaseName.set("$baseName")
| configurations["compileClasspath"].forEach { file: File ->
| from(zipTree(file.absoluteFile))
| }
| duplicatesStrategy = DuplicatesStrategy.INCLUDE
|}

Here I see that we don't use runtimeClasspath and in some scenarios, we need to.

I guess something like so,

from({
    configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }
})

For example,

@file:DependsOn("com.linecorp.armeria:armeria:1.30.1")

import com.linecorp.armeria.client.WebClient

val wc = WebClient.of("https://ssl-checker.io/api/v1/check/")

wc
    .get("/example.com")
    .aggregate()
    .thenAccept { response ->
        println(response.contentUtf8())
    }.join()

Try this script, it works when run using kscript, however it doesn't work when compiled with --package option.

You need to add @file:DependsOn("io.netty:netty-handler-proxy:4.1.112.Final") to make it compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant