Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 677b43a

Browse files
[ci] Remove repo tooling (#7172)
* Remove tooling * Remove CI testing of tooling * Switch invocations to published version * Update tool_runner.sh * Update Cirrus * Fix global run command * Update stale comment * Re-add a minimal stub * Roll forward
1 parent 7a7e43e commit 677b43a

File tree

86 files changed

+44
-27661
lines changed

Some content is hidden

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

86 files changed

+44
-27661
lines changed

.ci.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,6 @@ targets:
281281
{"dependency": "vs_build", "version": "version:vs2019"}
282282
]
283283
284-
- name: Windows plugin_tools_tests
285-
recipe: plugins/plugins
286-
timeout: 30
287-
properties:
288-
add_recipes_cq: "true"
289-
target_file: plugin_tools_tests.yaml
290-
channel: master
291-
version_file: flutter_master.version
292-
293284
- name: Linux ci_yaml plugins roller
294285
recipe: infra/ci_yaml
295286
timeout: 30

.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 ./script/tool/bin/flutter_plugin_tools.dart build-examples --windows \
6+
dart pub global run flutter_plugin_tools build-examples --windows \
77
--packages-for-branch --log-timing

.ci/scripts/create_all_plugins_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 ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \
6+
dart pub global run flutter_plugin_tools create-all-packages-app \
77
--output-dir=. --exclude script/configs/exclude_all_packages_app.yaml

.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 ./script/tool/bin/flutter_plugin_tools.dart drive-examples --windows \
6+
dart pub global run flutter_plugin_tools 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 ./script/tool/bin/flutter_plugin_tools.dart native-test --windows \
6+
dart pub global run flutter_plugin_tools native-test --windows \
77
--no-integration --packages-for-branch --log-timing

.ci/scripts/plugin_tools_tests.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

.ci/scripts/prepare_tool.sh

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

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

.ci/targets/plugin_tools_tests.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.cirrus.yml

Lines changed: 1 addition & 8 deletions
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 ./script/tool/bin/flutter_plugin_tools.dart"
7+
PLUGIN_TOOL_COMMAND: "dart pub global run flutter_plugin_tools"
88

99
install_chrome_linux_template: &INSTALL_CHROME_LINUX
1010
env:
@@ -77,10 +77,6 @@ task:
7777
namespace: default
7878
matrix:
7979
### Platform-agnostic tasks ###
80-
- name: Linux plugin_tools_tests
81-
script:
82-
- cd script/tool
83-
- dart pub run test
8480
# Repository rules and best-practice enforcement.
8581
# Only channel-agnostic tests should go here since it is only run once
8682
# (on Flutter master).
@@ -124,9 +120,6 @@ task:
124120
matrix:
125121
CHANNEL: "master"
126122
CHANNEL: "stable"
127-
analyze_tool_script:
128-
- cd script/tool
129-
- dart analyze --fatal-infos
130123
analyze_script:
131124
# DO NOT change the custom-analysis argument here without changing the Dart repo.
132125
# See the comment in script/configs/custom_analysis.yaml for details.

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ jobs:
3131
with:
3232
fetch-depth: 0 # Fetch all history so the tool can get all the tags to determine version.
3333
- name: Set up tools
34-
run: dart pub get
35-
working-directory: ${{ github.workspace }}/script/tool
34+
run: dart pub global activate flutter_plugin_tools 0.13.4+3
3635

3736
# This workflow should be the last to run. So wait for all the other tests to succeed.
3837
- name: Wait on all tests
@@ -50,5 +49,5 @@ jobs:
5049
run: |
5150
git config --global user.name ${{ secrets.USER_NAME }}
5251
git config --global user.email ${{ secrets.USER_EMAIL }}
53-
dart ./script/tool/lib/src/main.dart publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
52+
dart pub global run flutter_plugin_tools publish --all-changed --base-sha=HEAD~ --skip-confirmation --remote=origin
5453
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}

script/tool/README.md

Lines changed: 9 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,191 +1,13 @@
1-
# Flutter Plugin Tools
1+
# Removed
22

3-
This is a set of utilities used in the flutter/plugins and flutter/packages
4-
repositories. It is no longer explictily maintained as a general-purpose tool
5-
for multi-package repositories, so your mileage may vary if using it in other
6-
repositories.
3+
See https://github.com/flutter/packages/blob/main/script/tool/README.md for the
4+
current location of this tooling.
75

8-
Note: The commands in tools are designed to run at the root of the repository or `<repository-root>/packages/`.
6+
## Temporary shim
97

10-
## Getting Started
8+
This is a temporary, minimal version of the tools sufficient to keep the
9+
following scripts running until the repository merge is complete and they are
10+
updated to use flutter/packages instead:
1111

