Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to use (experimental) workspaces #1433

Merged
merged 1 commit into from
Aug 5, 2024
Merged
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
64 changes: 32 additions & 32 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: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart analyze`"
name: "analyzer_and_format; Dart 3.5.0-259.0.dev; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; `dart analyze`"
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:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable;commands:analyze_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:_test_yaml-checked_yaml-example-json_annotation-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev
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-259.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -192,23 +192,23 @@ jobs:
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
job_004:
name: "unit_test; Dart 3.4.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
name: "unit_test; Dart 3.5.0-259.0.dev; PKGS: _test_yaml, checked_yaml, example, json_serializable; `dart test`"
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:_test_yaml-checked_yaml-example-json_serializable;commands:test_0"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:_test_yaml-checked_yaml-example-json_serializable;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:_test_yaml-checked_yaml-example-json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev
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-259.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -253,23 +253,23 @@ jobs:
- job_002
- job_003
job_005:
name: "unit_test; Dart 3.4.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
name: "unit_test; Dart 3.5.0-259.0.dev; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/annotation_version_test.dart`"
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:json_serializable;commands:test_3"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:json_serializable;commands:test_3"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev
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-259.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand All @@ -287,23 +287,23 @@ jobs:
- job_002
- job_003
job_006:
name: "unit_test; Dart 3.4.0; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
name: "unit_test; Dart 3.5.0-259.0.dev; PKG: json_serializable; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
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:json_serializable;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:json_serializable;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev
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-259.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand All @@ -321,23 +321,23 @@ jobs:
- job_002
- job_003
job_007:
name: "unit_test; Dart 3.4.0; PKG: json_serializable; `dart test -p chrome`"
name: "unit_test; Dart 3.5.0-259.0.dev; PKG: json_serializable; `dart test -p chrome`"
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:json_serializable;commands:test_2"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:json_serializable;commands:test_2"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:json_serializable
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev
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-259.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down Expand Up @@ -518,23 +518,23 @@ jobs:
- job_002
- job_003
job_012:
name: "ensure_build; Dart 3.4.0; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
name: "ensure_build; Dart 3.5.0-259.0.dev; PKGS: _test_yaml, checked_yaml, example; `dart test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
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:_test_yaml-checked_yaml-example;commands:test_1"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:_test_yaml-checked_yaml-example;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:_test_yaml-checked_yaml-example
os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev;packages:_test_yaml-checked_yaml-example
os:ubuntu-latest;pub-cache-hosted;sdk:3.5.0-259.0.dev
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-259.0.dev"
- id: checkout
name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down
12 changes: 3 additions & 9 deletions _test_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: _test_yaml
publish_to: none

environment:
sdk: ^3.4.0
sdk: ^3.5.0-259.0.dev

resolution: workspace

dev_dependencies:
_json_serial_shared_test:
Expand All @@ -16,11 +18,3 @@ dev_dependencies:
path: ^1.8.2
test: ^1.21.6
yaml: ^3.0.0

dependency_overrides:
checked_yaml:
path: ../checked_yaml
json_annotation:
path: ../json_annotation
json_serializable:
path: ../json_serializable
10 changes: 3 additions & 7 deletions checked_yaml/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ topics:
- codegen

environment:
sdk: ^3.4.0
sdk: ^3.5.0-259.0.dev

resolution: workspace

dependencies:
json_annotation: ^4.3.0
Expand All @@ -28,9 +30,3 @@ dev_dependencies:
path: ^1.8.0
test: ^1.17.10
test_process: ^2.0.0

#dependency_overrides:
# json_annotation:
# path: ../json_annotation
# json_serializable:
# path: ../json_serializable
12 changes: 3 additions & 9 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: example
publish_to: none

environment:
sdk: ^3.4.0
sdk: ^3.5.0-259.0.dev

resolution: workspace

dependencies:
json_annotation: ^4.9.0
Expand All @@ -27,11 +29,3 @@ dev_dependencies:
# Not required to use `json_serializable`.
path: ^1.8.0
test: ^1.21.6

# This section is used to verify changes to these packages. Do not include in
# your code!
dependency_overrides:
json_annotation:
path: ../json_annotation
json_serializable:
path: ../json_serializable
4 changes: 3 additions & 1 deletion json_annotation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ topics:
- codegen

