mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:19:49 +00:00
Add a script to serve a local DevTools build
Change-Id: I499b45830bacf8899c5db8d776f7a6c3a47e53b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231362 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
This commit is contained in:
parent
6a4cb1a3a7
commit
a1f0f497a4
33
pkg/dds/tool/devtools_server/serve_local.dart
Normal file
33
pkg/dds/tool/devtools_server/serve_local.dart
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2022, 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 'dart:async';
|
||||
|
||||
import 'package:args/args.dart';
|
||||
import 'package:dds/devtools_server.dart';
|
||||
|
||||
const argDevToolsBuild = 'devtools-build';
|
||||
|
||||
void main(List<String> args) {
|
||||
final argParser = ArgParser()
|
||||
..addOption(
|
||||
argDevToolsBuild,
|
||||
help: 'The location of the DevTools build to serve from DevTools server '
|
||||
'(e.g. --devtools-build=absolute/path/to/devtools/build).',
|
||||
mandatory: true,
|
||||
);
|
||||
|
||||
try {
|
||||
final ArgResults argResults = argParser.parse(args);
|
||||
unawaited(
|
||||
DevToolsServer().serveDevTools(
|
||||
customDevToolsPath: argResults[argDevToolsBuild],
|
||||
),
|
||||
);
|
||||
} on FormatException catch (e) {
|
||||
print(e.message);
|
||||
print('');
|
||||
print(argParser.usage);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue