GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Runtime dependencies not included in `--package` option · Issue #425 · kscripting/kscript

Runtime dependencies not included in --package option #425

New issue
Copy link
New issue
Copy link
Open
Open
Runtime dependencies not included in --package option#425
Copy link

Description

@Dogacel
Dogacel
opened on Oct 16, 2024
Issue body actions

kscript/src/main/kotlin/io/github/kscripting/kscript/code/GradleTemplates.kt

Lines 69 to 78 in 6acd4e1

|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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.