diff --git a/README.md b/README.md index b6929c6..9b53905 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/channels.md b/docs/channels.md new file mode 100644 index 0000000..088ff9b --- /dev/null +++ b/docs/channels.md @@ -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. diff --git a/docs/ohos.md b/docs/ohos.md index 3015dc5..0a12feb 100644 --- a/docs/ohos.md +++ b/docs/ohos.md @@ -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`). diff --git a/hooks/pre_install.lua b/hooks/pre_install.lua index 40d4444..dc27121 100644 --- a/hooks/pre_install.lua +++ b/hooks/pre_install.lua @@ -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_.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), }) diff --git a/tests/hooks_test.lua b/tests/hooks_test.lua index 8fb6373..1efca2e 100644 --- a/tests/hooks_test.lua +++ b/tests/hooks_test.lua @@ -139,7 +139,7 @@ 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") @@ -147,6 +147,14 @@ tests[#tests + 1] = { 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()