diff --git a/docs/changes.md b/docs/changes.md index 9088d2f..f17ea10 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -7,6 +7,7 @@ What changed in each release, as a user notices it. GitHub's release pages list ## Unreleased - 13 more distributions, the rest of what Foojay lists: AdoptOpenJDK (`adpt`, `adptj9`), Eliya (`eliya`), OJDKBuild (`ojdkbld`), OpenLogic (`opnlgc`), Red Hat (`rdht`), Semeru certified (`semcrt`), Gluon GraalVM (`gln`) and GraalVM CE for JDK 8 to 19 (`grl8`, `grl11`, `grl16`, `grl17`, `grl19`). Red Hat installs from tar.xz, and OJDKBuild on Linux, OpenLogic on macOS and Gluon GraalVM before 22.1 from zips. A `.sdkmanrc` takes SDKMAN's old identifiers for them, such as `11.0.10.j9-adpt` and `22.3.3.r17-grl`. See [distributions.md](distributions.md). +- The notes printed by `vfox add java`, `vfox update java` and `vfox info java` are a link to the README, which lists every short name and shows how to search a distribution. Release 0.6.2 gives five short names there but not how to list their versions, while `vfox search java` lists OpenJDK only ([vfox#390](https://github.com/version-fox/vfox/issues/390)). ## 0.6.2 (2026-10-18) diff --git a/docs/e2e.md b/docs/e2e.md index da57ce9..5ac7f46 100644 --- a/docs/e2e.md +++ b/docs/e2e.md @@ -64,7 +64,11 @@ JDK, so `java` can only come from what vfox installs: (`latest`) or built from source (`main`) — and the local `java` plugin is registered from this checkout. On Windows, the runner builds `main` once, while the `latest` combinations run, and the `main` containers start from - the e2e image plus that `vfox.exe`. + the e2e image plus that `vfox.exe`. Then the notes printed by + `vfox info java` must link to the README, which lists the short names + and shows how to search a distribution. They used to give five short + names but not how to list their versions + ([vfox#390](https://github.com/version-fox/vfox/issues/390)). 2. A distribution without a version, alone or after an empty one (`java@tem`, `java@-tem`), fails both `vfox install` and `vfox use` with an error asking for one. The hooks stopped with a Lua error on the first, diff --git a/docs/zh-CN/changes.md b/docs/zh-CN/changes.md index d9d749a..f61f4db 100644 --- a/docs/zh-CN/changes.md +++ b/docs/zh-CN/changes.md @@ -7,6 +7,7 @@ ## 未发布 - 新增 13 个发行版,Foojay 列出的发行版从此全都有了:AdoptOpenJDK(`adpt`、`adptj9`)、Eliya(`eliya`)、OJDKBuild(`ojdkbld`)、OpenLogic(`opnlgc`)、Red Hat(`rdht`)、Semeru 认证版(`semcrt`)、Gluon GraalVM(`gln`),以及基于 JDK 8 到 19 的 GraalVM CE(`grl8`、`grl11`、`grl16`、`grl17`、`grl19`)。Red Hat 从 tar.xz 包安装;Linux 上的 OJDKBuild、macOS 上的 OpenLogic 和 22.1 以前的 Gluon GraalVM 从 zip 包安装。`.sdkmanrc` 里写 SDKMAN 以前给它们的标识符也认,例如 `11.0.10.j9-adpt`、`22.3.3.r17-grl`。见 [distributions.md](distributions.md)。 +- `vfox add java`、`vfox update java` 和 `vfox info java` 打印的 Notes 改成了一个 README 链接,README 里列了全部简称,也写了怎样搜索某个发行版。0.6.2 的 Notes 只给了五个简称,没说怎样列出它们的版本,而 `vfox search java` 只列 OpenJDK([vfox#390](https://github.com/version-fox/vfox/issues/390))。 ## 0.6.2(2026-10-18) diff --git a/docs/zh-CN/e2e.md b/docs/zh-CN/e2e.md index 4852c27..f3f41f2 100644 --- a/docs/zh-CN/e2e.md +++ b/docs/zh-CN/e2e.md @@ -30,7 +30,7 @@ Windows 容器的覆盖(`tests/e2e/windows`)无法在开发容器里运行 每个组合都运行同样的流程(每个组合一个长期存活的容器,由 Go 通过类似 `docker exec` 的调用来驱动);目标镜像里没有 JDK,所以 `java` 只能来自 vfox 安装的东西: -1. 从指定的渠道安装 vfox,要么是最新发布版(`latest`),要么从源码构建(`main`),然后从当前检出的代码注册本地的 `java` 插件。在 Windows 上,runner 会在 `latest` 组合运行期间把 `main` 构建一次,`main` 的容器由 e2e 镜像加上这个 `vfox.exe` 启动。 +1. 从指定的渠道安装 vfox,要么是最新发布版(`latest`),要么从源码构建(`main`),然后从当前检出的代码注册本地的 `java` 插件。在 Windows 上,runner 会在 `latest` 组合运行期间把 `main` 构建一次,`main` 的容器由 e2e 镜像加上这个 `vfox.exe` 启动。接着,`vfox info java` 打印的 Notes 要链接到 README,README 里列了各个简称,也写了怎样搜索某个发行版。以前的 Notes 只给了五个简称,没说怎样列出它们的版本([vfox#390](https://github.com/version-fox/vfox/issues/390))。 2. 只写发行版不写版本,无论单独写还是跟在空版本后面(`java@tem`、`java@-tem`),`vfox install` 和 `vfox use` 都应失败,并提示补上版本。以前,`java@tem` 会让钩子报 Lua 错误;`java@-tem` 则让 `PreInstall` 把空版本发给 Foojay,Foojay 列出所有版本,结果装上了最新的。没有任何发行版发布过的版本(`<大版本>.0.99`)应该安装失败,并且 `PreInstall` 要指出它搜索的平台(`linux/amd64`、`windows/arm64` 等),以此确认向 Foojay 查询的就是 runner 所在的平台。已固定版本里从未发布过的构建(`<版本>+99`,例如 `21.0.8+99-tem`)也一样,这证明查询保留了构建号:Foojay 会把没编码的 `+` 当成空格并丢掉构建号,于是会装上这个版本的最新构建。 3. 在 `graalce` 这一行里,Oracle GraalVM 只写大版本号的 `25-graal` 应该装 25.0 系列的最新构建(`25.0.4.1-graal`),也就是 Oracle 官方 `25/latest` 下载跟的那个系列,而不是 Foojay 列在它前面的某个每月特性版本(比如 `25.4.4.1-graal`)。`vfox search java graal` 列出的 25 的各构建会先被模拟成已安装,这样 `vfox install` 报出的就是 `PreInstall` 选中的那个,而且不会下载任何东西。GA 版本 25 不放进去,因为那样 vfox 会发现 `25-graal` 已安装,根本不会去问 `PreInstall`。 4. 在 `tem` 这几行里(这几行在每个 runner 上都会运行),只按名字检查的发行版(`adpt` 到 `semcrt`,即 `tests/e2e/common` 里的 `nameOnly`),只要 Foojay 在这个 runner 上有它的包,都要能用简称找到:`vfox search java <简称>` 能列出它;把它列出的最新版本模拟成已安装后,`vfox install java@<大版本>-<简称>`(`22-grl17`)要报告这个版本已经安装,所以不会下载任何东西。以前没有这些简称时,这两条命令分别报 `Unsupported distribution` 和 `Could not extract a valid distribution`。 diff --git a/metadata.lua b/metadata.lua index 46da3b9..1cd098d 100644 --- a/metadata.lua +++ b/metadata.lua @@ -41,11 +41,5 @@ PLUGIN.legacyFilenames = { } -- Some things that need user to be attention! PLUGIN.notes = { - "Listed below are the supported distributions and their short names.", - " - Oracle: x.y.z-oracle", - " - OpenJDK: x.y.z-open", - " - GraalVM: x.y.z-graal", - " - Temurin: x.y.z-tem", - " - Zulu: x.y.z-zulu", - "Others please see: https://github.com/version-fox/vfox-java", + "Short names and usage: https://github.com/version-fox/vfox-java/blob/main/README.md", } diff --git a/tests/e2e/common/common.go b/tests/e2e/common/common.go index 1a8dff1..b10fa44 100644 --- a/tests/e2e/common/common.go +++ b/tests/e2e/common/common.go @@ -93,6 +93,12 @@ func ChecksOracleGraalVM(distribution string) bool { return Base(distribution) == "graalce" } +// ReadmeURL is the README the plugin's notes point to, for the short names +// and how to search a distribution. The notes used to list five short names +// but not how to list their versions, while a bare `vfox search java` lists +// OpenJDK only (https://github.com/version-fox/vfox/issues/390). +const ReadmeURL = "https://github.com/version-fox/vfox-java/blob/main/README.md" + // PassThroughEnvs are host env knobs recorded in each target container's // environment, so `docker inspect` shows what a combo ran with. Forwarded // only when set, so unset stays default. diff --git a/tests/e2e/linux/e2e_test.go b/tests/e2e/linux/e2e_test.go index 8b71a28..b127f5d 100644 --- a/tests/e2e/linux/e2e_test.go +++ b/tests/e2e/linux/e2e_test.go @@ -166,6 +166,7 @@ func runOne(t *testing.T, ctx context.Context, image, platform, arch string, c c t.Logf("=== vfox %s, java@%s, %s (%s) ===", c.Vfox, common.Spec(c.Distribution, version), platform, machine) setupVfox(ctx, t, ctr, c.Vfox) + checkNotes(ctx, t, ctr) checkVersionlessRejected(ctx, t, ctr, c.Distribution) checkMissingVersionRejected(ctx, t, ctr, c.Distribution, version, arch) if common.ChecksOracleGraalVM(c.Distribution) { diff --git a/tests/e2e/linux/setup.go b/tests/e2e/linux/setup.go index 41a7de2..6714fd8 100644 --- a/tests/e2e/linux/setup.go +++ b/tests/e2e/linux/setup.go @@ -51,6 +51,16 @@ func setupVfox(ctx context.Context, t *testing.T, ctr tc.Container, vfoxVersion t.Logf("PASS %s with the local java plugin", strings.TrimSpace(execOK(ctx, t, ctr, "vfox --version"))) } +// checkNotes proves the notes printed by `vfox info java` point to the +// README (see common.ReadmeURL). +func checkNotes(ctx context.Context, t *testing.T, ctr tc.Container) { + t.Helper() + out := execOK(ctx, t, ctr, "vfox info java") + require.Containsf(t, common.StripANSI(out), common.ReadmeURL, + "the notes of vfox info java must point to the README\n--- output ---\n%s", out) + t.Logf("PASS the notes of vfox info java point to %s", common.ReadmeURL) +} + // checkVersionlessRejected proves a distribution without a version (e.g. // java@tem, java@-tem, see common.VersionlessSpecs) fails both `vfox // install` and `vfox use` with an error asking for one. The hooks raise it diff --git a/tests/e2e/windows/e2e_test.go b/tests/e2e/windows/e2e_test.go index 55c3a7f..f23651f 100644 --- a/tests/e2e/windows/e2e_test.go +++ b/tests/e2e/windows/e2e_test.go @@ -242,6 +242,7 @@ func runOne(t *testing.T, ctx context.Context, image, platform, arch string, c c box := setupSlotEnv(ctx, t, ctr, c.Slug()) setupVfox(ctx, t, ctr, box, c.Vfox) + checkNotes(ctx, t, ctr, box) activation := fetchActivation(ctx, t, ctr, box) checkVersionlessRejected(ctx, t, ctr, box, activation, c.Distribution) checkMissingVersionRejected(ctx, t, ctr, box, c.Distribution, version, arch) diff --git a/tests/e2e/windows/setup.go b/tests/e2e/windows/setup.go index ac8f674..15b9b8c 100644 --- a/tests/e2e/windows/setup.go +++ b/tests/e2e/windows/setup.go @@ -268,6 +268,16 @@ func activatedEnv(activation, script string) string { "if ($__vfoxExport.Trim()) { Invoke-Expression -Command $__vfoxExport }\r\n" + script } +// checkNotes proves the notes printed by `vfox info java` point to the +// README (see common.ReadmeURL). +func checkNotes(ctx context.Context, t *testing.T, ctr tc.Container, box slotBox) { + t.Helper() + out := execOK(ctx, t, ctr, "vfox info java", box.vars...) + require.Containsf(t, common.StripANSI(out), common.ReadmeURL, + "the notes of vfox info java must point to the README\n--- output ---\n%s", out) + t.Logf("PASS the notes of vfox info java point to %s", common.ReadmeURL) +} + // checkVersionlessRejected proves a distribution without a version (e.g. // java@tem, java@-tem, see common.VersionlessSpecs) fails both `vfox // install` and `vfox use` with an error asking for one. The hooks raise it