12-
In flutter/plugins, the tool is run from source. In flutter/packages, the
13-
[published version](https://pub.dev/packages/flutter_plugin_tools) is used
14-
instead. (It is marked as Discontinued since it is no longer maintained as
15-
a general-purpose tool, but updates are still published for use in
16-
flutter/packages.)
17-
18-
The commands in tools require the Flutter-bundled version of Dart to be the first `dart` loaded in the path.
19-
20-
### Extra Setup
21-
22-
When updating sample code excerpts (`update-excerpts`) for the README.md files,
23-
there is some [extra setup for
24-
submodules](#update-readmemd-from-example-sources) that is necessary.
25-
26-
### From Source (flutter/plugins only)
27-
28-
Set up:
29-
30-
```sh
31-
cd ./script/tool && dart pub get && cd ../../
32-
```
33-
34-
Run:
35-
36-
```sh
37-
dart run ./script/tool/bin/flutter_plugin_tools.dart <args>
38-
```
39-
40-
### Published Version
41-
42-
Set up:
43-
44-
```sh
45-
dart pub global activate flutter_plugin_tools
46-
```
47-
48-
Run:
49-
50-
```sh
51-
dart pub global run flutter_plugin_tools <args>
52-
```
53-
54-
## Commands
55-
56-
Run with `--help` for a full list of commands and arguments, but the
57-
following shows a number of common commands being run for a specific package.
58-
59-
All examples assume running from source; see above for running the
60-
published version instead.
61-
62-
Most commands take a `--packages` argument to control which package(s) the
63-
command is targetting. An package name can be any of:
64-
- The name of a package (e.g., `path_provider_android`).
65-
- The name of a federated plugin (e.g., `path_provider`), in which case all
66-
packages that make up that plugin will be targetted.
67-
- A combination federated_plugin_name/package_name (e.g.,
68-
`path_provider/path_provider` for the app-facing package).
69-
70-
### Format Code
71-
72-
```sh
73-
cd <repository root>
74-
dart run ./script/tool/bin/flutter_plugin_tools.dart format --packages package_name
75-
```
76-
77-
### Run the Dart Static Analyzer
78-
79-
```sh
80-
cd <repository root>
81-
dart run ./script/tool/bin/flutter_plugin_tools.dart analyze --packages package_name
82-
```
83-
84-
### Run Dart Unit Tests
85-
86-
```sh
87-
cd <repository root>
88-
dart run ./script/tool/bin/flutter_plugin_tools.dart test --packages package_name
89-
```
90-
91-
### Run Dart Integration Tests
92-
93-
```sh
94-
cd <repository root>
95-
dart run ./script/tool/bin/flutter_plugin_tools.dart build-examples --apk --packages package_name
96-
dart run ./script/tool/bin/flutter_plugin_tools.dart drive-examples --android --packages package_name
97-
```
98-
99-
Replace `--apk`/`--android` with the platform you want to test against
100-
(omit it to get a list of valid options).
101-
102-
### Run Native Tests
103-
104-
`native-test` takes one or more platform flags to run tests for. By default it
105-
runs both unit tests and (on platforms that support it) integration tests, but
106-
`--no-unit` or `--no-integration` can be used to run just one type.
107-
108-
Examples:
109-
110-
```sh
111-
cd <repository root>
112-
# Run just unit tests for iOS and Android:
113-
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --ios --android --no-integration --packages package_name
114-
# Run all tests for macOS:
115-
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --macos --packages package_name
116-
# Run all tests for Windows:
117-
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --windows --packages package_name
118-
```
119-
120-
### Update README.md from Example Sources
121-
122-
`update-excerpts` requires sources that are in a submodule. If you didn't clone
123-
with submodules, you will need to `git submodule update --init --recursive`
124-
before running this command.
125-
126-
```sh
127-
cd <repository root>
128-
dart run ./script/tool/bin/flutter_plugin_tools.dart update-excerpts --packages package_name
129-
```
130-
131-
### Update CHANGELOG and Version
132-
133-
`update-release-info` will automatically update the version and `CHANGELOG.md`
134-
following standard repository style and practice. It can be used for
135-
single-package updates to handle the details of getting the `CHANGELOG.md`
136-
format correct, but is especially useful for bulk updates across multiple packages.
137-
138-
For instance, if you add a new analysis option that requires production
139-
code changes across many packages:
140-
141-
```sh
142-
cd <repository root>
143-
dart run ./script/tool/bin/flutter_plugin_tools.dart update-release-info \
144-
--version=minimal \
145-
--changelog="Fixes violations of new analysis option some_new_option."
146-
```
147-
148-
The `minimal` option for `--version` will skip unchanged packages, and treat
149-
each changed package as either `bugfix` or `next` depending on the files that
150-
have changed in that package, so it is often the best choice for a bulk change.
151-
152-
For cases where you know the change time, `minor` or `bugfix` will make the
153-
corresponding version bump, or `next` will update only `CHANGELOG.md` without
154-
changing the version.
155-
156-
### Publish a Release
157-
158-
**Releases are automated for `flutter/plugins` and `flutter/packages`.**
159-
160-
The manual procedure described here is _deprecated_, and should only be used when
161-
the automated process fails. Please, read
162-
[Releasing a Plugin or Package](https://github.com/flutter/flutter/wiki/Releasing-a-Plugin-or-Package)
163-
on the Flutter Wiki first.
164-
165-
```sh
166-
cd <path_to_plugins>
167-
git checkout <commit_hash_to_publish>
168-
dart run ./script/tool/bin/flutter_plugin_tools.dart publish --packages <package>
169-
```
170-
171-
By default the tool tries to push tags to the `upstream` remote, but some
172-
additional settings can be configured. Run `dart run ./script/tool/bin/flutter_plugin_tools.dart
173-
publish --help` for more usage information.
174-
175-
The tool wraps `pub publish` for pushing the package to pub, and then will
176-
automatically use git to try to create and push tags. It has some additional
177-
safety checking around `pub publish` too. By default `pub publish` publishes
178-
_everything_, including untracked or uncommitted files in version control.
179-
`publish` will first check the status of the local
180-
directory and refuse to publish if there are any mismatched files with version
181-
control present.
182-
183-
## Updating the Tool
184-
185-
For flutter/plugins, just changing the source here is all that's needed.
186-
187-
For changes that are relevant to flutter/packages, you will also need to:
188-
- Update the tool's pubspec.yaml and CHANGELOG
189-
- Publish the tool
190-
- Update the pinned version in
191-
[flutter/packages](https://github.com/flutter/packages/blob/main/.cirrus.yml)
12+
- [dart-lang analysis](https://github.com/dart-lang/sdk/blob/main/tools/bots/flutter/analyze_flutter_plugins.sh)
13+
- [flutter/flutter analysis](https://github.com/flutter/flutter/blob/master/dev/bots/test.dart)

script/tool/lib/src/analyze_command.dart

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,9 @@ class AnalyzeCommand extends PackageLoopingCommand {
3232
valueHelp: 'dart-sdk',
3333
help: 'An optional path to a Dart SDK; this is used to override the '
3434
'SDK used to provide analysis.');
35-
argParser.addFlag(_downgradeFlag,
36-
help: 'Runs "flutter pub downgrade" before analysis to verify that '
37-
'the minimum constraints are sufficiently new for APIs used.');
38-
argParser.addFlag(_libOnlyFlag,
39-
help: 'Only analyze the lib/ directory of the main package, not the '
40-
'entire package.');
4135
}
4236

4337
static const String _customAnalysisFlag = 'custom-analysis';
44-
static const String _downgradeFlag = 'downgrade';
45-
static const String _libOnlyFlag = 'lib-only';
4638
static const String _analysisSdk = 'analysis-sdk';
4739

4840
late String _dartBinaryPath;
@@ -111,26 +103,14 @@ class AnalyzeCommand extends PackageLoopingCommand {
111103

112104
@override
113105
Future<PackageResult> runForPackage(RepositoryPackage package) async {
114-
final bool libOnly = getBoolArg(_libOnlyFlag);
115-
116-
if (libOnly && !package.libDirectory.existsSync()) {
117-
return PackageResult.skip('No lib/ directory.');
118-
}
119-
120-
if (getBoolArg(_downgradeFlag)) {
121-
if (!await _runPubCommand(package, 'downgrade')) {
122-
return PackageResult.fail(<String>['Unable to downgrade dependencies']);
123-
}
124-
}
125-
126106
// Analysis runs over the package and all subpackages (unless only lib/ is
127107
// being analyzed), so all of them need `flutter pub get` run before
128108
// analyzing. `example` packages can be skipped since 'flutter packages get'
129109
// automatically runs `pub get` in examples as part of handling the parent
130110
// directory.
131111
final List<RepositoryPackage> packagesToGet = <RepositoryPackage>[
132112
package,
133-
if (!libOnly) ...await getSubpackages(package).toList(),
113+
...await getSubpackages(package).toList(),
134114
];
135115
for (final RepositoryPackage packageToGet in packagesToGet) {
136116
if (packageToGet.directory.basename != 'example' ||
@@ -146,8 +126,8 @@ class AnalyzeCommand extends PackageLoopingCommand {
146126
if (_hasUnexpecetdAnalysisOptions(package)) {
147127
return PackageResult.fail(<String>['Unexpected local analysis options']);
148128
}
149-
final int exitCode = await processRunner.runAndStream(_dartBinaryPath,
150-
<String>['analyze', '--fatal-infos', if (libOnly) 'lib'],
129+
final int exitCode = await processRunner.runAndStream(
130+
_dartBinaryPath, <String>['analyze', '--fatal-infos'],
151131
workingDir: package.directory);
152132
if (exitCode != 0) {
153133
return PackageResult.fail();

0 commit comments

Comments
 (0)