From 33b1901313715aa8c67a3ccf9a8a6091a5c31ddc Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Thu, 16 Nov 2023 10:59:55 -0600 Subject: [PATCH] Update samples for Dart 3.2 (#203) --- .github/workflows/dart.yml | 4 ++-- command_line/pubspec.yaml | 8 ++++---- enhanced_enums/pubspec.yaml | 2 +- extension_methods/pubspec.yaml | 4 ++-- ffi/hello_world/pubspec.yaml | 2 +- ffi/primitives/pubspec.yaml | 2 +- ffi/structs/pubspec.yaml | 2 +- ffi/system-command/pubspec.yaml | 2 +- ffi/test_utils/pubspec.yaml | 2 +- isolates/pubspec.yaml | 2 +- native_app/pubspec.yaml | 4 ++-- null_safety/calculate_lix/pubspec.yaml | 2 +- package_constraint_solver/pubspec.yaml | 4 ++-- parameters/pubspec.yaml | 2 +- server/google_apis/pubspec.yaml | 2 +- server/simple/pubspec.yaml | 2 +- tool/ci.sh | 18 +++++++----------- 17 files changed, 30 insertions(+), 34 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 5715959..8f9a758 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.6.0 +# Created with package:mono_repo v6.6.1 name: Dart CI on: push: @@ -33,7 +33,7 @@ jobs: name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.0 + run: dart pub global activate mono_repo 6.6.1 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: diff --git a/command_line/pubspec.yaml b/command_line/pubspec.yaml index 021fce4..84f2ab4 100644 --- a/command_line/pubspec.yaml +++ b/command_line/pubspec.yaml @@ -1,5 +1,5 @@ name: cli_app -description: > +description: >- A command line application that can be compiled to native code using dart compile exe. @@ -7,16 +7,16 @@ description: > publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: args: ^2.4.0 build_cli_annotations: ^2.1.0 - github: ^9.17.0 + github: ^9.19.0 intl: ^0.18.1 dev_dependencies: - build_cli: ^2.2.2 + build_cli: ^2.2.3 build_runner: ^2.4.6 lints: ^3.0.0 test: ^1.24.0 diff --git a/enhanced_enums/pubspec.yaml b/enhanced_enums/pubspec.yaml index 70c9dee..6b184ca 100644 --- a/enhanced_enums/pubspec.yaml +++ b/enhanced_enums/pubspec.yaml @@ -5,7 +5,7 @@ description: Samples that demonstrates the enhanced enums syntax publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dev_dependencies: lints: ^3.0.0 diff --git a/extension_methods/pubspec.yaml b/extension_methods/pubspec.yaml index 5992677..4e833b5 100644 --- a/extension_methods/pubspec.yaml +++ b/extension_methods/pubspec.yaml @@ -1,12 +1,12 @@ name: extension_methods -description: > +description: >- A set of use cases for the extension methods feature. # This example isn't intended for publishing on pub.dev. publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dev_dependencies: lints: ^3.0.0 diff --git a/ffi/hello_world/pubspec.yaml b/ffi/hello_world/pubspec.yaml index f9a82c7..fe7ec28 100644 --- a/ffi/hello_world/pubspec.yaml +++ b/ffi/hello_world/pubspec.yaml @@ -7,7 +7,7 @@ description: >- publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: path: ^1.8.3 diff --git a/ffi/primitives/pubspec.yaml b/ffi/primitives/pubspec.yaml index acefaa9..71412f2 100644 --- a/ffi/primitives/pubspec.yaml +++ b/ffi/primitives/pubspec.yaml @@ -5,7 +5,7 @@ description: A super simple example of calling C code from Dart with FFI publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: ffi: ^2.1.0 diff --git a/ffi/structs/pubspec.yaml b/ffi/structs/pubspec.yaml index 9312302..ef80cc3 100644 --- a/ffi/structs/pubspec.yaml +++ b/ffi/structs/pubspec.yaml @@ -7,7 +7,7 @@ description: >- publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: ffi: ^2.1.0 diff --git a/ffi/system-command/pubspec.yaml b/ffi/system-command/pubspec.yaml index ad01712..a3861b2 100644 --- a/ffi/system-command/pubspec.yaml +++ b/ffi/system-command/pubspec.yaml @@ -5,7 +5,7 @@ description: A FFI application that invokes system commands. publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: ffi: ^2.1.0 diff --git a/ffi/test_utils/pubspec.yaml b/ffi/test_utils/pubspec.yaml index 3739c8b..74e6941 100644 --- a/ffi/test_utils/pubspec.yaml +++ b/ffi/test_utils/pubspec.yaml @@ -4,7 +4,7 @@ name: test_utils publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: path: ^1.8.3 diff --git a/isolates/pubspec.yaml b/isolates/pubspec.yaml index e445532..5b6d8d8 100644 --- a/isolates/pubspec.yaml +++ b/isolates/pubspec.yaml @@ -3,7 +3,7 @@ description: A sample command-line application. publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: async: ^2.11.0 diff --git a/native_app/pubspec.yaml b/native_app/pubspec.yaml index 4f5cf91..57672a5 100644 --- a/native_app/pubspec.yaml +++ b/native_app/pubspec.yaml @@ -1,5 +1,5 @@ name: native_app -description: > +description: >- A command line application that can be compiled to native code using dart compile exe. @@ -7,7 +7,7 @@ description: > publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dev_dependencies: lints: ^3.0.0 diff --git a/null_safety/calculate_lix/pubspec.yaml b/null_safety/calculate_lix/pubspec.yaml index 6e25bb3..4e2570b 100644 --- a/null_safety/calculate_lix/pubspec.yaml +++ b/null_safety/calculate_lix/pubspec.yaml @@ -6,7 +6,7 @@ version: 1.3.0 publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: collection: ^1.18.0 diff --git a/package_constraint_solver/pubspec.yaml b/package_constraint_solver/pubspec.yaml index 2ce93e0..341e96e 100644 --- a/package_constraint_solver/pubspec.yaml +++ b/package_constraint_solver/pubspec.yaml @@ -4,13 +4,13 @@ repository: https://github.com/dart-lang/samples/tree/main/package_constraint_so publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: path: ^1.8.3 dev_dependencies: - checks: ^0.2.0 + checks: ^0.2.2 lints: ^3.0.0 intl: ^0.18.1 test: ^1.24.0 diff --git a/parameters/pubspec.yaml b/parameters/pubspec.yaml index 1220790..4509542 100644 --- a/parameters/pubspec.yaml +++ b/parameters/pubspec.yaml @@ -5,7 +5,7 @@ version: 1.0.0 publish_to: none environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dev_dependencies: lints: ^3.0.0 diff --git a/server/google_apis/pubspec.yaml b/server/google_apis/pubspec.yaml index 0be0f78..c5a7785 100644 --- a/server/google_apis/pubspec.yaml +++ b/server/google_apis/pubspec.yaml @@ -2,7 +2,7 @@ name: cloud_run_google_apis publish_to: none # not intended for publication to pub.dev environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: google_cloud: ^0.2.0 diff --git a/server/simple/pubspec.yaml b/server/simple/pubspec.yaml index c887c35..e0f7144 100644 --- a/server/simple/pubspec.yaml +++ b/server/simple/pubspec.yaml @@ -2,7 +2,7 @@ name: container_server_example publish_to: none # not intended for publication to pub.dev environment: - sdk: ^3.1.0 + sdk: ^3.2.0 dependencies: shelf: ^1.4.0 diff --git a/tool/ci.sh b/tool/ci.sh index 13c3191..0f71908 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,9 +1,10 @@ #!/bin/bash -# Created with package:mono_repo v6.6.0 +# Created with package:mono_repo v6.6.1 # Support built in commands on windows out of the box. + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter pub" is called instead of "dart pub". # This assumes that the Flutter SDK has been installed in a previous step. function pub() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then @@ -12,18 +13,13 @@ function pub() { command dart pub "$@" fi } -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". -# This assumes that the Flutter SDK has been installed in a previous step. + function format() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter format "$@" - else - command dart format "$@" - fi + command dart format "$@" } + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter analyze" is called instead of "dart analyze". # This assumes that the Flutter SDK has been installed in a previous step. function analyze() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then