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

[tool] Upgrade repo to support Dart super parameters feature #5279

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The Flutter version is not important here, since the CI scripts update Flutter
# before running. What matters is that the base image is pinned to minimize
# unintended changes when modifying this file.
FROM cirrusci/flutter:2.8.0
FROM cirrusci/flutter:2.12.0-4.1.pre

RUN apt-get update -y

Expand Down
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2b8333240d38cf72b8e13580e24d01f5a188e26c
df8d0eacd5bf1f50ec4595aa225c91d332a96882
4 changes: 3 additions & 1 deletion script/tool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## NEXT
## 0.8.3

- Adds a new `readme-check` command.
- Updates `publish-plugin` command documentation.
- Bumps pubspec of `all-plugins-app` to `>=2.17.0` so super parameters work in
the generated app.

## 0.8.2

Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/create_all_plugins_app_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class CreateAllPluginsAppCommand extends PluginCommand {
version: Version.parse('1.0.0+1'),
environment: <String, VersionConstraint>{
'sdk': VersionConstraint.compatibleWith(
Version.parse('2.12.0'),
Version.parse('2.17.0'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we'll want to do is read flutter --version --machine and then conditionally set this to 12 or 17 depending on the dartSDKVersion we get.

Actually, come to think of it we could probably future-proof this command against this kind of thing by just always using the dartSdkVersion as this version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that wouldn't be quite right either; it would break us in cases like when Dart supported NNBD, but the template hadn't been updated yet and was still using an older version constraints so as not to opt in. #5281 should be the fully future-proof version.

),
},
dependencies: <String, Dependency>{
Expand Down
2 changes: 1 addition & 1 deletion script/tool/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_plugin_tools
description: Productivity utils for flutter/plugins and flutter/packages
repository: https://github.com/flutter/plugins/tree/main/script/tool
version: 0.8.2
version: 0.8.3

dependencies:
args: ^2.1.0
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/create_all_plugins_app_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ void main() {
]));
});

test('pubspec is compatible with null-safe app code', () async {
test('pubspec is compatible with super parameters in app code', () async {
createFakePlugin('plugina', packagesDir);

await runCapturingPrint(runner, <String>['all-plugins-app']);
final String pubspec =
command.appDirectory.childFile('pubspec.yaml').readAsStringSync();

expect(pubspec, contains(RegExp('sdk:\\s*(?:["\']>=|[^])2\\.12\\.')));
expect(pubspec, contains(RegExp('sdk:\\s*(?:["\']>=|[^])2\\.17\\.')));
});

test('handles --output-dir', () async {
Expand Down