Update JLine to 4.x (#1511)

- Remove dependency org.fusesource.jansi:jansi
- In 4.x, org.fusesource.jansi:jansi was replaced with org.jline:jansi.
Instead of adding this new dependency, this commit replaces Pkl’s single
Jansi usage with custom code that preserves existing behavior. Fixing
existing ANSI quirks is left for a future PR.
- Replace jline-terminal-ansi with jline-terminal-jni
  - In 4.x, only -jni and -ffm are available (-ffm requires Java 22+)
- Configure native-image build for jline-terminal-jni

As updating JLine is delicate, I manually tested `pkl repl` and `jpkl
repl` on Windows 11 (using Windows Terminal) and on Ubuntu, and found no
issues. However, I do not have access to a macOS machine.
This commit is contained in:
odenix
2026-04-08 16:25:39 -07:00
committed by GitHub
parent fdeb568343
commit 2cfd0a0d28
6 changed files with 28 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,10 +56,9 @@ dependencies {
api(projects.pklCommonsCli)
implementation(projects.pklCommons)
implementation(libs.jansi)
implementation(libs.jlineReader)
implementation(libs.jlineTerminal)
implementation(libs.jlineTerminalJansi)
implementation(libs.jlineTerminalJni)
implementation(projects.pklServer)
implementation(projects.pklFormatter)
implementation(libs.clikt)