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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ flutter --version --no-version-check
dart --version
```

## Channels

See [docs/channels.md](docs/channels.md) for details.

## Architecture selection

See [docs/arm64.md](docs/arm64.md) for details.
Expand Down
21 changes: 21 additions & 0 deletions docs/channels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Channels

`stable` and `beta` install the release the channel currently points to, and also
accept an architecture suffix such as `stable-x64` (see `arm64.md`):

```bash
vfox install flutter@stable
```

- **Resolved at install time.** The SDK is installed under the version the channel
points to, such as `flutter@3.47.4` (`flutter@3.47.4-x64` for `stable-x64`), and
vfox prints that version when the install finishes.
- **Use the version, not the channel.** `vfox use flutter@stable` fails with
`flutter@stable is not installed`; run `vfox use --global flutter@3.47.4` instead.
`vfox uninstall` takes the version as well.
- **Channels are not followed.** Once the channel moves to a new release,
`vfox install flutter@stable` installs it next to the old one; switch to it with
`vfox use`.

Flutter retired the `dev` channel, whose last release is `2.13.0-0.1.pre` from April 2022,
so the plugin does not accept it.
3 changes: 2 additions & 1 deletion docs/ohos.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ vfox search flutter
## Limits

- **Install by exact version.** OpenHarmony versions sort after the official releases,
so `@latest` and the `stable`/`beta`/`dev` channels never select one.
so `@latest` never selects one. The `stable` and `beta` channels (see `channels.md`)
resolve through Flutter's official release index, which lists no OpenHarmony builds.
- **No architecture variants.** `flutter@3.41.10-ohos-1.0.0-x64` is not supported.
- **`linux-arm64` and `windows-arm64`.** Upstream publishes only x64 Dart SDKs, so the first
`flutter` run fails there (`It appears that the downloaded file is corrupt`).
Expand Down
4 changes: 3 additions & 1 deletion hooks/pre_install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ function PLUGIN:PreInstall(ctx)
local platform = getOsTypeAndArch()
local targetArch = requestedArch or platform.archType
local channelKey
if arg == "beta" or arg == "dev" or arg == "stable" then
-- releases_<os>.json still publishes current_release.dev, but Flutter
-- retired the dev channel and it stays at 2.13.0-0.1.pre.
if arg == "beta" or arg == "stable" then
local resp, err = http.get({
url = getReleasesUrl(platform.osType),
})
Expand Down
10 changes: 9 additions & 1 deletion tests/hooks_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,22 @@ tests[#tests + 1] = {
function()
for _, arch in ipairs({ "arm64", "amd64" }) do
setup("darwin", arch)
for channel, version in pairs({ stable = "3.44.0", beta = "3.44.0-0.1.pre", dev = "3.43.0-0.1.pre" }) do
for channel, version in pairs({ stable = "3.44.0", beta = "3.44.0-0.1.pre" }) do
installed(channel, version, arch == "amd64" and "x64" or arch)
installed(channel .. "-x64", version .. "-x64", "x64")
installed(channel .. "-arm64", version .. "-arm64", "arm64")
end
end
end,
}
tests[#tests + 1] = {
"the retired dev channel is not resolved",
function()
setup("darwin", "arm64")
equal(PLUGIN:PreInstall({ version = "dev" }), nil)
equal(PLUGIN:PreInstall({ version = "dev-x64" }), nil)
end,
}
tests[#tests + 1] = {
"pre-release versions retain their full version strings",
function()
Expand Down
Loading