diff --git a/pubspec.yaml b/pubspec.yaml index db9c96675..9ab28ca72 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,6 +25,7 @@ workspace: - compass_app/server - context_menus - date_planner + - deeplink_store_example - desktop_photo_search/fluent_ui - desktop_photo_search/material - dynamic_theme @@ -63,9 +64,13 @@ skip_ci: skip_ci_beta: # TODO: lots of shader arg failures in the tests on beta branch - - animations - - compass_app/app - - compass_app/server - - deeplink_store_example + # - animations + # - compass_app/app + # - compass_app/server + # - deeplink_store_example + # - desktop_photo_search/fluent_ui + # - desktop_photo_search/material + # - form_app + - material_3_demo # TODO(ewindmill): info - lib/basic_text_input_client.dart:262:11 - 'setStyle' is deprecated and shouldn't be used. Use updateStyle instead. This feature was deprecated after v3.41.0-0.0.pre. Try replacing the use of the deprecated member with the replacement. - deprecated_member_use on beta branch - simplistic_editor diff --git a/tool/clean_all.dart b/tool/clean_all.dart new file mode 100644 index 000000000..d13b3d9cc --- /dev/null +++ b/tool/clean_all.dart @@ -0,0 +1,76 @@ +import 'dart:io'; +import 'package:path/path.dart' as path; +import 'package:yaml/yaml.dart'; + +/// Runs `flutter clean` in every package listed in the root pubspec.yaml +/// workspace. Useful for clearing stale build artifacts after switching Flutter +/// channels. +Future main() async { + final rootDir = Directory.current; + final pubspecFile = File(path.join(rootDir.path, 'pubspec.yaml')); + final pubspecContent = await pubspecFile.readAsString(); + final pubspecYaml = loadYaml(pubspecContent); + + final workspace = pubspecYaml['workspace'] as YamlList?; + if (workspace == null) { + print('No workspace found in pubspec.yaml'); + exit(1); + } + + final flutterBin = _resolveFlutterBin(); + print('Using flutter: $flutterBin'); + + var cleaned = 0; + var skipped = 0; + + for (final entry in workspace) { + final package = entry.toString(); + final packagePath = path.join(rootDir.path, package); + + // Only clean packages that have a pubspec.yaml (i.e. are Flutter/Dart pkgs) + final pubspec = File(path.join(packagePath, 'pubspec.yaml')); + if (!await pubspec.exists()) { + print('-- Skipping \'$package\' (no pubspec.yaml found)'); + skipped++; + continue; + } + + print('== Cleaning \'$package\' =='); + final process = await Process.start( + flutterBin, + ['clean'], + workingDirectory: packagePath, + runInShell: true, + mode: ProcessStartMode.inheritStdio, + ); + final exitCode = await process.exitCode; + if (exitCode != 0) { + print( + 'Warning: flutter clean failed with exit code $exitCode in $packagePath', + ); + } else { + cleaned++; + } + } + + print(''); + print('Done. Cleaned $cleaned package(s), skipped $skipped.'); +} + +/// Resolves the path to the `flutter` binary by finding it relative to the +/// running Dart SDK. Falls back to 'flutter' (uses PATH) if not found. +String _resolveFlutterBin() { + // Platform.resolvedExecutable points to the dart binary, e.g.: + // /path/to/flutter/bin/cache/dart-sdk/bin/dart + // Flutter binary is at /path/to/flutter/bin/flutter + final dartBin = File(Platform.resolvedExecutable); + final flutterBin = path.join( + dartBin.parent.parent.parent.parent.path, + 'bin', + 'flutter', + ); + if (File(flutterBin).existsSync()) { + return flutterBin; + } + return 'flutter'; // fallback to PATH +} diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh deleted file mode 100755 index af1e154dc..000000000 --- a/tool/flutter_ci_script_beta.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -set -e - -DIR="${BASH_SOURCE%/*}" -source "$DIR/flutter_ci_script_shared.sh" - -flutter doctor -v - -declare -ar PROJECT_NAMES=( - "add_to_app/android_view/flutter_module_using_plugin" - "add_to_app/books/flutter_module_books" - "add_to_app/fullscreen/flutter_module" - "add_to_app/multiple_flutters/multiple_flutters_module" - "add_to_app/plugin/flutter_module_using_plugin" - "add_to_app/prebuilt_module/flutter_module" - "analysis_defaults" - "android_splash_screen" - "animations" - "asset_transformation" - "background_isolate_channels" - "code_sharing/client" - "code_sharing/server" - "code_sharing/shared" - "compass_app/app" - "compass_app/server" - "context_menus" - "deeplink_store_example" - "desktop_photo_search/fluent_ui" - "desktop_photo_search/material" - "dynamic_theme" - "flutter_maps_firestore" - "form_app" - "game_template" - "google_maps" - "infinite_list" - "ios_app_clip" - # TODO(ewindmill): replace deprecated activeColor with activeThumbColor in 3.33 -# "isolate_example" - # TODO(ewindmill) - RadioGroup api changed. - # "material_3_demo" - "navigation_and_routing" - # TODO(domesticmouse): Angle brackets will be interpreted as HTML. - # "pedometer" - "pedometer/example" - "place_tracker" - "platform_channels" - "platform_design" - "platform_view_swift" - "provider_counter" - "provider_shopper" - "simple_shader" - "simplistic_calculator" - "simplistic_editor" - "testing_app" - "veggieseasons" - "web_embedding/element_embedding_demo" -) - -ci_projects "beta" "${PROJECT_NAMES[@]}" - -echo "-- Success --" diff --git a/tool/flutter_ci_script_master.sh b/tool/flutter_ci_script_master.sh deleted file mode 100755 index 77711edf7..000000000 --- a/tool/flutter_ci_script_master.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -set -e - -DIR="${BASH_SOURCE%/*}" -source "$DIR/flutter_ci_script_shared.sh" - -flutter doctor -v - -declare -ar PROJECT_NAMES=( - "add_to_app/android_view/flutter_module_using_plugin" - "add_to_app/books/flutter_module_books" - "add_to_app/fullscreen/flutter_module" - "add_to_app/multiple_flutters/multiple_flutters_module" - "add_to_app/plugin/flutter_module_using_plugin" - "add_to_app/prebuilt_module/flutter_module" - "analysis_defaults" - "android_splash_screen" - "animations" - "asset_transformation" - "background_isolate_channels" - "code_sharing/client" - # TODO(ewindmill): The integration tests are failing - # "code_sharing/server" - "code_sharing/shared" - "compass_app/app" - # TODO(ewindmill): The integration tests are failing - # "compass_app/server" - "context_menus" - "date_planner" - "deeplink_store_example" - "desktop_photo_search/fluent_ui" - "desktop_photo_search/material" - "dynamic_theme" - "flutter_maps_firestore" - "form_app" - "game_template" - "google_maps" - "infinite_list" - "ios_app_clip" - # TODO(ewindmill): replace deprecated activeColor with activeThumbColor in 3.33 - # "isolate_example" - # TODO(ewindmill) - RadioGroup api changed. - # "material_3_demo" - "navigation_and_routing" - # TODO(domesticmouse): Angle brackets will be interpreted as HTML. - # "pedometer" - "pedometer/example" - "place_tracker" - "platform_channels" - "platform_design" - "platform_view_swift" - "provider_counter" - "provider_shopper" - "simple_shader" - "simplistic_calculator" - "simplistic_editor" - "testing_app" - "veggieseasons" - "web_embedding/element_embedding_demo" -) - -ci_projects "master" "${PROJECT_NAMES[@]}" - -echo "-- Success --" diff --git a/tool/flutter_ci_script_shared.sh b/tool/flutter_ci_script_shared.sh deleted file mode 100644 index 8b511a621..000000000 --- a/tool/flutter_ci_script_shared.sh +++ /dev/null @@ -1,33 +0,0 @@ -function ci_projects () { - local channel="$1" - - shift - local arr=("$@") - for PROJECT_NAME in "${arr[@]}" - do - echo "== Testing '${PROJECT_NAME}' on Flutter's $channel channel ==" - pushd "${PROJECT_NAME}" - - # Grab packages. - flutter pub get - - # Run the analyzer to find any static analysis issues. - dart analyze --fatal-infos --fatal-warnings - - # Run the formatter on all the dart files to make sure everything's linted. - dart format --output none . - - # Run the actual tests. - if [ -d "test" ] - then - if grep -q "flutter:" "pubspec.yaml"; then - flutter test - else - # If the project is not a Flutter project, use the Dart CLI. - dart test - fi - fi - - popd - done -} diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh deleted file mode 100755 index 2d2604acf..000000000 --- a/tool/flutter_ci_script_stable.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -set -e - -DIR="${BASH_SOURCE%/*}" -source "$DIR/flutter_ci_script_shared.sh" - -flutter doctor -v - -declare -ar PROJECT_NAMES=( - "add_to_app/android_view/flutter_module_using_plugin" - "add_to_app/books/flutter_module_books" - "add_to_app/fullscreen/flutter_module" - "add_to_app/multiple_flutters/multiple_flutters_module" - "add_to_app/plugin/flutter_module_using_plugin" - "add_to_app/prebuilt_module/flutter_module" - "analysis_defaults" - "android_splash_screen" - "animations" - "asset_transformation" - "background_isolate_channels" - "code_sharing/client" - "code_sharing/server" - "code_sharing/shared" - "compass_app/app" - "compass_app/server" - "context_menus" - "deeplink_store_example" - "desktop_photo_search/fluent_ui" - "desktop_photo_search/material" - "dynamic_theme" - "flutter_maps_firestore" - "form_app" - "game_template" - "google_maps" - "infinite_list" - "ios_app_clip" - "isolate_example" - "material_3_demo" - "platform_channels" - "platform_design" - "navigation_and_routing" - "pedometer" - "pedometer/example" - "place_tracker" - "platform_view_swift" - "provider_counter" - "provider_shopper" - "simple_shader" - "simplistic_calculator" - "simplistic_editor" - "testing_app" - "veggieseasons" - "web_embedding/element_embedding_demo" -) - -ci_projects "stable" "${PROJECT_NAMES[@]}" - -echo "-- Success --" diff --git a/tool/flutter_clean_packages.sh b/tool/flutter_clean_packages.sh deleted file mode 100644 index f6feecfd8..000000000 --- a/tool/flutter_clean_packages.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -set -e - -flutter doctor -v - -declare -ar PROJECT_NAMES=( - "add_to_app/android_view/flutter_module_using_plugin" - "add_to_app/books/flutter_module_books" - "add_to_app/fullscreen/flutter_module" - "add_to_app/multiple_flutters/multiple_flutters_module" - "add_to_app/plugin/flutter_module_using_plugin" - "add_to_app/prebuilt_module/flutter_module" - "ai_recipe_generation" - "analysis_defaults" - "android_splash_screen" - "animations" - "asset_transformation" - "background_isolate_channels" - "code_sharing/client" - "code_sharing/server" - "code_sharing/shared" - "context_menus" - "deeplink_store_example" - "desktop_photo_search/fluent_ui" - "desktop_photo_search/material" - "dynamic_theme" - "experimental/federated_plugin/federated_plugin" - "experimental/federated_plugin/federated_plugin/example" - "experimental/federated_plugin/federated_plugin_macos" - "experimental/federated_plugin/federated_plugin_platform_interface" - "experimental/federated_plugin/federated_plugin_web" - "experimental/federated_plugin/federated_plugin_windows" - "experimental/pedometer" - "experimental/pedometer/example" - "experimental/varfont_shader_puzzle" - "experimental/web_dashboard" - "flutter_maps_firestore" - "form_app" - "game_template" - "google_maps" - "infinite_list" - "ios_app_clip" - "isolate_example" - "material_3_demo" - "navigation_and_routing" - "place_tracker" - "platform_channels" - "platform_design" - "platform_view_swift" - "provider_counter" - "provider_shopper" - "simple_shader" - "simplistic_calculator" - "simplistic_editor" - "testing_app" - "veggieseasons" - "web_embedding/element_embedding_demo" -) - -echo "--- Running flutter clean and flutter pub get for each sample ---" - -for PROJECT_NAME in "${PROJECT_NAMES[@]}" - do - echo "== Cleaning '${PROJECT_NAME}' with Flutter clean ==" - pushd "${PROJECT_NAME}" - - # run `flutter clean` for project - flutter clean - - # Grab packages. - flutter pub get - - popd - done - -echo "--- Success ---" \ No newline at end of file diff --git a/tool/flutter_pub_upgrade.sh b/tool/flutter_pub_upgrade.sh deleted file mode 100755 index cab1d8f6a..000000000 --- a/tool/flutter_pub_upgrade.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e - -scriptDirectory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - -# It seems federated_plugin_* isn't happy to run flutter pub upgrade -for dir in `find "${scriptDirectory}/.." -name pubspec.yaml -exec dirname {} \; | grep -v federated_plugin | grep -v experimental | sort` -do - ( - cd $dir - echo "Updating `pwd`" - flutter pub upgrade - flutter pub outdated - ) -done