mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 17:28:42 +08:00
[tool/ci] Add iOS/macOS and Dart support to fetch-deps
(#4562)
Adds `fetch-deps` support for: - iOS/macOS dependencies, using `pod install` - Dart package dependencies, using `pub get` To make avoid doing extra work in the Dart dependencies step when using this with `*_platform_tests` CI, also adds flags for all of the other platforms, and adds a flag that allows skipping Dart dependencies for any package that doesn't have an example supporting any requested platform. This means that we can pass, e.g., `--windows --supporting-target-platforms-only` to only fetch Dart packages for packages with examples that will be build during the build-and-drive Windows tests. Adds this as a new step in every platform tests CI task, and in the standard analyze step, so that we will pre-fetch Dart packages (and for iOS/macOS, pods). This won't yet fully eliminate later network access (see https://github.com/flutter/flutter/issues/131204), but will give us early warning on any major failures, such as pub being entirely unreachable from the bots. - These are marked as an infrastructure step; we'll have to see if this ends up being confusing in practice. If `pub` resolution fails for legitimate reasons, such as a PR that tries to require a version of a package that doesn't exist or that has conflicts, this will cause a failure that is marked as infra. My assumption is that the much more common case is going to be that it is actually an infra failure. Fixes https://github.com/flutter/flutter/issues/130280
This commit is contained in:
@ -176,9 +176,8 @@ class BuildExamplesCommand extends PackageLoopingCommand {
|
||||
// supported platforms. For packages, just log and skip any requested
|
||||
// platform that a package doesn't have set up.
|
||||
if (!isPlugin &&
|
||||
!example.directory
|
||||
.childDirectory(platform.flutterPlatformDirectory)
|
||||
.existsSync()) {
|
||||
!example.appSupportsPlatform(
|
||||
getPlatformByName(platform.pluginPlatform))) {
|
||||
print('Skipping ${platform.label} for $packageName; not supported.');
|
||||
continue;
|
||||
}
|
||||
@ -304,11 +303,6 @@ class _PlatformDetails {
|
||||
/// The `flutter build` build type.
|
||||
final String flutterBuildType;
|
||||
|
||||
/// The Flutter platform directory name.
|
||||
// In practice, this is the same as the plugin platform key for all platforms.
|
||||
// If that changes, this can be adjusted.
|
||||
String get flutterPlatformDirectory => pluginPlatform;
|
||||
|
||||
/// Any extra flags to pass to `flutter build`.
|
||||
final List<String> extraBuildFlags;
|
||||
}
|
||||
|
Reference in New Issue
Block a user