environment:
sdk: ^3.4.0
sdk: ^3.5.0-259.0.dev

resolution: workspace

dependencies:
meta: ^1.4.0
Expand Down
18 changes: 9 additions & 9 deletions json_serializable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ targets:
[`Enum`]: https://api.dart.dev/stable/dart-core/Enum-class.html
[`int`]: https://api.dart.dev/stable/dart-core/int-class.html
[`Iterable`]: https://api.dart.dev/stable/dart-core/Iterable-class.html
[`JsonConverter`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonConverter-class.html
[`JsonEnum.valueField`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonEnum/valueField.html
[`JsonEnum`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonEnum-class.html
[`JsonKey.fromJson`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey/fromJson.html
[`JsonKey.toJson`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey/toJson.html
[`JsonKey`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonKey-class.html
[`JsonLiteral`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonLiteral-class.html
[`JsonSerializable`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonSerializable-class.html
[`JsonValue`]: https://pub.dev/documentation/json_annotation/4.9.0/json_annotation/JsonValue-class.html
[`JsonConverter`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonConverter-class.html
[`JsonEnum.valueField`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonEnum/valueField.html
[`JsonEnum`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonEnum-class.html
[`JsonKey.fromJson`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/fromJson.html
[`JsonKey.toJson`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey/toJson.html
[`JsonKey`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonKey-class.html
[`JsonLiteral`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonLiteral-class.html
[`JsonSerializable`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonSerializable-class.html
[`JsonValue`]: https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonValue-class.html
[`List`]: https://api.dart.dev/stable/dart-core/List-class.html
[`Map`]: https://api.dart.dev/stable/dart-core/Map-class.html
[`num`]: https://api.dart.dev/stable/dart-core/num-class.html
Expand Down
4 changes: 3 additions & 1 deletion json_serializable/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ description: >-
Dart classes.
repository: https://github.com/google/json_serializable.dart/tree/master/json_serializable
environment:
sdk: ^3.4.0
sdk: ^3.5.0-259.0.dev
topics:
- json
- build-runner
- json-serializable
- codegen

resolution: workspace

dependencies:
analyzer: ^6.5.0
async: ^2.10.0
Expand Down
14 changes: 7 additions & 7 deletions json_serializable/tool/readme_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ extension on BuildStep {
AssetId assetIdForInputPackage(String path) => AssetId(inputId.package, path);

Future<String> jsonAnnotationVersion() async {
final lockFileAssetId = assetIdForInputPackage('pubspec.lock');
final lockFileContent = await readAsString(lockFileAssetId);
final lockFileYaml =
loadYaml(lockFileContent, sourceUrl: lockFileAssetId.uri) as YamlMap;
final pkgMap = lockFileYaml['packages'] as YamlMap;
final jsonAnnotationMap = pkgMap['json_annotation'] as YamlMap;
final jsonAnnotationVersionString = jsonAnnotationMap['version'] as String;
final jsonAnnotationPubspecAssetId =
AssetId('json_annotation', 'pubspec.yaml');
final jsonAnnotationPubspecContent =
await readAsString(jsonAnnotationPubspecAssetId);
final pubspecYaml = loadYaml(jsonAnnotationPubspecContent,
sourceUrl: jsonAnnotationPubspecAssetId.uri) as YamlMap;
final jsonAnnotationVersionString = pubspecYaml['version'] as String;

final jsonAnnotationVersion =
Version.parse(jsonAnnotationVersionString.trim());
Expand Down
15 changes: 15 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: json_serial_workspace # Can be anything
environment:
sdk: ^3.5.0-259.0.dev # Must be ^3.5.0 or later for workspace to be allowed

publish_to: none

dev_dependencies:
dart_flutter_team_lints: ^3.1.0
workspace:
- _test_yaml
- checked_yaml
- example
- json_annotation
- json_serializable
- shared_test
4 changes: 3 additions & 1 deletion shared_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: _json_serial_shared_test
publish_to: none
environment:
sdk: ^3.4.0
sdk: ^3.5.0-259.0.dev

resolution: workspace

dependencies:
stack_trace: ^1.10.0
Expand Down
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