From 2d3d26987e9388091426c17ce708b0e1ee2a29e5 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 23 Sep 2024 12:45:40 -0700 Subject: [PATCH] Move to workspaces, drop deprecated API usage --- .github/workflows/dart.yml | 34 +++++++++++++++--------------- build_cli/CHANGELOG.md | 2 +- build_cli/lib/src/to_share.dart | 12 +++++------ build_cli/pubspec.yaml | 6 ++++-- build_cli_annotations/CHANGELOG.md | 2 +- build_cli_annotations/pubspec.yaml | 4 +++- pubspec.yaml | 11 ++++++++++ tool/ci.sh | 2 +- 8 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 pubspec.yaml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index f60b909..340ff52 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.6.1 +# Created with package:mono_repo v6.6.2 name: Dart CI on: push: @@ -36,27 +36,27 @@ jobs: name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.1 + run: dart pub global activate mono_repo 6.6.2 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyzer_and_format; Dart 3.4.0; PKGS: build_cli, build_cli_annotations; `dart analyze --fatal-infos .`" + name: "analyzer_and_format; Dart 3.5.0; PKGS: build_cli, build_cli_annotations; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:build_cli-build_cli_annotations;commands:analyze" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:build_cli-build_cli_annotations;commands:analyze" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:build_cli-build_cli_annotations - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:build_cli-build_cli_annotations + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.4.0" + sdk: "3.5.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -81,23 +81,23 @@ jobs: needs: - job_001 job_003: - name: "analyzer_and_format; Dart 3.4.0; PKGS: build_cli, build_cli_annotations; `dart format --output=none --set-exit-if-changed .`" + name: "analyzer_and_format; Dart 3.5.0; PKGS: build_cli, build_cli_annotations; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:build_cli-build_cli_annotations;commands:format" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:build_cli-build_cli_annotations;commands:format" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:build_cli-build_cli_annotations - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:build_cli-build_cli_annotations + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.4.0" + sdk: "3.5.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -204,23 +204,23 @@ jobs: needs: - job_001 job_006: - name: "unit_test; Dart 3.4.0; PKG: build_cli; `dart test --run-skipped --reporter expanded`" + name: "unit_test; Dart 3.5.0; PKG: build_cli; `dart test --run-skipped --reporter expanded`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:build_cli;commands:test" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:build_cli;commands:test" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:build_cli - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0;packages:build_cli + os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.4.0" + sdk: "3.5.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 diff --git a/build_cli/CHANGELOG.md b/build_cli/CHANGELOG.md index 0718c8c..71ad259 100644 --- a/build_cli/CHANGELOG.md +++ b/build_cli/CHANGELOG.md @@ -1,7 +1,7 @@ ## 2.2.4-wip - Require latest `package:analyzer`. -- Require `sdk: ^3.4.0` +- Require `sdk: ^3.5.0` ## 2.2.3 diff --git a/build_cli/lib/src/to_share.dart b/build_cli/lib/src/to_share.dart index 196d20d..a35b225 100644 --- a/build_cli/lib/src/to_share.dart +++ b/build_cli/lib/src/to_share.dart @@ -40,7 +40,7 @@ Set createSortedFieldSet(ClassElement element) { for (var v in manager.getInheritedMap2(element).values) { assert(v is! FieldElement); - if (_dartCoreObjectChecker.isExactly(v.enclosingElement)) { + if (_dartCoreObjectChecker.isExactly(v.enclosingElement3)) { continue; } @@ -58,20 +58,20 @@ Set createSortedFieldSet(ClassElement element) { int _sortByLocation(FieldElement a, FieldElement b) { final checkerA = - TypeChecker.fromStatic((a.enclosingElement as ClassElement).thisType); + TypeChecker.fromStatic((a.enclosingElement3 as ClassElement).thisType); - if (!checkerA.isExactly(b.enclosingElement)) { + if (!checkerA.isExactly(b.enclosingElement3)) { // in this case, you want to prioritize the enclosingElement that is more // "super". - if (checkerA.isSuperOf(b.enclosingElement)) { + if (checkerA.isSuperOf(b.enclosingElement3)) { return -1; } final checkerB = - TypeChecker.fromStatic((b.enclosingElement as ClassElement).thisType); + TypeChecker.fromStatic((b.enclosingElement3 as ClassElement).thisType); - if (checkerB.isSuperOf(a.enclosingElement)) { + if (checkerB.isSuperOf(a.enclosingElement3)) { return 1; } } diff --git a/build_cli/pubspec.yaml b/build_cli/pubspec.yaml index 33ac873..3b24ce2 100644 --- a/build_cli/pubspec.yaml +++ b/build_cli/pubspec.yaml @@ -6,10 +6,12 @@ description: >- homepage: https://github.com/kevmoo/build_cli environment: - sdk: ^3.4.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: - analyzer: ^6.5.0 + analyzer: ^6.9.0 build: ^2.4.1 # Limit version range on build_cli_annotations # new features need to stay in sync diff --git a/build_cli_annotations/CHANGELOG.md b/build_cli_annotations/CHANGELOG.md index 309204b..83e8bd6 100644 --- a/build_cli_annotations/CHANGELOG.md +++ b/build_cli_annotations/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.1.1-wip -- Require `sdk: ^3.4.0` +- Require `sdk: ^3.5.0` ## 2.1.0 diff --git a/build_cli_annotations/pubspec.yaml b/build_cli_annotations/pubspec.yaml index 1f116dc..14957c2 100644 --- a/build_cli_annotations/pubspec.yaml +++ b/build_cli_annotations/pubspec.yaml @@ -7,7 +7,9 @@ description: >- homepage: https://github.com/kevmoo/build_cli environment: - sdk: ^3.4.0 + sdk: ^3.5.0 + +resolution: workspace dependencies: # Limit version range on args – it's exported diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..579baa2 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,11 @@ +name: build_cli_workspace +environment: + sdk: ^3.5.0 + +publish_to: none + +dev_dependencies: + dart_flutter_team_lints: ^3.2.0 +workspace: + - build_cli + - build_cli_annotations diff --git a/tool/ci.sh b/tool/ci.sh index 6d5870b..25f4f27 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Created with package:mono_repo v6.6.1 +# Created with package:mono_repo v6.6.2 # Support built in commands on windows out of the box.