Skip to content

Commit

Permalink
Move to workspaces, drop deprecated API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Sep 23, 2024
1 parent 8fcac6f commit 2d3d269
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 29 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
12 changes: 6 additions & 6 deletions build_cli/lib/src/to_share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Set<FieldElement> 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;
}

Expand All @@ -58,20 +58,20 @@ Set<FieldElement> 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;
}
}
Expand Down
6 changes: 4 additions & 2 deletions build_cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build_cli_annotations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 2.1.1-wip

- Require `sdk: ^3.4.0`
- Require `sdk: ^3.5.0`

## 2.1.0

Expand Down
4 changes: 3 additions & 1 deletion build_cli_annotations/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tool/ci.sh
Original file line number Diff line number Diff line change
@@ -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.

Expand Down

0 comments on commit 2d3d269

Please sign in to comment.