Refactor Shorebird CLI to support configurable URLs and improve test coverage
ci / 📄 License Check (push) Has been cancelled
ci / ✅ Semantic Pull Request (push) Has been cancelled
ci / 🔤 Check Spelling (push) Has been cancelled
ci / 👀 Detect Changes (push) Has been cancelled
ci / 🎯 Build ${{ matrix.package }} (${{ matrix.os }}) (push) Has been cancelled
ci / 🎯 Build ${{ matrix.package }} (push) Has been cancelled
ci / 🔎 Verify ${{ matrix.package }} (push) Has been cancelled
ci / ci (push) Has been cancelled
Deploy Artifact Proxy Dev / ☁️ Artifact Proxy (push) Has been cancelled
Shorebird CI / changes (push) Has been cancelled
Shorebird CI / CSpell (push) Has been cancelled
Shorebird CI / artifact_proxy (push) Has been cancelled
Shorebird CI / dex (push) Has been cancelled
Shorebird CI / discord_gcp_alerts (push) Has been cancelled
Shorebird CI / flutter_version_resolver (push) Has been cancelled
Shorebird CI / jwt (push) Has been cancelled
Shorebird CI / scoped_deps (push) Has been cancelled
Shorebird CI / shorebird_build_trace (push) Has been cancelled
Shorebird CI / shorebird_ci (push) Has been cancelled
Shorebird CI / shorebird_cli (push) Has been cancelled
Shorebird CI / shorebird_code_push_client (push) Has been cancelled
Shorebird CI / shorebird_code_push_protocol (push) Has been cancelled
Shorebird CI / shorebird_redis_client (push) Has been cancelled
Shorebird CI / stripe_api (push) Has been cancelled
Shorebird CI / required (push) Has been cancelled

- Updated AAR releaser test to use ShorebirdProcess.defaultFlutterStorageBaseUrl.
- Changed macOS releaser test to reference a new troubleshooting URL.
- Enhanced shorebird_yaml_test with deserialization for AOT patch metadata.
- Modified network_checker_test to check self-hosted URLs from ShorebirdEnv.
- Added tests for artifact paths in shorebird_artifacts_test.
- Updated shorebird_cli_command_runner_test to reflect new repository URL.
- Improved shorebird_env_test with additional tests for shorebirdRoot and engine revision fallback.
- Adjusted shorebird_flutter_test to use environment variables for Flutter Git URL.
- Updated shorebird_process_test to utilize default Flutter storage URL.
- Enhanced shorebird_validator_test to link to the default hosted URL.
- Updated shorebird_web_console_test to use the configured hosted URL.
- Refactored code_push_client to use default hosted URL for API requests.
- Updated README and generation scripts for the code_push_protocol package to reflect new OpenAPI spec source.
- Modified shared.sh to allow configurable Flutter repository and storage URLs.

Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
Tony
2026-06-25 17:21:56 +08:00
parent 08b8f07bfb
commit d9088aeec6
92 changed files with 2754 additions and 400 deletions
+25 -5
View File
@@ -15,6 +15,8 @@ $flutterPath = [IO.Path]::Combine($shorebirdCacheDir, "flutter", $flutterVersion
$flutter = [IO.Path]::Combine($shorebirdCacheDir, "flutter", $flutterVersion, "bin", "flutter.bat")
$shorebirdScript = [IO.Path]::Combine($shorebirdCliDir, "bin", "shorebird.dart")
$dart = [IO.Path]::Combine($flutterPath, "bin", "cache", "dart-sdk", "bin", "dart.exe")
$defaultFlutterGitUrl = "https://git.tonycloud.org/flutter/flutter.git"
$defaultFlutterStorageBaseUrl = "http://localhost:8080/download.flutter.io"
# Executes $command and redirects as much output to $null as possible.
#
@@ -105,10 +107,21 @@ function Test-ShorebirdNeedsUpdate {
function Update-Flutter {
Write-Output "Updating Flutter..."
$flutterGitUrl = $env:SHOREBIRD_FLUTTER_GIT_URL
if ([string]::IsNullOrWhiteSpace($flutterGitUrl)) {
$flutterGitUrl = $defaultFlutterGitUrl
}
$flutterStorageBaseUrl = $env:SHOREBIRD_FLUTTER_STORAGE_BASE_URL
if ([string]::IsNullOrWhiteSpace($flutterStorageBaseUrl)) {
$flutterStorageBaseUrl = $env:FLUTTER_STORAGE_BASE_URL
}
if ([string]::IsNullOrWhiteSpace($flutterStorageBaseUrl)) {
$flutterStorageBaseUrl = $defaultFlutterStorageBaseUrl
}
if (!(Test-Path $flutterPath)) {
Invoke-SilentlyIfNeeded {
git clone --filter=tree:0 https://github.com/shorebirdtech/flutter.git --no-checkout "$flutterPath"
git clone --filter=tree:0 "$flutterGitUrl" --no-checkout "$flutterPath"
}
}
else {
@@ -122,11 +135,18 @@ function Update-Flutter {
git -C "$flutterPath" -c advice.detachedHead=false checkout "$flutterVersion"
}
# Set FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev and execute
# a `flutter` command to trigger a download of Dart, etc.
$env:FLUTTER_STORAGE_BASE_URL = 'https://download.shorebird.dev';
# Set FLUTTER_STORAGE_BASE_URL and execute a `flutter` command to trigger
# a download of Dart, etc. through the configured open mirror.
$hadFlutterStorageBaseUrl = Test-Path Env:\FLUTTER_STORAGE_BASE_URL
$previousFlutterStorageBaseUrl = $env:FLUTTER_STORAGE_BASE_URL
$env:FLUTTER_STORAGE_BASE_URL = $flutterStorageBaseUrl;
& $flutter --version
Remove-Item Env:\FLUTTER_STORAGE_BASE_URL
if ($hadFlutterStorageBaseUrl) {
$env:FLUTTER_STORAGE_BASE_URL = $previousFlutterStorageBaseUrl
}
else {
Remove-Item Env:\FLUTTER_STORAGE_BASE_URL -ErrorAction SilentlyContinue
}
}
function Update-Shorebird {