Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 48 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
name: Release

# Push a tag v<version> matching plugin.json to publish a GitHub Release with
# one unsigned plugin archive per macOS architecture and its SHA-256 file.
#
# No step receives a signing key. Checkouts do not keep the workflow token.
#
# Releases stay pre-releases, which Lithe Store's tracker skips, for these
# reasons:
# 1. Lithe still bundles Java Support under the old ID
# dev.lithe.plugin.java-support.
# 2. The package declares the Rust backend (backend 2), plugin-owned
# language server sessions (languageServers 3, requestMethods and
# commands) and plugin functions (pluginFunctions 1), and the backend
# links the Rust plugin SDK 0.3.0 (plugin function protocol 4). A host
# that predates the Lithe changes #1745 and #1746 does not offer them and
# rejects the package. Only the latest Lithe preview contains them so far;
# no stable Lithe does. The SDK also requires the host to offer
# litheLogging 1 and refuses to start without it.
# 3. The Maven and Gradle project templates have moved to lithe-plugin-maven
# and lithe-plugin-gradle. Until those plugins carry them, a release
# would drop the Maven and Gradle choices from New Project.
# Remove --prerelease below once a stable Lithe accepts the package (stage E in
# MIGRATION.md), stops bundling Java Support, and offers backend 2,
# languageServers 3, pluginFunctions 1 and litheLogging 1, and once the Maven
# and Gradle plugins are published. The Store then lists stable releases of
# this repository automatically.
# Tags must match plugin.json. Build unsigned macOS arm64/x64 and Windows
# x64 packages from the same source revision, then upload a draft prerelease.
# The maintainer verifies the downloaded assets before publishing the draft.
# Contract 0 currently requires the matching Viva preview, not stable Lithe.
on:
push:
tags: ["v*"]
Expand Down Expand Up @@ -57,9 +36,32 @@ jobs:
- name: Check the pinned plugin SDK release
run: scripts/verify-sdk-lock.sh --download

windows:
name: Build Windows x64 backend
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
- name: Test the native Windows backend
run: cargo test --workspace --locked --target x86_64-pc-windows-msvc
- name: Build the native Windows backend
run: cargo build --release --locked -p lithe-java-backend --target x86_64-pc-windows-msvc
- uses: actions/upload-artifact@v4
with:
name: windows-backend
path: target/x86_64-pc-windows-msvc/release/lithe-java-backend.exe
if-no-files-found: error
retention-days: 7

