Files
sdk/pkg/dds/example/example.dart
T
Ben Konyi 54fb6ce3c0 [ Service / DDS ] Prepare for package:dds publishing
Final cleanup work before first full version of package:dds is
published:

- Added `getSupportedProtocols` RPC to the VM service protocol, which returns a
  list of supported service protocols and extensions along with their version
  information.
- Added `getDartDevelopmentServiceVersion` RPC to the DDS protocol.
- Misc code and dependency cleanup recommended by pub

Change-Id: If1bdf46852778adf31242122665c36b63106ad44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148224
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-05-15 22:52:12 +00:00

25 lines
809 B
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:dds/dds.dart';
import 'package:vm_service/vm_service_io.dart';
import '../test/common/test_helper.dart';
Future<void> main() async {
final process = await spawnDartProcess('../test/smoke.dart');
final dds = await DartDevelopmentService.startDartDevelopmentService(
remoteVmServiceUri,
);
// Connect to the DDS instance and make a request using package:vm_service.
final service = await vmServiceConnectUri(dds.wsUri.toString());
final version = await service.getVersion();
print('Service Version: $version');
await dds.shutdown();
process.kill();
}