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
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ default.
`vfox search gradle` lists the releases, newest first, and in an interactive
terminal it lets you pick one and installs it.

Behavior that only exists on `main` and not in the latest release is marked
"Unreleased" in the pages below. At the time of writing that is the search: since
gradle.org/releases was redesigned, release 0.1.3 finds no release there, and
`gradle@latest` fails with it, while a version written out, as above, installs.
[docs/changes.md](docs/changes.md) lists what `main` has, and
[docs/install-from-source.md](docs/install-from-source.md) gets you `main`.

## Java

Gradle runs on a JVM, so a JDK has to be installed first. Without one, `gradle`
Expand Down Expand Up @@ -125,7 +118,7 @@ containers, amd64 and arm64; macOS is not tested in CI.
- [Mirror](docs/mirror.md): `VFOX_GRADLE_MIRRORS`, what a mirror has to serve, and mirrors that were checked
- [Java toolchains](docs/java-toolchains.md): the Foojay plugin, the JDK Gradle runs on and the one it builds with, and letting Gradle use the JDKs vfox installed
- [Troubleshooting](docs/troubleshooting.md): the messages the plugin and vfox print, proxies, and where Gradle is
- [Changes](docs/changes.md): what each release changed, and what only `main` has
- [Changes](docs/changes.md): what each release changed

**Working on the plugin**

Expand Down
4 changes: 1 addition & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ gradle --version

`vfox search gradle` 会从新到旧列出各个版本,在交互式终端里还可以直接选一个并安装。

只存在于 `main`、最新发布版里还没有的行为,在下面的页面里标为“未发布”。撰写本页时,这指的是搜索:gradle.org/releases 改版之后,0.1.3 版在那里找不到任何版本,`gradle@latest` 因此会失败;像上面那样写出确切的版本号仍然可以安装。[docs/zh-CN/changes.md](docs/zh-CN/changes.md) 列出了 `main` 里的内容,[docs/zh-CN/install-from-source.md](docs/zh-CN/install-from-source.md) 能让你用上 `main`。

## Java