release:
name: Publish ${{ github.ref_name }}
needs: test
needs: [test, windows]
runs-on: macos-26
timeout-minutes: 60
permissions:
Expand All @@ -73,6 +75,13 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin, x86_64-apple-darwin
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/download-artifact@v4
with:
name: windows-backend
path: .artifacts/windows-backend
- name: Check the tag matches plugin.json
run: |
set -euo pipefail
Expand All @@ -87,6 +96,12 @@ jobs:
for arch in arm64 x86_64; do
scripts/build-package.sh --arch "$arch"
done
- name: Assemble the Windows archive
run: |
set -euo pipefail
archive=$(node scripts/package/build-windows.mjs .artifacts/windows-backend/lithe-java-backend.exe)
mkdir -p dist
cp "$archive" "$archive.sha256" dist/
- name: Archive and publish
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -98,17 +113,16 @@ jobs:
scripts/archive-package.sh --package ".artifacts/package/$arch/io.github.lithe-idea.java-support" \
--arch "$arch" >> "$checksums"
done
notes="docs/releases/$GITHUB_REF_NAME.md"
test -s "$notes"
cp "$notes" "$RUNNER_TEMP/notes.md"
{
echo "Java Support(\`io.github.lithe-idea.java-support\`)${GITHUB_REF_NAME#v}。每个 macOS 架构一个归档,附 SHA-256 文件。"
echo
echo "兼容性:目前的 Lithe 仍内置 Java Support;这个包还需要宿主提供 \`backend\` 2、\`languageServers\` 3、\`pluginFunctions\` 1 和 \`litheLogging\` 1(含 #1745、#1746 的 Lithe 预览版之后),不满足的版本会拒绝安装;稳定版要等 Lithe 主仓库完成 Java 拆分的阶段 E。Maven 与 Gradle 的新建项目模板已移交 lithe-plugin-maven 和 lithe-plugin-gradle,这两个插件接手前,这个包的新建项目里没有 Maven 和 Gradle 选项。"
echo
echo "安装:预发布版本,Lithe Store 自动追踪会跳过。宿主支持后下载对应架构的 ZIP,在 设置 → 插件 的 ⚙ 菜单中选择 从磁盘安装插件…。"
echo
echo "SHA-256:"
echo '### SHA-256'
echo '```'
sed 's# dist/# #' "$checksums"
cat dist/*windows-x64.zip.sha256
echo '```'
} > "$RUNNER_TEMP/notes.md"
gh release create "$GITHUB_REF_NAME" dist/*.zip dist/*.zip.sha256 --verify-tag --prerelease \
} >> "$RUNNER_TEMP/notes.md"
gh release create "$GITHUB_REF_NAME" dist/*.zip dist/*.zip.sha256 --verify-tag --draft --prerelease \
--title "Java Support $GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/notes.md"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Java Support for Lithe

> **Viva 最小 Maven 工作流(本地验证,尚未发布)**:清单已迁到当前契约 0,后端使用 Core
> **Viva 预览版 Java 支持(1.1.0)**:清单已迁到当前契约 0,后端使用 Core
> `65cf82343c5e315aae2e335b2e8f0217b703e89a` 中的 Rust SDK 0.4.0(尚无对应发布标签)。
> 本轮验证含第三方 JAR 依赖的普通 Maven 工程:JDT 补全、Maven 编译、main 运行和断点调试,包含变量读取、继续和退出。
> 需要同时包含 Lithe 客户端的动作注册解码、动作刷新与首次调试加载修复;未修改这些行为的旧 preview 不能直接使用本包。
Expand All @@ -24,7 +24,7 @@
> SDK. Maven and Gradle import settings come from the Maven and Gradle plugins through a function interface that
> Lithe Core relays between plugins.

当前源码面向配套 Viva preview,尚未发布。API / 能力与传输版本以 `plugin.json`、`sdk.lock.json`
1.1.0 面向包含主仓库 [#1884](https://github.com/1lck/Lithe-IDEA/pull/1884) 的配套 Viva preview(客户端修订 `607f00967d70a7017d49805183d0d2e6ffdf1c0d` 或更新版本)。API / 能力与传输版本以 `plugin.json`、`sdk.lock.json`
和固定 Core 中的[插件资料](https://github.com/Lithe-IDEA/Lithe-core-rust/tree/65cf82343c5e315aae2e335b2e8f0217b703e89a/shared/plugins)为准。
`MIGRATION.md` 保留迁移历史,不能用其中旧宿主、旧 API 数字推断当前兼容性。

Expand Down Expand Up @@ -187,7 +187,7 @@ Spring/MyBatis 等既有能力不属于本轮 Maven 验收范围。
后端把日志交给宿主的统一日志 `litheLogging` 0,不写 stderr。函数 ID 都是编译期常量,注册只会因 ID 写错、重复或超出 SDK
上限而失败,单元测试 `the_backend_builds_with_every_command_registered` 在 CI 里挡住这种构建;万一发生,进程在握手前以状态 1 退出,
由宿主记录启动失败(`backend/src/main.rs`)。当前固定的 Rust SDK 0.4.0 要求宿主提供 `litheLogging` 0,
不提供的 Lithe 版本会拒绝启动后端;本次只验证上述配套 Viva 检出,尚未发布。
不提供的 Lithe 版本会拒绝启动后端;本次验证范围以本文列出的配套 Viva 检出为准。

| 事实 | 级别 | 来源 | 内容 |
| --- | --- | --- | --- |
Expand Down Expand Up @@ -260,7 +260,7 @@ scripts/archive-package.sh --package <上一步打印的目录> --arch arm64 #

`plugin.json` 的完整格式只在固定 Core 的 `shared/plugins/contract/v1/`,不在本仓库维护副本。

### Windows 开发包
### Windows 包

在 Windows 从同一源码以 `--locked` 编译 x64 后端后,可在 macOS 组装用于原生验证的包:

Expand All @@ -269,12 +269,12 @@ node scripts/package/build-windows.mjs /path/to/lithe-java-backend.exe
```

脚本验证 x64 PE 与锁定 JDK 的 SHA-256,复用 JDT 构建入口,写入 `.artifacts/` 并清理组装临时目录。
这是开发验证入口,不是 Windows 正式签名、安装器或发布工作流,也不能代替 Windows 运行验收。
发布工作流在 Windows 从同一标签构建并测试 x64 后端,再通过此入口组装 ZIP;本地验证复用相同入口。包不带发布者签名,不含安装器,打包成功也不能代替 Windows 运行验收。

## 发布新版本

构建和发布由现有工作流执行,正式发布前按 Lithe 的版本规则决定版本并核验兼容宿主。
当前依赖 Viva preview,只能作为预发布;Windows 开发包尚未接入发布工作流。
当前依赖 Viva preview,只能作为预发布。推送匹配版本的标签后,工作流为 macOS arm64/x64 与 Windows x64 生成 ZIP 和 SHA-256,并创建草稿预发布;维护者下载核对后再公开草稿。发布说明必须位于 `docs/releases/v<版本>.md`,缺失则终止发布。
不得覆盖已发布 ZIP,也不得将本地隔离试验的 JDT/JDK 资源当作生产升级:本轮生产仍固定 JDT LS 1.61 和 Temurin 21。

## 许可
Expand Down
51 changes: 51 additions & 0 deletions docs/releases/v1.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## 中文

Java Support 1.1.0 为配套 Viva 预览版提供 Java 项目支持。本版本是预发布,插件包不带发布者签名。

### 下载与安装

下载本页对应系统的 ZIP:macOS Apple Silicon(`darwin-arm64`)、macOS Intel(`darwin-x64`)或 Windows x64(`windows-x64`)。在兼容 Viva 客户端的插件设置中选择从文件安装 ZIP。

需要包含 [Lithe #1884](https://github.com/1lck/Lithe-IDEA/pull/1884) 的客户端(修订 `607f00967d70a7017d49805183d0d2e6ffdf1c0d` 或更新版本)及 Core #29。旧版 macOS Lithe 和未包含这些修复的 Viva preview 不受支持。插件使用契约/API/能力版本 0;语言服务器使用随包 Temurin 21,项目运行仍使用用户选择的 JDK。

Maven 项目配合 Maven 0.0.1;Gradle 项目配合 Gradle 1.0.0。构建工具由用户安装或由项目 Wrapper 提供。

### 更新

- 跑通普通 Maven、Gradle 和普通 Java 目录的补全、编译、运行及断点调试,Java 8 项目保留正确的编译目标。
- 修复 Windows 可执行路径、中文/UNC 文件 URI、Lombok 加载及过长 classpath;退出后清理临时 classpath JAR。
- 冷索引暂时无法返回运行动作时,在索引任务完成后有界恢复,不增加后台轮询。
- 已在 macOS 与 Windows 无头验证断点变量、继续/停止、编译错误阻止运行旧 class、暂停时关闭及插件安装目录只读。

### 兼容性与已知限制

尚未完整验收原生窗口、全部日志/取消路径、JUnit/TestNG 行内运行器和 Spring/MyBatis。JSP HTTP/Servlet 调试通过不代表 JSP 源码补全或 JSP 断点;Ant 源码布局不代表执行 Ant target。Java 5/7 源码级别、长 module-path、JavaCC 生成模型、多版本 JAR 和部分旧泛型项目仍有限制,详见 README 与主仓库 #1881–1883。

实测 JDT 内存与补全延迟没有显著改善,本版本不宣称整体性能提升。Windows 的真实工作流在 ARM Windows 上使用 x64 工具验证,其耗时不代表原生 AMD64 性能。

---

## English

Java Support 1.1.0 targets the matching Viva preview. This is a prerelease with unsigned plugin archives.

### Download and installation

Choose the ZIP for macOS Apple Silicon (`darwin-arm64`), macOS Intel (`darwin-x64`), or Windows x64 (`windows-x64`), then install it from a file in the compatible Viva client's plugin settings.

The client must include [Lithe #1884](https://github.com/1lck/Lithe-IDEA/pull/1884), revision `607f00967d70a7017d49805183d0d2e6ffdf1c0d` or newer, and Core #29. Legacy macOS Lithe and earlier Viva previews are unsupported. Contract, API and capability versions are 0. Bundled Temurin 21 runs the language server; project execution uses the selected project JDK.

Use Maven 0.0.1 for Maven projects and Gradle 1.0.0 for Gradle projects. Supply the build tool yourself or through the project's wrapper.

### Changes

- Validated completion, compilation, execution and breakpoint debugging for ordinary Maven, Gradle and plain Java projects, preserving Java 8 compilation targets.
- Fixed Windows executable paths, Unicode/UNC file URIs, Lombok loading and long classpaths; temporary classpath JARs are removed after execution.
- Recover run actions after cold-index jobs finish, with bounded retries and no background polling.
- Headless macOS and Windows workflows cover breakpoint locals, continue/stop, refusal to run stale classes after compilation errors, closing paused sessions and read-only installed packages.

### Compatibility and known limitations

Native windows, all logging/cancellation paths, inline JUnit/TestNG and Spring/MyBatis have not been fully accepted. JSP HTTP/Servlet debugging does not cover JSP-source completion or JSP breakpoints; Ant source layouts do not cover Ant targets. Java 5/7 source levels, long module-paths, JavaCC models, multi-release JARs and some older generic code remain limited; see README and Lithe #1881–1883.

Measurements found no significant JDT memory or completion-latency improvement. Windows workflows used x64 tools on ARM Windows, so their timings do not represent native AMD64 performance.
3 changes: 2 additions & 1 deletion scripts/package/build-windows.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env node
// Assemble on macOS, using the backend built from this checkout on Windows.
// All runtime inputs come from the committed manifests; installed packages are
// never written. This is a development package, not a release/publishing entry.
// never written. Release CI supplies the backend artifact built from the same tag;
// the resulting unsigned ZIP is also used for native development validation.
import { createHash } from 'node:crypto';
import { createReadStream, createWriteStream } from 'node:fs';
import { cp, mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
Expand Down
Loading