Skip to content

Commit c149b81

Browse files
[ci] Migrate repo tooling from flutter/plugins (#3198)
Imports the repository tooling from flutter/plugins. This is being moved in advance of the full repository merge in order to reduce the complexity of the final merge, since it is highly separable from the rest of the repository. Rather than being a copy, this grafts the history of flutter/plugins's script/tool directory (rewritten to exclude other directories), to preserve `git blame` and related functionality. All of the commits here except those from today are migrating the code as-is. My commits from today: - Replace all the CI usage of `flutter_plugin_tools` from pub with the local copy, so that this PR tests the code being added. - Updates documentation about the tool. - Enables CI tests of the tool itself. - Updates metadata for the tool (version, source repo). Part of flutter/flutter#113764
2 parents 593f89c + e0ff330 commit c149b81

File tree

97 files changed

+30165
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+30165
-21
lines changed

.ci/scripts/build_examples_win32.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart pub global run flutter_plugin_tools build-examples --windows \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart build-examples --windows \
77
--packages-for-branch --log-timing

.ci/scripts/create_all_packages_app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart pub global run flutter_plugin_tools create-all-packages-app \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \
77
--output-dir=. --exclude script/configs/exclude_all_packages_app.yaml

.ci/scripts/custom_package_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
# script/configs/linux_only_custom_test.yaml
99
# Custom tests need Chrome. (They run in linux-custom_package_tests)
1010

11-
dart pub global run flutter_plugin_tools custom-test \
11+
dart ./script/tool/bin/flutter_plugin_tools.dart custom-test \
1212
--packages-for-branch --log-timing \
1313
--exclude=script/configs/linux_only_custom_test.yaml

.ci/scripts/dart_unit_tests_win32.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart pub global run flutter_plugin_tools test --exclude=script/configs/windows_unit_tests_exceptions.yaml \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart test \
7+
--exclude=script/configs/windows_unit_tests_exceptions.yaml \
78
--packages-for-branch --log-timing

.ci/scripts/drive_examples_win32.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart pub global run flutter_plugin_tools drive-examples --windows \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart drive-examples --windows \
77
--exclude=script/configs/exclude_integration_win32.yaml --packages-for-branch --log-timing

.ci/scripts/native_test_win32.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart pub global run flutter_plugin_tools native-test --windows \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart native-test --windows \
77
--no-integration --packages-for-branch --log-timing

.ci/scripts/plugin_tools_tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Copyright 2013 The Flutter Authors. All rights reserved.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
6+
cd script/tool
7+
dart pub run test

.ci/scripts/prepare_tool.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
# To set FETCH_HEAD for "git merge-base" to work
77
git fetch origin main
88

9-
# Pinned version of the plugin tools, to avoid breakage in this repository
10-
# when pushing updates from flutter/plugins.
11-
dart pub global activate flutter_plugin_tools 0.13.4+2
9+
cd script/tool
10+
dart pub get

.ci/targets/plugin_tools_tests.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
tasks:
2+
- name: prepare tool
3+
script: .ci/scripts/prepare_tool.sh
4+
- name: tool unit tests
5+
script: .ci/scripts/plugin_tools_tests.sh

.cirrus.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ gcp_credentials: ENCRYPTED[!3a93d98d7c95a41f5033834ef30e50928fc5d81239dc632b153c
44
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
55
env:
66
CHANNEL: "master" # Default to master when not explicitly set by a task.
7-
PLUGIN_TOOL_COMMAND: "dart pub global run flutter_plugin_tools"
7+
PLUGIN_TOOL_COMMAND: "dart ./script/tool/bin/flutter_plugin_tools.dart"
88

99
install_chrome_linux_template: &INSTALL_CHROME_LINUX
1010
env:
@@ -84,6 +84,10 @@ task:
8484
namespace: default
8585
matrix:
8686
### Platform-agnostic tasks ###
87+
- name: Linux plugin_tools_tests
88+
script:
89+
- cd script/tool
90+
- dart pub run test
8791
# Repository rules and best-practice enforcement.
8892
# Only channel-agnostic tests should go here since it is only run once
8993
# (on Flutter master).
@@ -127,6 +131,9 @@ task:
127131
matrix:
128132
CHANNEL: "master"
129133
CHANNEL: "stable"
134+
analyze_tool_script:
135+
- cd script/tool
136+
- dart analyze --fatal-infos
130137
analyze_script:
131138
# DO NOT change the custom-analysis argument here without changing the Dart repo.
132139
# See the comment in script/configs/custom_analysis.yaml for details.

0 commit comments

Comments
 (0)