Gradle 运行在 JVM 上,所以要先装好 JDK。没有 JDK 时,`gradle` 会停在 `ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.`。JDK 同样可以用 vfox 装,用 [java 插件](https://github.com/version-fox/vfox-java):
Expand Down Expand Up @@ -76,7 +74,7 @@ Gradle 的二进制发行包是同一个 zip,各个系统通用(`bin/gradle`
- [镜像](docs/zh-CN/mirror.md):`VFOX_GRADLE_MIRRORS`、镜像要提供什么,以及检查过的镜像
- [Java toolchain](docs/zh-CN/java-toolchains.md):Foojay 插件、运行 Gradle 的 JDK 与构建用的 JDK,以及让 Gradle 使用 vfox 装的 JDK
- [问题排查](docs/zh-CN/troubleshooting.md):插件和 vfox 的各种提示、代理设置和 Gradle 的位置
- [变更记录](docs/zh-CN/changes.md):每个版本改了什么,以及只有 `main` 才有的内容
- [变更记录](docs/zh-CN/changes.md):每个版本改了什么

**参与开发**

Expand Down
2 changes: 1 addition & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ What changed in each release, as a user notices it. GitHub's
[release pages](https://github.com/version-fox/vfox-gradle/releases) list the
releases.

## Unreleased
## 0.1.4 (2026-12-01)

- `vfox search gradle` and `gradle@latest` work again. Release 0.1.3 reads the
releases from the page gradle.org/releases, which was redesigned between
Expand Down
3 changes: 1 addition & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ A few contracts that cost time to find:
- `Available` raises where the answer names no final release, such as the page of a
portal, or a list in another shape. An empty list that the hook returned would be kept
for 12 hours as any other, and `search` and `latest` would find nothing until it
expired. vfox keeps nothing for a hook that fails (vfox 1.1.0). Unreleased: release
0.1.3 returns the empty list.
expired. vfox keeps nothing for a hook that fails (vfox 1.1.0).
- `PreUse` returns nothing, and vfox matches what was typed against the installed
releases itself, by the start of a number: `gradle@8` selects the newest 8.x
installed, and `gradle@8.1` does not select 8.14.
Expand Down
6 changes: 3 additions & 3 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

The offline Lua hook tests (`tests/*_test.lua` under `vfox plugin test`) run in the
**Test Plugin** workflow. The end-to-end suite runs in containers against real vfox
and the real gradle.org, on Linux and on Windows, each on amd64 and arm64; each vfox
channel (`latest` and `main`) gets its own throwaway container. CI runs the suite
natively on the stock runners (Docker plus Go from `actions/setup-go`). Locally, the
and the real services.gradle.org, on Linux and on Windows, each on amd64 and arm64;
each vfox channel (`latest` and `main`) gets its own throwaway container. CI runs the
suite natively on the stock runners (Docker plus Go from `actions/setup-go`). Locally, the
repository dev container reproduces that on Linux; on Windows a Docker Compose runner
image does, since dev containers cannot host Windows container images (see below).

Expand Down
4 changes: 1 addition & 3 deletions docs/mirror.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ the one that has to be there; the `.sha256` may be left out, see below:
[services.gradle.org/versions/all](https://services.gradle.org/versions/all), so they
need services.gradle.org with a mirror set too. Where it cannot be reached, name the
release, as in `gradle@8.7`. A release the mirror does not carry fails at the
download with `source file not found`. Unreleased: release 0.1.3 reads the page
gradle.org/releases instead, and finds no release in it since its redesign, see
[troubleshooting.md](troubleshooting.md#no-available-version).
download with `source file not found`.

## Mirrors that were checked

Expand Down
27 changes: 12 additions & 15 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
request failed, or the service answered something else than 200. `gradle@latest`
needs the same list, and vfox puts `failed to get available versions` in front of the
message. See [Network](#network). The search does not go through a mirror.
Unreleased: release 0.1.3 asks the page gradle.org/releases, see
[no available version](#no-available-version).

### `no release in <address>`

The request for the list was answered 200, but the answer names no final release: it
is not Gradle's list, such as the page of a portal or a firewall, or the list has a
shape the plugin does not know. Open the address with `curl`. vfox keeps nothing for
a search that fails, so the next one asks again. This message is Unreleased: release
0.1.3 does not have it.
a search that fails, so the next one asks again.

### `HTTP request error: Get "<address>": ...`

Expand All @@ -47,13 +44,14 @@ short. Open the address with `curl`. See [mirror.md](mirror.md#what-a-mirror-has

### `no available version`

Unreleased: release 0.1.3 reads the releases from the page gradle.org/releases, which
was redesigned between 2026-11-14 and 2026-11-19, and finds none in it.
`vfox search gradle` prints this, and `vfox install gradle@latest` fails with
`no available versions`. A release named in full, as in `gradle@9.9.3`, installs.
`main` reads another list, see [install-from-source.md](install-from-source.md). vfox
keeps the empty list for 12 hours; `vfox update gradle` drops it together with the old
plugin once a newer release is out.
vfox prints this when the list of releases is empty, and `vfox install gradle@latest`
fails with `no available versions`. Release 0.1.3 read the releases from the page
gradle.org/releases, which was redesigned between 2026-11-14 and 2026-11-19, and found
none in it, so it returned an empty list (see [changes.md](changes.md)). Since 0.1.4
the plugin does not return an empty list: when the answer names no final release, it
fails with [`no release in <address>`](#no-release-in-address). A release named in
full, as in `gradle@9.9.3`, installs. An empty list that vfox kept from 0.1.3 goes with
`vfox update gradle`.

### `failed to download gradle@8.7.0 file, err:source file not found`

Expand Down Expand Up @@ -153,10 +151,9 @@ with 9.8.2 was run. Move the build to 1.0.0 or later, see
The plugin reads the list and the sum from `services.gradle.org`, and vfox downloads
the zip from there too. With `VFOX_GRADLE_MIRRORS` set, the zip and the sum come from
the mirror, and the sum from `services.gradle.org` where the mirror has none; the list
still comes from `services.gradle.org`. Unreleased: release 0.1.3 reads the list from
`gradle.org`. For a release the address of its files redirects: the sum to
`downloads.gradle.org`, and the zip to Gradle's releases on `github.com`, which hand
it out from `release-assets.githubusercontent.com` (2026-11-03). A network that blocks
still comes from `services.gradle.org`. For a release the address of its files redirects:
the sum to `downloads.gradle.org`, and the zip to Gradle's releases on `github.com`, which
hand it out from `release-assets.githubusercontent.com` (2026-11-03). A network that blocks
one of these hosts breaks the install at the step that needs it. For another address
for the downloads, see [mirror.md](mirror.md).

Expand Down
4 changes: 0 additions & 4 deletions docs/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ keeps the entries marked as final: 180 of 540, from 0.7 to 9.9.3 (2026-12-01). T
service lists them by date, so 8.14.8 and 8.14.7 sit between 9.9.2 and 9.9.1, and
the plugin sorts them by their numbers, newest first. A missing number counts as
zero: 8.14 and 8.14.0 would be equal. The first entry is what `latest` means.
Unreleased: release 0.1.3 reads the page
[gradle.org/releases](https://gradle.org/releases/) instead, and finds no release
in it since its redesign, see
[troubleshooting.md](troubleshooting.md#no-available-version).

An installed release is marked `(installed)`. In an interactive terminal the
search lets you pick a release and installs it. vfox keeps the result for 12
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

每个版本改了什么,从用户的角度来写。GitHub 的[发布页](https://github.com/version-fox/vfox-gradle/releases)列出了各个版本。

## 未发布
## 0.1.4(2026-12-01)

- `vfox search gradle` 和 `gradle@latest` 恢复可用。0.1.3 版从页面 gradle.org/releases 读取版本,这个页面在 2026-11-14 到 2026-11-19 之间改版了,插件在上面一个版本也找不到:搜索打印 `no available version`,`vfox install gradle@latest` 以 `no available versions` 失败,而写出确切版本号(比如 `gradle@9.9.3`)仍然可以安装。现在插件改读 Gradle 的版本服务 `https://services.gradle.org/versions/all`,列出其中标记为 `final` 的正式版:2026-12-01 时和新页面列出的 180 个版本相同,不包含候选版、里程碑版和每夜构建。执行 `vfox update gradle` 之后搜索立即可用:vfox 缓存下来的空列表随旧插件的文件一起删掉。见 [versions.md](versions.md#搜索) 和 [#11](https://github.com/version-fox/vfox-gradle/issues/11)。
- `search` 和 `latest` 需要访问 services.gradle.org,设置了镜像也一样;0.1.3 版做这两件事需要的是 gradle.org。见 [mirror.md](mirror.md#镜像要提供什么)。
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ vfox 加载 `metadata.lua`,命令需要时调用相应的钩子,并向钩子
- 下载是 vfox 自己发起的,除非 `headers` 另有说明,否则自称 `Go-http-client/1.1`。拒绝 Go 默认名字、回应 403 和一段 HTML 的镜像(华为云的就是,2026-11-03),那段页面会被当作 zip 保存下来,安装以 `Checksum error` 结束。钩子在 `headers` 里设置了 `User-Agent`,用的是 vfox 为钩子发出的请求使用的字符串(`util:download_headers()`)。
- 没有摘要时 vfox 只是警告(`Checksum is not provided`),然后继续下载,而且它只会拿钩子给它的摘要去校验下载。所以镜像对 `.sha256` 回应 404(没有这类文件的镜像就是这样)时,钩子会向 services.gradle.org 要同一个版本的摘要,vfox 再用它校验镜像上的 zip。腾讯云的镜像没有 8.7 和 9.8.2 的 `.sha256`,用 0.1.1 版装它们都以那条警告收场。只有这一步也落空时,钩子才不给摘要:被问的服务器是镜像,而需要镜像的网络可能挡住了 services.gradle.org,这不是停下安装的理由。对镜像本身,钩子在 200 和 404 以外的状态码、以及没有摘要的 200 时报错,并且不会改去问 services.gradle.org。0.1.1 版对这些状态码什么也不返回,vfox 就只打印 `no installable runtime provided`。
- `latest` 不由插件处理:vfox 核心取 `Available` 的第一项(`Using latest version: 9.8.2`),所以 `lib/util.lua` 给列表排的顺序,就是 `latest` 的含义。vfox 把 `Available` 的结果缓存 12 小时(`vfox config cache.availableHookDuration`)。
- 回应里没有任何正式版本时(比如门户网站的页面,或者结构变了的列表),`Available` 会报错。如果钩子返回空列表,vfox 会像缓存其他结果一样把它缓存 12 小时,`search` 和 `latest` 在缓存过期之前什么也找不到;钩子失败时 vfox 则什么也不缓存(vfox 1.1.0)。未发布:0.1.3 版返回的是空列表。
- 回应里没有任何正式版本时(比如门户网站的页面,或者结构变了的列表),`Available` 会报错。如果钩子返回空列表,vfox 会像缓存其他结果一样把它缓存 12 小时,`search` 和 `latest` 在缓存过期之前什么也找不到;钩子失败时 vfox 则什么也不缓存(vfox 1.1.0)。
- `PreUse` 什么也不返回,由 vfox 自己把输入的内容和已安装的版本匹配,按版本号的开头匹配:`gradle@8` 选中已安装的最新 8.x,`gradle@8.1` 选不中 8.14。
- `EnvKeys` 拿到的 `ctx.path` 是链接 `~/.vfox/sdks/gradle`,vfox 一直让它指向正在使用的版本,所以无论选中哪个版本,`GRADLE_HOME` 的值都一样。它设置 `GRADLE_HOME` 和 `PATH`,没有 `JAVA_HOME` 之类的东西。
- zip 里只有一个目录 `gradle-<版本>`,vfox 自己能找到它:`PostInstall` 无事可做。`bin/gradle` 的可执行权限在解压后依然保留。
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[中文](e2e.md) | [English](../e2e.md)

离线的 Lua 钩子测试(`tests/*_test.lua`,由 `vfox plugin test` 运行)在 **Test Plugin** 工作流里运行。端到端套件在容器里针对真实的 vfox 和真实的 gradle.org 运行,覆盖 Linux 和 Windows,各有 amd64 和 arm64;每个 vfox 渠道(`latest` 和 `main`)都有自己的一次性容器。CI 直接在标准 runner 上运行这套测试(Docker 加 `actions/setup-go` 提供的 Go)。本地则由仓库的开发容器在 Linux 上复现这一环境;Windows 上改用 Docker Compose runner 镜像,因为开发容器无法承载 Windows 容器镜像(见下文)。
离线的 Lua 钩子测试(`tests/*_test.lua`,由 `vfox plugin test` 运行)在 **Test Plugin** 工作流里运行。端到端套件在容器里针对真实的 vfox 和真实的 services.gradle.org 运行,覆盖 Linux 和 Windows,各有 amd64 和 arm64;每个 vfox 渠道(`latest` 和 `main`)都有自己的一次性容器。CI 直接在标准 runner 上运行这套测试(Docker 加 `actions/setup-go` 提供的 Go)。本地则由仓库的开发容器在 Linux 上复现这一环境;Windows 上改用 Docker Compose runner 镜像,因为开发容器无法承载 Windows 容器镜像(见下文)。

下面的章节说明怎样运行这套测试,页末的[套件验证什么](#套件验证什么)列出它检查的全部内容。

Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/mirror.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $env:VFOX_GRADLE_MIRRORS = "https://repo.huaweicloud.com/gradle"
- 校验和请求的其他回应,比如网关或防火墙给出的 403、500、567,会让安装停下来,并指出地址,例如 `checksum request failed: HTTP 567 from https://mirror.example/gradle/gradle-8.7-bin.zip.sha256`。不会改去问 services.gradle.org。
- 下载时的 User-Agent 是 `vfox/<vfox 版本> vfox-gradle/<插件版本>`。
- 会跟随重定向。
- 版本列表来自 Gradle,而不是镜像:`vfox search gradle` 和 `gradle@latest` 读取的是 [services.gradle.org/versions/all](https://services.gradle.org/versions/all),所以设置了镜像也需要访问 services.gradle.org。访问不到时,请写出确切的版本号,比如 `gradle@8.7`。镜像没有的版本,下载时会以 `source file not found` 失败。未发布:0.1.3 版读取的是页面 gradle.org/releases,页面改版后在上面一个版本也找不到,见 [troubleshooting.md](troubleshooting.md#no-available-version)。
- 版本列表来自 Gradle,而不是镜像:`vfox search gradle` 和 `gradle@latest` 读取的是 [services.gradle.org/versions/all](https://services.gradle.org/versions/all),所以设置了镜像也需要访问 services.gradle.org。访问不到时,请写出确切的版本号,比如 `gradle@8.7`。镜像没有的版本,下载时会以 `source file not found` 失败。

## 检查过的镜像

Expand Down
Loading
Loading