To reduce the headache associated with adding parameters to VM service APIs, VmServiceInterface has been removed from package:vm_service and pulled into its own dedicated package:vm_service_interface. This will help reduce the need for major version bumps of package:vm_service, which requires manual version bumps through >8 packages in order to make the latest version available to flutter_tools and DevTools. This separation of the VmService client from the interface will reduce the frequency of major version bumps to `package:vm_service` as adding optional parameters to existing APIs would cause implementers of the interface to break. package:vm_service continues to expose a copy of the contents of package:vm_service_interface to avoid breaking google3 rolls until package:dwds can migrate to package:vm_service_interface. package:vm_service will not be published until this copy is removed. This change also includes: - some code cleanup and modernization to both the code generator and generated code - >=3.0.0 SDK version requirement to allow for new language features Change-Id: Ib1859c1b4e153fef7ee1f91e67e881bbf42652c2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330500 Reviewed-by: Derek Xu <derekx@google.com> Reviewed-by: Devon Carew <devoncarew@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
1.6 KiB
Contributing to package:vm_service
and package:vm_service_interface
Updating the VM service version
To update package:vm_service
and package:vm_service_interface
to support the latest version of the VM service protocol, run the following script to regenerate the client and interface:
dart tool/generate.dart
Updating the code generator
Both package:vm_service
and package:vm_service_interface
make use of code generation to generate much of their implementations. As a result, manual changes made to some files (e.g., package:vm_service/src/vm_service.dart
and package:vm_service_interface/src/vm_service_interface.dart
) will be overwritten by the code generator.
To make changes to the generated files, make changes in one or more of the following files:
tool/dart/generate_dart_client.dart
for code specific topackage:vm_service
tool/dart/generate_dart_interface.dart
for code specific topackage:vm_service_interface
tool/dart/generate_dart_common.dart
for code common topackage:vm_service
andpackage:vm_service_interface
Running tests locally
1. Build the SDK
From the root of the Dart SDK, run the following commands:
gclient sync -D && \
python3 tools/build.py -ax64 create_sdk
Note: for a release build, add the -mrelease
flag: ./tools/build.py -mrelease -ax64 create_sdk
2. Run the tests
To run all the tests: python3 tools/test.py [ -mdebug | -mrelease ] -ax64 -j4 pkg/vm_service
To run a single test: dart pkg/vm_service/test/<test_name>.dart