[dart] Roll 3p packages forward
Change-Id: I2f43e1b085f80ee1b084f574509f7ea8a5296028
diff --git a/boolean_selector/.gitignore b/boolean_selector/.gitignore
index 25a1df3..49ce72d 100644
--- a/boolean_selector/.gitignore
+++ b/boolean_selector/.gitignore
@@ -1,9 +1,3 @@
-.buildlog
-.DS_Store
-.idea
-.pub/
-.settings/
-build/
-packages
+.dart_tool/
.packages
pubspec.lock
diff --git a/boolean_selector/.travis.yml b/boolean_selector/.travis.yml
index 610bd03..d402e3f 100644
--- a/boolean_selector/.travis.yml
+++ b/boolean_selector/.travis.yml
@@ -1,17 +1,18 @@
language: dart
sudo: false
dart:
- - stable
+ #- stable
- dev
dart_task:
- test: -p vm
xvfb: false
- - test: -p firefox
+ # Set concurrency to 1 to avoid flakes on Travis
+ - test: -p firefox -j 1
- dartanalyzer
matrix:
include:
- - dart: stable
+ - dart: dev
dart_task: dartfmt
# Only building master means that we don't run two builds for each pull request.
diff --git a/boolean_selector/BUILD.gn b/boolean_selector/BUILD.gn
index ffcf290..0f7d0b3 100644
--- a/boolean_selector/BUILD.gn
+++ b/boolean_selector/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for boolean_selector-1.0.3
+# This file is generated by importer.py for boolean_selector-1.0.4
import("//build/dart/dart_library.gni")
@@ -13,7 +13,6 @@
deps = [
"//third_party/dart-pkg/pub/source_span",
- "//third_party/dart-pkg/pub/collection",
"//third_party/dart-pkg/pub/string_scanner",
]
}
diff --git a/boolean_selector/CHANGELOG.md b/boolean_selector/CHANGELOG.md
index 367abee..302c8d3 100644
--- a/boolean_selector/CHANGELOG.md
+++ b/boolean_selector/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.0.4
+
+* Now requires Dart 2.
+
## 1.0.3
* Work around an inference bug in the new common front-end.
diff --git a/boolean_selector/analysis_options.yaml b/boolean_selector/analysis_options.yaml
deleted file mode 100644
index a10d4c5..0000000
--- a/boolean_selector/analysis_options.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
diff --git a/boolean_selector/codereview.settings b/boolean_selector/codereview.settings
deleted file mode 100644
index 3de3f59..0000000
--- a/boolean_selector/codereview.settings
+++ /dev/null
@@ -1,3 +0,0 @@
-CODE_REVIEW_SERVER: https://codereview.chromium.org/
-VIEW_VC: https://github.com/dart-lang/boolean_selector/commit/
-CC_LIST: reviews@dartlang.org
\ No newline at end of file
diff --git a/boolean_selector/lib/src/evaluator.dart b/boolean_selector/lib/src/evaluator.dart
index 6401a37..f2ed7d6 100644
--- a/boolean_selector/lib/src/evaluator.dart
+++ b/boolean_selector/lib/src/evaluator.dart
@@ -2,8 +2,6 @@
// 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:collection/collection.dart';
-
import 'ast.dart';
import 'visitor.dart';
@@ -17,7 +15,7 @@
Evaluator(semantics)
: _semantics = semantics is Iterable
- ? DelegatingIterable.typed(semantics.toSet()).contains
+ ? semantics.toSet().contains
: semantics as _Semantics;
bool visitVariable(VariableNode node) => _semantics(node.name);
diff --git a/boolean_selector/pubspec.yaml b/boolean_selector/pubspec.yaml
index 27961af..580b404 100644
--- a/boolean_selector/pubspec.yaml
+++ b/boolean_selector/pubspec.yaml
@@ -1,16 +1,15 @@
name: boolean_selector
-version: 1.0.3
+version: 1.0.4
description: A flexible syntax for boolean expressions.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/boolean_selector
environment:
- sdk: '>=1.8.0 <2.0.0'
+ sdk: '>=2.0.0-dev.58 <3.0.0'
dependencies:
- collection: '^1.5.0'
source_span: '^1.0.0'
string_scanner: '>=0.1.1 <2.0.0'
dev_dependencies:
- test: '^0.12.0'
+ test: ^1.2.0
diff --git a/charcode/.travis.yml b/charcode/.travis.yml
index b1279b7..d2ada81 100644
--- a/charcode/.travis.yml
+++ b/charcode/.travis.yml
@@ -1,3 +1,17 @@
language: dart
-script: ./tool/travis.sh
-sudo: false
+
+dart:
+ - stable
+ - dev
+
+dart_task:
+ - dart_analyzer: --fatal-warnings .
+ - dartfmt
+
+# Only building master means that we don't run two builds for each pull request.
+branches:
+ only: [master]
+
+cache:
+ directories:
+ - $HOME/.pub-cache
diff --git a/charcode/BUILD.gn b/charcode/BUILD.gn
index d403436..03f7a68 100644
--- a/charcode/BUILD.gn
+++ b/charcode/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for charcode-1.1.1
+# This file is generated by importer.py for charcode-1.1.2
import("//build/dart/dart_library.gni")
diff --git a/charcode/CHANGELOG.md b/charcode/CHANGELOG.md
index 83c2884..cae555b 100644
--- a/charcode/CHANGELOG.md
+++ b/charcode/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.1.2
+
+- Updated the SDK constraint.
+
## 1.1.1
- Spelling fixes.
diff --git a/charcode/.analysis_options b/charcode/analysis_options.yaml
similarity index 95%
rename from charcode/.analysis_options
rename to charcode/analysis_options.yaml
index b727f4d..4bf7b17 100644
--- a/charcode/.analysis_options
+++ b/charcode/analysis_options.yaml
@@ -1,5 +1,3 @@
-analyzer:
- strong-mode: true
linter:
rules:
# Errors
diff --git a/charcode/pubspec.yaml b/charcode/pubspec.yaml
index 9fe3ce3..19a96f7 100644
--- a/charcode/pubspec.yaml
+++ b/charcode/pubspec.yaml
@@ -1,12 +1,11 @@
name: charcode
-version: 1.1.1
+version: 1.1.2
author: Dart Team <misc@dartlang.org>
-description: >
+description: >-
Constants for ASCII and common non-ASCII character codes.
-
When working with characters in Dart, there is no simple way to
represent the code point of a character.
This library declares readable symbolic names for character codes.
homepage: https://github.com/dart-lang/charcode
environment:
- sdk: '>=1.0.0 <2.0.0'
+ sdk: '>=1.0.0 <3.0.0'
diff --git a/charcode/tool/travis.sh b/charcode/tool/travis.sh
deleted file mode 100755
index c7c9d06..0000000
--- a/charcode/tool/travis.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2015, 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.
-
-# Fast fail the script on failures.
-set -e
-
-# Verify that the libraries are error free.
-dartanalyzer --fatal-warnings \
- lib/charcode.dart
diff --git a/completion/.gitignore b/completion/.gitignore
new file mode 100644
index 0000000..79f51c3
--- /dev/null
+++ b/completion/.gitignore
@@ -0,0 +1,3 @@
+.dart_tool
+.packages
+pubspec.lock
diff --git a/completion/.travis.yml b/completion/.travis.yml
new file mode 100644
index 0000000..7e4cc44
--- /dev/null
+++ b/completion/.travis.yml
@@ -0,0 +1,17 @@
+language: dart
+
+dart:
+ - dev
+
+dart_task:
+ - test
+ - dartfmt
+ - dartanalyzer
+
+# Only building master means that we don't run two builds for each pull request.
+branches:
+ only: [master]
+
+cache:
+ directories:
+ - $HOME/.pub-cache
diff --git a/completion/BUILD.gn b/completion/BUILD.gn
new file mode 100644
index 0000000..897cc66
--- /dev/null
+++ b/completion/BUILD.gn
@@ -0,0 +1,19 @@
+# This file is generated by importer.py for completion-0.2.0
+
+import("//build/dart/dart_library.gni")
+
+dart_library("completion") {
+ package_name = "completion"
+
+ # This parameter is left empty as we don't care about analysis or exporting
+ # these sources outside of the tree.
+ sources = []
+
+ disable_analysis = true
+
+ deps = [
+ "//third_party/dart-pkg/pub/path",
+ "//third_party/dart-pkg/pub/args",
+ "//third_party/dart-pkg/pub/logging",
+ ]
+}
diff --git a/completion/CHANGELOG.md b/completion/CHANGELOG.md
new file mode 100644
index 0000000..4da0e86
--- /dev/null
+++ b/completion/CHANGELOG.md
@@ -0,0 +1,53 @@
+## 0.2.0
+
+* Renamed `COMPLETION_COMMAND_NAME` to `completionCommandName`.
+
+* Added named `logFile` argument to `tryArgsCompletion` and `tryCompletion` to
+ aid debugging.
+
+## 0.1.6
+
+* A bunch of internal cleanup.
+
+## 0.1.5
+
+* Support the latest version of `logging`.
+
+## 0.1.4
+
+* Don't blow up if run via `pub run`.
+
+## 0.1.2+5
+
+* Fix for latest `args` version.
+
+## 0.1.2+4
+
+* Allow latest `args` version.
+
+## 0.1.2+3
+
+* Code cleanup.
+
+## 0.1.2+2
+
+* Stopped using deprecated features from `bot` package.
+
+* Formatting
+
+## 0.1.2+1
+
+ * Updated `hop` and added `hop_unittest` dev dependencies.
+
+## 0.1.2
+
+* Fixed test runner.
+
+## 0.1.1 2014-03-04
+ * Removed unneeded dependency on `bot_io`
+ * Cleanup of other references to `bot_io`
+
+## 0.1.0 2014-02-15 (SDK 1.2.0-dev.5.7 32688)
+ * First release
+ * Maintains 100% compatibility with the `completion` library from the `bot_io`
+ package as of release `0.25.1+2`.
diff --git a/completion/LICENSE b/completion/LICENSE
new file mode 100644
index 0000000..b784bd2
--- /dev/null
+++ b/completion/LICENSE
@@ -0,0 +1,29 @@
+The BSD 2-Clause License
+http://www.opensource.org/licenses/bsd-license.php
+
+Copyright (c) 2012, The Dart Bag-of-Tricks project authors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies,
+either expressed or implied, of the FreeBSD Project.
diff --git a/completion/README.md b/completion/README.md
new file mode 100644
index 0000000..fc22eed
--- /dev/null
+++ b/completion/README.md
@@ -0,0 +1,4 @@
+*Add shell command completion to your Dart console applications.*
+
+[![Build Status](https://travis-ci.org/kevmoo/completion.dart.svg?branch=master)](https://travis-ci.org/kevmoo/completion.dart)
+[![Coverage Status](https://coveralls.io/repos/kevmoo/completion.dart/badge.svg?branch=master)](https://coveralls.io/r/kevmoo/completion.dart)
diff --git a/completion/analysis_options.yaml b/completion/analysis_options.yaml
new file mode 100644
index 0000000..b8b8b5c
--- /dev/null
+++ b/completion/analysis_options.yaml
@@ -0,0 +1,62 @@
+analyzer:
+ strong-mode:
+ implicit-casts: false
+ errors:
+ unused_element: error
+ unused_import: error
+ unused_local_variable: error
+ dead_code: error
+ override_on_non_overriding_method: error
+linter:
+ rules:
+ - annotate_overrides
+ - avoid_empty_else
+ - avoid_function_literals_in_foreach_calls
+ - avoid_init_to_null
+ - avoid_null_checks_in_equality_operators
+ - avoid_return_types_on_setters
+ - avoid_returning_null
+ - avoid_unused_constructor_parameters
+ - await_only_futures
+ - camel_case_types
+ - cancel_subscriptions
+ - comment_references
+ - constant_identifier_names
+ - control_flow_in_finally
+ - directives_ordering
+ - empty_catches
+ - empty_constructor_bodies
+ - empty_statements
+ - hash_and_equals
+ - implementation_imports
+ - iterable_contains_unrelated_type
+ - library_names
+ - library_prefixes
+ - list_remove_unrelated_type
+ - no_duplicate_case_values
+ - non_constant_identifier_names
+ - only_throw_errors
+ - overridden_fields
+ - package_api_docs
+ - package_names
+ - package_prefixed_library_names
+ - prefer_conditional_assignment
+ - prefer_final_fields
+ - prefer_is_empty
+ - prefer_is_not_empty
+ - prefer_single_quotes
+ - prefer_typing_uninitialized_variables
+ - recursive_getters
+ - slash_for_doc_comments
+ - super_goes_last
+ - test_types_in_equals
+ - throw_in_finally
+ - type_init_formals
+ - unawaited_futures
+ - unnecessary_brace_in_string_interps
+ - unnecessary_getters_setters
+ - unnecessary_lambdas
+ - unnecessary_null_aware_assignments
+ - unnecessary_statements
+ - unrelated_type_equality_checks
+ - valid_regexps
diff --git a/completion/bin/shell_completion_generator.dart b/completion/bin/shell_completion_generator.dart
new file mode 100755
index 0000000..3ccadba
--- /dev/null
+++ b/completion/bin/shell_completion_generator.dart
@@ -0,0 +1,13 @@
+#!/usr/bin/env dart
+import 'dart:io';
+
+import 'package:completion/completion.dart';
+
+void main(List<String> arguments) {
+ try {
+ print(generateCompletionScript(arguments));
+ } catch (e) {
+ print(e);
+ exitCode = 1;
+ }
+}
diff --git a/completion/example/hello-completion.sh b/completion/example/hello-completion.sh
new file mode 100644
index 0000000..91e272f
--- /dev/null
+++ b/completion/example/hello-completion.sh
@@ -0,0 +1,60 @@
+#
+# Installation:
+#
+# Via shell config file ~/.bashrc (or ~/.zshrc)
+#
+# Append the contents to config file
+# 'source' the file in the config file
+#
+# You may also have a directory on your system that is configured
+# for completion files, such as:
+#
+# /usr/local/etc/bash_completion.d/
+
+###-begin-hello.dart-completion-###
+
+if type complete &>/dev/null; then
+ __hello_dart_completion() {
+ local si="$IFS"
+ IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
+ COMP_LINE="$COMP_LINE" \
+ COMP_POINT="$COMP_POINT" \
+ hello.dart completion -- "${COMP_WORDS[@]}" \
+ 2>/dev/null)) || return $?
+ IFS="$si"
+ }
+ complete -F __hello_dart_completion hello.dart
+elif type compdef &>/dev/null; then
+ __hello_dart_completion() {
+ si=$IFS
+ compadd -- $(COMP_CWORD=$((CURRENT-1)) \
+ COMP_LINE=$BUFFER \
+ COMP_POINT=0 \
+ hello.dart completion -- "${words[@]}" \
+ 2>/dev/null)
+ IFS=$si
+ }
+ compdef __hello_dart_completion hello.dart
+elif type compctl &>/dev/null; then
+ __hello_dart_completion() {
+ local cword line point words si
+ read -Ac words
+ read -cn cword
+ let cword-=1
+ read -l line
+ read -ln point
+ si="$IFS"
+ IFS=$'\n' reply=($(COMP_CWORD="$cword" \
+ COMP_LINE="$line" \
+ COMP_POINT="$point" \
+ hello.dart completion -- "${words[@]}" \
+ 2>/dev/null)) || return $?
+ IFS="$si"
+ }
+ compctl -K __hello_dart_completion hello.dart
+fi
+
+###-end-hello.dart-completion-###
+
+## Generated 2018-04-24 15:45:52.542816Z
+## By /Users/kevmoo/source/github/completion.dart/bin/shell_completion_generator.dart
diff --git a/completion/example/hello.dart b/completion/example/hello.dart
new file mode 100755
index 0000000..81ce1de
--- /dev/null
+++ b/completion/example/hello.dart
@@ -0,0 +1,80 @@
+#!/usr/bin/env dart
+import 'dart:io';
+import 'package:args/args.dart';
+import 'package:completion/completion.dart';
+
+import '../test/completion_tests_args.dart';
+
+main(List<String> args) {
+ final argParser = getHelloSampleParser();
+
+ ArgResults argResult;
+
+ try {
+ argResult = tryArgsCompletion(
+ args,
+ argParser,
+ // logFile: '_completion.log',
+ );
+ } on FormatException catch (ex) {
+ // TODO: print color?
+ print(ex.message);
+ print(argParser.usage);
+
+ /// 64 - C/C++ standard for bad usage.
+ exitCode = 64;
+ return;
+ }
+
+ if (argResult.command != null) {
+ final subCommand = argResult.command;
+ final subCommandParser = argParser.commands[subCommand.name];
+
+ if (subCommand.name == 'help') {
+ // so the help command was run.
+
+ // there are args here, too. Super fun.
+ if (subCommand.command != null) {
+ // we have a sub-sub command. Fun!
+ // let's get the sub-sub command parser
+
+ final subSubCommand = subCommand.command;
+ if (subSubCommand.name == 'assistance') {
+ print('Yes, we have help for help...just calling it assistance');
+ // let's print sub help. Very crazy.
+ print(subCommandParser.usage);
+ return;
+ } else {
+ throw new StateError(
+ 'no clue what that subCammand is: ${subSubCommand.name}');
+ }
+ }
+ // one sub-sub command: help. Really.
+
+ var usage = argParser.usage;
+
+ if (subCommand['yell'] as bool) {
+ usage = usage.toUpperCase();
+ print("I'm yelling, so the case of the available commands will be off");
+ }
+
+ print(usage);
+ return;
+ }
+ }
+
+ final name = argResult.rest.isEmpty ? 'World' : argResult.rest.first;
+
+ final greeting = argResult['friendly'] as bool ? 'Hiya' : 'Hello';
+
+ final String salutationVal = argResult['salutation'];
+ final salutation = salutationVal == null ? '' : '$salutationVal ';
+
+ var message = '$greeting, $salutation$name';
+
+ if (argResult['loud'] as bool) {
+ message = message.toUpperCase();
+ }
+
+ print(message);
+}
diff --git a/completion/example/hello_completion_init.sh b/completion/example/hello_completion_init.sh
new file mode 100644
index 0000000..1bb2642
--- /dev/null
+++ b/completion/example/hello_completion_init.sh
@@ -0,0 +1,36 @@
+#
+# This script should not be run directly (hence, it does not have +x attribute)
+# It should be included in the current environment via
+#
+# source hello_completion_init.sh
+#
+
+APP_NAME=hello.dart
+COMPETION_NAME=hello-completion.sh
+
+APP_DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd )
+
+if [ ! -f $APP_DIR/$APP_NAME ]
+then
+ echo $APP_NAME does not exist in the expected directory
+ exit 1
+fi
+
+if [ ! -f $APP_DIR/$COMPETION_NAME ]
+then
+ echo $COMPETION_NAME does not exist in the expected directory
+ exit 1
+fi
+
+echo Initializing your environment to run the $APP_NAME completion sample
+echo
+
+echo 'sourcing' $COMPETION_NAME to enable command completion
+source $APP_DIR/$COMPETION_NAME
+
+echo
+echo Adding $APP_NAME directory \($APP_DIR\) to PATH environment
+export PATH=$PATH:$APP_DIR
+
+echo
+echo Success!
diff --git a/completion/lib/completion.dart b/completion/lib/completion.dart
new file mode 100644
index 0000000..ea387f8
--- /dev/null
+++ b/completion/lib/completion.dart
@@ -0,0 +1,22 @@
+import 'package:args/args.dart';
+
+import 'src/get_args_completions.dart';
+import 'src/try_completion.dart';
+
+export 'src/generate.dart';
+
+ArgResults tryArgsCompletion(
+ List<String> mainArgs,
+ ArgParser parser,
+ {@Deprecated('Useful for testing, but do not released with this set.')
+ logFile}) {
+ tryCompletion(
+ mainArgs,
+ (List<String> args, String compLine, int compPoint) {
+ return getArgsCompletions(parser, args, compLine, compPoint);
+ },
+ // ignore: deprecated_member_use
+ logFile: logFile,
+ );
+ return parser.parse(mainArgs);
+}
diff --git a/completion/lib/src/bot.dart b/completion/lib/src/bot.dart
new file mode 100644
index 0000000..c77a072
--- /dev/null
+++ b/completion/lib/src/bot.dart
@@ -0,0 +1,55 @@
+class Tuple<T1, T2> {
+ final T1 item1;
+ final T2 item2;
+
+ const Tuple(this.item1, this.item2);
+
+ @override
+ bool operator ==(other) {
+ return other is Tuple && item1 == other.item1 && item2 == other.item2;
+ }
+
+ @override
+ String toString() => '{item1: $item1, item2: $item2}';
+
+ @override
+ int get hashCode => Util.getHashCode([item1, item2]);
+
+ dynamic toJson() => {'item1': item1, 'item2': item2};
+}
+
+class Util {
+ static int getHashCode(Iterable source) {
+ requireArgumentNotNull(source, 'source');
+
+ int hash = 0;
+ for (final h in source) {
+ int next = h == null ? 0 : h.hashCode;
+ hash = 0x1fffffff & (hash + next);
+ hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
+ hash ^= hash >> 6;
+ }
+ hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
+ hash ^= hash >> 11;
+ return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
+ }
+}
+
+void require(bool truth, [String message]) {
+ if (!truth) {
+ throw new Exception(message);
+ }
+}
+
+void requireArgumentNotNull(argument, String argName) {
+ _metaRequireArgumentNotNullOrEmpty(argName);
+ if (argument == null) {
+ throw new ArgumentError.notNull(argName);
+ }
+}
+
+void _metaRequireArgumentNotNullOrEmpty(String argName) {
+ if (argName == null || argName.isEmpty) {
+ throw new UnsupportedError("That's just sad. Give me a good argName");
+ }
+}
diff --git a/completion/lib/src/generate.dart b/completion/lib/src/generate.dart
new file mode 100644
index 0000000..e371b2b
--- /dev/null
+++ b/completion/lib/src/generate.dart
@@ -0,0 +1,141 @@
+import 'dart:convert';
+import 'dart:io';
+
+import 'package:path/path.dart' as pathos;
+
+const _binNameReplacement = '{{binName}}';
+const _funcNameReplacement = '{{funcName}}';
+
+/*
+ * Must be at least one char.
+ * Must start with a letter or number
+ * Can contain letters, numbers, '_', '-', '.'
+ * Must end with letter or number
+ */
+final _binNameMatch = new RegExp(r'^[a-zA-Z0-9]((\w|-|\.)*[a-zA-Z0-9])?$');
+
+/*
+ * Format for unified bash and zsh completion script:
+ * https://npmjs.org/
+ * https://github.com/isaacs/npm/blob/master/lib/utils/completion.sh
+ *
+ * Inspiration for auto-generating completion scripts:
+ * https://github.com/mklabs/node-tabtab
+ * https://github.com/mklabs/node-tabtab/blob/master/lib/completion.sh
+ */
+
+String generateCompletionScript(List<String> binaryNames) {
+ if (binaryNames.isEmpty) {
+ throw new ArgumentError('Provide the name of at least of one command');
+ }
+
+ for (final binName in binaryNames) {
+ if (!_binNameMatch.hasMatch(binName)) {
+ final msg = 'The provided name - "$binName" - is invalid\n'
+ 'It must match regex: ${_binNameMatch.pattern}';
+ throw new StateError(msg);
+ }
+ }
+
+ var buffer = new StringBuffer();
+
+ final prefix =
+ LineSplitter.split(_prefix).map((l) => '# $l'.trim()).join('\n');
+ buffer.writeln(prefix);
+
+ // empty line
+ buffer.writeln('');
+
+ for (final binName in binaryNames) {
+ buffer.writeln(_printBinName(binName));
+ }
+
+ final detailLines = [
+ 'Generated ${new DateTime.now().toUtc()}',
+ ];
+
+ if (Platform.script.scheme == 'file') {
+ var scriptPath = Platform.script.toFilePath();
+ scriptPath = pathos.absolute(pathos.normalize(scriptPath));
+
+ detailLines.add('By $scriptPath');
+ }
+
+ final details = detailLines.map((l) => '## $l').join('\n');
+ buffer.write(details);
+
+ return buffer.toString();
+}
+
+String _printBinName(String binName) {
+ var templateContents = _template.replaceAll(_binNameReplacement, binName);
+
+ var funcName = binName.replaceAll('.', '_');
+ funcName = '__${funcName}_completion';
+ templateContents =
+ templateContents.replaceAll(_funcNameReplacement, funcName);
+
+ return templateContents;
+}
+
+const _prefix = '''
+
+Installation:
+
+Via shell config file ~/.bashrc (or ~/.zshrc)
+
+ Append the contents to config file
+ 'source' the file in the config file
+
+You may also have a directory on your system that is configured
+ for completion files, such as:
+
+ /usr/local/etc/bash_completion.d/
+''';
+
+const _template = r'''
+###-begin-{{binName}}-completion-###
+
+if type complete &>/dev/null; then
+ {{funcName}}() {
+ local si="$IFS"
+ IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
+ COMP_LINE="$COMP_LINE" \
+ COMP_POINT="$COMP_POINT" \
+ {{binName}} completion -- "${COMP_WORDS[@]}" \
+ 2>/dev/null)) || return $?
+ IFS="$si"
+ }
+ complete -F {{funcName}} {{binName}}
+elif type compdef &>/dev/null; then
+ {{funcName}}() {
+ si=$IFS
+ compadd -- $(COMP_CWORD=$((CURRENT-1)) \
+ COMP_LINE=$BUFFER \
+ COMP_POINT=0 \
+ {{binName}} completion -- "${words[@]}" \
+ 2>/dev/null)
+ IFS=$si
+ }
+ compdef {{funcName}} {{binName}}
+elif type compctl &>/dev/null; then
+ {{funcName}}() {
+ local cword line point words si
+ read -Ac words
+ read -cn cword
+ let cword-=1
+ read -l line
+ read -ln point
+ si="$IFS"
+ IFS=$'\n' reply=($(COMP_CWORD="$cword" \
+ COMP_LINE="$line" \
+ COMP_POINT="$point" \
+ {{binName}} completion -- "${words[@]}" \
+ 2>/dev/null)) || return $?
+ IFS="$si"
+ }
+ compctl -K {{funcName}} {{binName}}
+fi
+
+###-end-{{binName}}-completion-###
+''';
diff --git a/completion/lib/src/get_args_completions.dart b/completion/lib/src/get_args_completions.dart
new file mode 100644
index 0000000..d593e88
--- /dev/null
+++ b/completion/lib/src/get_args_completions.dart
@@ -0,0 +1,303 @@
+import 'package:args/args.dart';
+
+import 'bot.dart';
+import 'util.dart';
+
+/*
+ * TODO: an interesting scenario: if there is only one subcommand,
+ * then tabbing into an app just completes to that one command. Weird?
+ */
+
+List<String> getArgsCompletions(ArgParser parser, List<String> providedArgs,
+ String compLine, int compPoint) {
+ assert(parser != null);
+ assert(providedArgs != null);
+ // all arg entries: no empty items, no null items, all pre-trimmed
+ for (int i = 0; i < providedArgs.length; i++) {
+ final arg = providedArgs[i];
+ final msg = 'Arg at index $i with value "$arg" ';
+ requireArgumentNotNull(arg, '$msg is null');
+ require(arg.trim() == arg, '$msg has whitespace');
+
+ if (i < (providedArgs.length - 1)) {
+ require(
+ arg.isNotEmpty, '$msg – Only the last arg can be an empty string');
+ }
+ }
+
+ void sublog(Object obj) {
+ log(obj, Tag.getArgsCompletions);
+ }
+
+ sublog('provided args: ${helpfulToString(providedArgs)}');
+ sublog('COMP_LINE: "$compLine"');
+ sublog('COMP_POINT: $compPoint');
+
+ if (compPoint < compLine.length) {
+ // TODO: ponder smart ways to handle in-line completion
+ sublog('cursor is in the middle of the line. NO-OP');
+ return const [];
+ }
+
+ if (providedArgs.isEmpty) {
+ sublog('empty args. Complete with all available commands');
+ return parser.commands.keys.toList();
+ }
+
+ final alignedArgsOptions =
+ providedArgs.map((arg) => _getOptionForArg(parser, arg)).toList();
+
+ /*
+ * NOTE: nuanced behavior
+ * If the last item provided is a full, real item (command or option)
+ * It should be completed with its full name so the user can move on
+ * Soooo....we are excluding the last item in [alignedArgsOptions] from
+ * optionsDefinedInArgs
+ *
+ * Keep in mind, if we're already on to the next item to complete, the last
+ * item is likely empty string '' or '--', so this isn't a problem
+ */
+
+ // a set of options in use (minus, potentially, the last one)
+ // all non-null, all unique
+ var optionsDefinedInArgs = alignedArgsOptions
+ .take(alignedArgsOptions.length - 1)
+ .where((o) => o != null)
+ .toSet();
+ sublog('defined options: ${optionsDefinedInArgs.map((o) => o.name).toSet()}');
+
+ var parserOptionCompletions = new List<String>.unmodifiable(
+ _getParserOptionCompletions(parser, optionsDefinedInArgs));
+
+ /*
+ * KNOWN: at least one item in providedArgs last and first are now safe
+ */
+
+ /*
+ * Now we're going to lean on the existing parse functionality to see
+ * if the provided args (or a subset of them) parse to valid [ArgsResult]
+ * If it does, we can use the result to determine what we should do next
+ */
+
+ final subsetTuple = _getValidSubset(parser, providedArgs);
+ final validSubSet = subsetTuple.item1;
+ final subsetResult = subsetTuple.item2;
+
+ sublog('valid subset: ${helpfulToString(validSubSet)}');
+
+ /*
+ * CASE: we have a command
+ * get recursive
+ */
+ if (subsetResult != null && subsetResult.command != null) {
+ // get all of the args *after* the command name
+ // call in recursively with the sub command parser, right?
+ final subCommand = subsetResult.command;
+ final subCommandIndex = providedArgs.indexOf(subCommand.name);
+ assert(subCommandIndex >= 0);
+ sublog('so, it seems we have command "${subCommand.name}" at '
+ 'index $subCommandIndex');
+
+ final subCommandParser = parser.commands[subCommand.name];
+ final subCommandArgs = providedArgs.sublist(subCommandIndex + 1);
+
+ /*
+ * only start rockin' the sub command parser if
+ * 1) there's a start on sub args
+ * 2) there's whitespace at the end of compLine
+ */
+
+ if (subCommandArgs.isNotEmpty || compLine.endsWith(' ')) {
+ return getArgsCompletions(
+ subCommandParser, subCommandArgs, compLine, compPoint);
+ }
+ }
+
+ final removedItems = providedArgs.sublist(validSubSet.length);
+ assert(removedItems.length + validSubSet.length == providedArgs.length);
+
+ sublog('removed items: ${helpfulToString(removedItems)}');
+
+ final lastArg = providedArgs.last;
+
+ /*
+ * CASE: one removed item, that looks like a partial option
+ * try to match it against available options
+ */
+ if (removedItems.length == 1 && removedItems.single.startsWith('--')) {
+ final removedItem = removedItems.single;
+
+ if (compLine.endsWith(' ')) {
+ // if the removed item maps to an option w/ allowed values
+ // we should return those values to complete against
+ final option = alignedArgsOptions[providedArgs.length - 1];
+ if (option != null &&
+ option.allowed != null &&
+ option.allowed.isNotEmpty) {
+ assert(!option.isFlag);
+
+ sublog('completing all allowed value for option "${option.name}"');
+
+ return option.allowed.toList();
+ }
+ } else {
+ sublog('completing the name of options starting with "$removedItem"');
+
+ return parserOptionCompletions
+ .where((String option) => option.startsWith(removedItem))
+ .toList();
+ }
+ }
+
+ /*
+ * CASE: second-to-last arg is an option+allowed and lastArg is empty
+ * then we should complete with the available options, right?
+ */
+ if (providedArgs.length >= 2) {
+ final option = alignedArgsOptions[providedArgs.length - 2];
+ if (option != null) {
+ if (option.allowed != null && option.allowed.isNotEmpty) {
+ assert(!option.isFlag);
+ sublog('completing option "${option.name}"');
+
+ final String optionValue = providedArgs[providedArgs.length - 1];
+
+ return option.allowed
+ .where((String v) => v.startsWith(optionValue))
+ .toList();
+ } else if (!option.isFlag) {
+ sublog('not providing completions. Wating for option value');
+ return const [];
+ }
+ }
+ }
+
+ /*
+ * CASE: no removed items and compLine ends in a space ->
+ * do command completion
+ */
+ if (removedItems.isEmpty && lastArg == '') {
+ sublog('doing command completion');
+
+ return parser.commands.keys.toList();
+ }
+
+ /*
+ * CASE: If we have '--', then let's naively complete all options
+ */
+ if (lastArg == '--') {
+ sublog('Completing with all available options.');
+ return parserOptionCompletions;
+ }
+
+ /*
+ * CASE: a partial command name?
+ * if the last arg doesn't start with a '-'
+ */
+ if (!lastArg.startsWith('-')) {
+ // for now, let's pretend this is partial command
+
+ sublog('completing command names that start with "$lastArg"');
+
+ return parser.commands.keys
+ .where((String commandName) => commandName.startsWith(lastArg))
+ .toList();
+ }
+
+ /*
+ * CASE: the last argument is valid, so we should return it
+ * if types the last char of a valid option, hitting tab should complete it
+ */
+ if (lastArg != '' && parserOptionCompletions.contains(lastArg)) {
+ sublog('completing final arg');
+ return [lastArg];
+ }
+
+ sublog('Exhausted options. No suggestions.');
+
+ return const [];
+}
+
+Option _getOptionForArg(ArgParser parser, String arg) {
+ // could be a full arg name
+ if (arg.startsWith('--')) {
+ final nameOption = arg.substring(2);
+ final option = parser.options[nameOption];
+ if (option != null) {
+ return option;
+ }
+ }
+
+ // could be a 'not' arg name
+ if (arg.startsWith('--no-')) {
+ final nameOption = arg.substring(5);
+ final option = parser.options[nameOption];
+ if (option != null && option.negatable) {
+ return option;
+ }
+ }
+
+ if (arg.startsWith('-') && arg.length == 2) {
+ // all abbreviations are single-character
+ final abbr = arg.substring(1);
+ assert(abbr.length == 1);
+ return parser.findByAbbreviation(abbr);
+ }
+
+ // no matching option
+ return null;
+}
+
+Iterable<String> _getParserOptionCompletions(
+ ArgParser parser, Set<Option> existingOptions) {
+ assert(
+ existingOptions.every((option) => parser.options.containsValue(option)));
+
+ return parser.options.values
+ .where((opt) =>
+ !existingOptions.contains(opt) || opt.type == OptionType.multiple)
+ .expand(_getArgsOptionCompletions);
+}
+
+Tuple<List<String>, ArgResults> _getValidSubset(
+ ArgParser parser, List<String> providedArgs) {
+ /* start with all of the args, loop through parsing them,
+ * removing one every time
+ *
+ * Util:
+ * 1) we have a valid ArgsResult
+ * 2) we have no more args
+ */
+ final validSubSet = providedArgs.toList();
+ ArgResults subsetResult;
+ while (validSubSet.isNotEmpty) {
+ try {
+ subsetResult = parser.parse(validSubSet);
+ break;
+ } on FormatException catch (_) {
+ //_log('tried to parse subset $validSubSet');
+ //_log('error:\t$ex');
+ // I guess that won't parse
+ }
+
+ // TODO: other ways this could fail? Hmm...
+
+ validSubSet.removeLast();
+ }
+
+ return new Tuple(validSubSet, subsetResult);
+}
+
+List<String> _getArgsOptionCompletions(Option option) {
+ final items = new List<String>();
+
+ items.add('--${option.name}');
+
+ if (option.negatable) {
+ items.add('--no-${option.name}');
+ }
+
+ items.sort();
+
+ return items;
+}
diff --git a/completion/lib/src/try_completion.dart b/completion/lib/src/try_completion.dart
new file mode 100644
index 0000000..233b02b
--- /dev/null
+++ b/completion/lib/src/try_completion.dart
@@ -0,0 +1,104 @@
+import 'dart:io';
+
+import 'package:logging/logging.dart';
+import 'package:path/path.dart' as p;
+
+import 'bot.dart';
+import 'util.dart';
+
+/// The string 'completion' used to denote that arguments provided to an app are
+/// for command completion.
+///
+/// The expected arg format is: completion -- {process name} {rest of current
+/// args}
+const String completionCommandName = 'completion';
+
+const _compPointVar = 'COMP_POINT';
+
+void tryCompletion(
+ List<String> args,
+ List<String> completer(List<String> args, String compLine, int compPoint),
+ {@Deprecated('Useful for testing, but do not released with this set.')
+ logFile}) {
+ if (logFile != null) {
+ var logFile = new File('_completion.log');
+
+ void logLine(String content) {
+ logFile.writeAsStringSync('$content\n', mode: FileMode.writeOnlyAppend);
+ }
+
+ logLine(' *' * 50);
+
+ Logger.root.onRecord.listen((e) {
+ var loggerName = e.loggerName.split('.');
+ if (loggerName.isNotEmpty && loggerName.first == 'completion') {
+ loggerName.removeAt(0);
+ assert(e.level == Level.INFO);
+ logLine(
+ '${loggerName.join('.').padLeft(Tag.longestTagLength)} ${e.message}');
+ }
+ });
+ }
+
+ String scriptName;
+ try {
+ scriptName = p.basename(Platform.script.toFilePath());
+ } on UnsupportedError catch (e, stack) {
+ log(e);
+ log(stack);
+ return;
+ }
+
+ if (scriptName.isEmpty) {
+ // should have a script name...weird...
+ return;
+ }
+
+ log('Checking for completion on script:\t$scriptName');
+ if (args.length >= 3 && args[0] == completionCommandName && args[1] == '--') {
+ try {
+ log('Starting completion');
+ log('All args: $args');
+ log('completion-reported exe: ${args[2]}');
+
+ final env = Platform.environment;
+
+ // There are 3 interesting env paramaters passed by the completion logic
+ // COMP_LINE: the full contents of the completion
+ final compLine = env['COMP_LINE'];
+ require(compLine != null, 'Environment variable COMP_LINE must be set');
+
+ // COMP_CWORD: number of words. Also might be nice
+ // COMP_POINT: where the cursor is on the completion line
+ final compPointValue = env[_compPointVar];
+ require(compPointValue != null && compPointValue.isNotEmpty,
+ 'Environment variable $_compPointVar must be set and non-empty');
+ final compPoint = int.tryParse(compPointValue);
+
+ if (compPoint == null) {
+ throw new FormatException('Could not parse $_compPointVar value '
+ '"$compPointValue" into an integer');
+ }
+
+ final trimmedArgs = args.sublist(3);
+
+ log('input args: ${helpfulToString(trimmedArgs)}');
+
+ final completions = completer(trimmedArgs, compLine, compPoint);
+
+ log('completions: ${helpfulToString(completions)}');
+
+ for (final comp in completions) {
+ print(comp);
+ }
+ exit(0);
+ } catch (ex, stack) {
+ log('An error occurred while attemping completion');
+ log(ex);
+ log(stack);
+ exit(1);
+ }
+ }
+
+ log('Completion params not found');
+}
diff --git a/completion/lib/src/util.dart b/completion/lib/src/util.dart
new file mode 100644
index 0000000..4512df1
--- /dev/null
+++ b/completion/lib/src/util.dart
@@ -0,0 +1,47 @@
+import 'package:logging/logging.dart' as logging;
+
+class Tag {
+ static const getArgsCompletions = const Tag._('getArgsCompletions');
+
+ final String name;
+
+ const Tag._(this.name);
+
+ static int get longestTagLength => getArgsCompletions.name.length;
+}
+
+void log(Object o, [Tag tag]) {
+ String safe;
+
+ try {
+ safe = o.toString();
+ } catch (e, stack) {
+ safe = 'Error converting provided object $o into '
+ 'String\nException:\t$e\Stack:\t$stack';
+ }
+
+ final startArgs = ['completion'];
+ if (tag != null) {
+ startArgs.add(tag.name);
+ }
+
+ final loggerName = startArgs.join('.');
+
+ final logger = new logging.Logger(loggerName);
+
+ logger.info(safe);
+}
+
+String helpfulToString(Object input) {
+ if (input is Iterable) {
+ final items = input.map(helpfulToString).toList();
+
+ if (items.isEmpty) {
+ return '-empty-';
+ } else {
+ return "[${items.join(', ')}]";
+ }
+ }
+
+ return Error.safeToString(input);
+}
diff --git a/completion/pubspec.yaml b/completion/pubspec.yaml
new file mode 100644
index 0000000..1e46fb4
--- /dev/null
+++ b/completion/pubspec.yaml
@@ -0,0 +1,20 @@
+name: completion
+version: 0.2.0
+author: Kevin Moore <github@j832.com>
+description: A packaged to add shell command completion to your Dart application
+homepage: https://github.com/kevmoo/completion.dart
+
+environment:
+ sdk: '>=2.0.0-dev.54.0 <2.0.0'
+
+dependencies:
+ args: ^1.4.0
+ logging: ^0.11.0
+ path: ^1.0.0
+
+dev_dependencies:
+ test: ^1.2.0
+ test_process: ^1.0.1
+
+executables:
+ shell_completion_generator: null
diff --git a/crypto/.gitignore b/crypto/.gitignore
index 25a1df3..79f51c3 100644
--- a/crypto/.gitignore
+++ b/crypto/.gitignore
@@ -1,9 +1,3 @@
-.buildlog
-.DS_Store
-.idea
-.pub/
-.settings/
-build/
-packages
+.dart_tool
.packages
pubspec.lock
diff --git a/crypto/.status b/crypto/.status
deleted file mode 100644
index 059fb47..0000000
--- a/crypto/.status
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2015, 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.
-
-# Skip non-test files ending with "_test".
-packages/*: Skip
-*/packages/*: Skip
-*/*/packages/*: Skip
-*/*/*/packages/*: Skip
-*/*/*/*packages/*: Skip
-*/*/*/*/*packages/*: Skip
-
-test/sha1_test.dart: Pass, Slow
-test/sha256_test.dart: Pass, Slow
diff --git a/crypto/.travis.yml b/crypto/.travis.yml
index f433179..4681944 100644
--- a/crypto/.travis.yml
+++ b/crypto/.travis.yml
@@ -5,7 +5,7 @@
dart_task:
- test: -p vm
- - test: -p firefox
+ - test: -p firefox -j 1
- dartfmt
- dartanalyzer
diff --git a/crypto/BUILD.gn b/crypto/BUILD.gn
index 1aa207e..f1a33d1 100644
--- a/crypto/BUILD.gn
+++ b/crypto/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for crypto-2.0.5
+# This file is generated by importer.py for crypto-2.0.6
import("//build/dart/dart_library.gni")
diff --git a/crypto/analysis_options.yaml b/crypto/analysis_options.yaml
index 2592ade..5a0e83e 100644
--- a/crypto/analysis_options.yaml
+++ b/crypto/analysis_options.yaml
@@ -1,5 +1,3 @@
-analyzer:
- strong-mode: true
linter:
rules:
# Errors
diff --git a/crypto/codereview.settings b/crypto/codereview.settings
deleted file mode 100644
index 6a07542..0000000
--- a/crypto/codereview.settings
+++ /dev/null
@@ -1,3 +0,0 @@
-CODE_REVIEW_SERVER: http://codereview.chromium.org/
-VIEW_VC: https://github.com/dart-lang/crypto/commit/
-CC_LIST: reviews@dartlang.org
diff --git a/crypto/lib/src/hash_sink.dart b/crypto/lib/src/hash_sink.dart
index fde6b08..0a61e36 100644
--- a/crypto/lib/src/hash_sink.dart
+++ b/crypto/lib/src/hash_sink.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:typed_data';
-import 'dart:math' as math;
import 'package:typed_data/typed_data.dart';
diff --git a/crypto/pubspec.yaml b/crypto/pubspec.yaml
index ff8f0aa..2df720d 100644
--- a/crypto/pubspec.yaml
+++ b/crypto/pubspec.yaml
@@ -1,13 +1,13 @@
name: crypto
-version: 2.0.5
+version: 2.0.6
author: Dart Team <misc@dartlang.org>
description: Library of cryptographic functions.
homepage: https://www.github.com/dart-lang/crypto
environment:
- sdk: '>=2.0.0-dev.17.0 <2.0.0'
+ sdk: '>=2.0.0-dev.17.0 <3.0.0'
dependencies:
collection: '^1.0.0'
convert: '>=1.0.0 <3.0.0'
typed_data: '^1.0.0'
dev_dependencies:
- test: '^0.12.17'
+ test: ^1.0.0
diff --git a/fixnum/.gitignore b/fixnum/.gitignore
index 0dceb6e..49ce72d 100644
--- a/fixnum/.gitignore
+++ b/fixnum/.gitignore
@@ -1,7 +1,3 @@
-*.sw?
-.idea
-.pub
-build
-packages
+.dart_tool/
.packages
pubspec.lock
diff --git a/fixnum/.travis.yml b/fixnum/.travis.yml
index c2842f8..c22b630 100644
--- a/fixnum/.travis.yml
+++ b/fixnum/.travis.yml
@@ -1,20 +1,14 @@
language: dart
-sudo: false
dart:
- dev
- - stable
dart_task:
- test: --platform vm
xvfb: false
- test: --platform firefox -j 1
- - dartanalyzer --fatal-warnings
-
-matrix:
- include:
- - dart: stable
- dart_task: dartfmt
+ - dartanalyzer: --fatal-warnings .
+ - dartfmt
# Only building master means that we don't run two builds for each pull request.
branches:
diff --git a/fixnum/BUILD.gn b/fixnum/BUILD.gn
index 28f071d..0cb823b 100644
--- a/fixnum/BUILD.gn
+++ b/fixnum/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for fixnum-0.10.7
+# This file is generated by importer.py for fixnum-0.10.8
import("//build/dart/dart_library.gni")
diff --git a/fixnum/CHANGELOG.md b/fixnum/CHANGELOG.md
index 3a427ac..9c978a5 100644
--- a/fixnum/CHANGELOG.md
+++ b/fixnum/CHANGELOG.md
@@ -1,6 +1,10 @@
+## 0.10.8
+
+* Set SDK version constraint to `>=2.0.0-dev.65 <3.0.0`.
+
## 0.10.7
-* Bugfix: Make bitshifts work at bitwidth boundaries. Previously,
+* Bug fix: Make bit shifts work at bitwidth boundaries. Previously,
`new Int64(3) << 64 == Int64(3)`. This ensures that the result is 0 in such
cases.
* Updated maximum SDK constraint from 2.0.0-dev.infinity to 2.0.0.
diff --git a/fixnum/PATENTS b/fixnum/PATENTS
deleted file mode 100644
index 39b78ba..0000000
--- a/fixnum/PATENTS
+++ /dev/null
@@ -1,23 +0,0 @@
-Additional IP Rights Grant (Patents)
-
-"This implementation" means the copyrightable works distributed by
-Google as part of the Dart Project.
-
-Google hereby grants to you a perpetual, worldwide, non-exclusive,
-no-charge, royalty-free, irrevocable (except as stated in this
-section) patent license to make, have made, use, offer to sell, sell,
-import, transfer, and otherwise run, modify and propagate the contents
-of this implementation of Dart, where such license applies only to
-those patent claims, both currently owned by Google and acquired in
-the future, licensable by Google that are necessarily infringed by
-this implementation of Dart. This grant does not include claims that
-would be infringed only as a consequence of further modification of
-this implementation. If you or your agent or exclusive licensee
-institute or order or agree to the institution of patent litigation
-against any entity (including a cross-claim or counterclaim in a
-lawsuit) alleging that this implementation of Dart or any code
-incorporated within this implementation of Dart constitutes direct or
-contributory patent infringement, or inducement of patent
-infringement, then any patent rights granted to you under this License
-for this implementation of Dart shall terminate as of the date such
-litigation is filed.
\ No newline at end of file
diff --git a/fixnum/analysis_options.yaml b/fixnum/analysis_options.yaml
deleted file mode 100644
index a10d4c5..0000000
--- a/fixnum/analysis_options.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
diff --git a/fixnum/pubspec.yaml b/fixnum/pubspec.yaml
index d794eb1..d8f523d 100644
--- a/fixnum/pubspec.yaml
+++ b/fixnum/pubspec.yaml
@@ -1,9 +1,12 @@
name: fixnum
-version: 0.10.7
-author: Dart Team <misc@dartlang.org>
+version: 0.10.8
+
description: Library for 32- and 64-bit signed fixed-width integers.
+author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/fixnum
-dev_dependencies:
- test: ^0.12.0
+
environment:
- sdk: ">=1.8.3 <2.0.0"
+ sdk: '>=2.0.0-dev.65 <3.0.0'
+
+dev_dependencies:
+ test: ^1.2.0
diff --git a/http/BUILD.gn b/http/BUILD.gn
index 4123c66..6bf4fc0 100644
--- a/http/BUILD.gn
+++ b/http/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for http-0.11.3+16
+# This file is generated by importer.py for http-0.11.3+17
import("//build/dart/dart_library.gni")
diff --git a/http/CHANGELOG.md b/http/CHANGELOG.md
index b43beb1..8c1d1b0 100644
--- a/http/CHANGELOG.md
+++ b/http/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.11.3+17
+
+* Use new Dart 2 constant names. This branch is only for allowing existing
+ code to keep running under Dart 2.
+
## 0.11.3+16
* Stop depending on the `stack_trace` package.
diff --git a/http/lib/http.dart b/http/lib/http.dart
index 86bcefb..a40a4c2 100644
--- a/http/lib/http.dart
+++ b/http/lib/http.dart
@@ -61,7 +61,7 @@
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
-/// [encoding] defaults to [UTF8].
+/// [encoding] defaults to [utf8].
///
/// For more fine-grained control over the request, use [Request] or
/// [StreamedRequest] instead.
@@ -85,7 +85,7 @@
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
-/// [encoding] defaults to [UTF8].
+/// [encoding] defaults to [utf8].
///
/// For more fine-grained control over the request, use [Request] or
/// [StreamedRequest] instead.
@@ -109,7 +109,7 @@
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
-/// [encoding] defaults to [UTF8].
+/// [encoding] defaults to [utf8].
///
/// For more fine-grained control over the request, use [Request] or
/// [StreamedRequest] instead.
diff --git a/http/lib/src/byte_stream.dart b/http/lib/src/byte_stream.dart
index a9d47b0..fdfeb1a 100644
--- a/http/lib/src/byte_stream.dart
+++ b/http/lib/src/byte_stream.dart
@@ -28,9 +28,9 @@
/// Collect the data of this stream in a [String], decoded according to
/// [encoding], which defaults to `UTF8`.
- Future<String> bytesToString([Encoding encoding=UTF8]) =>
+ Future<String> bytesToString([Encoding encoding=utf8]) =>
encoding.decodeStream(this);
- Stream<String> toStringStream([Encoding encoding=UTF8]) =>
+ Stream<String> toStringStream([Encoding encoding=utf8]) =>
encoding.decoder.bind(this);
}
diff --git a/http/lib/src/client.dart b/http/lib/src/client.dart
index cf1ff78..3d7564b 100644
--- a/http/lib/src/client.dart
+++ b/http/lib/src/client.dart
@@ -56,7 +56,7 @@
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
- /// [encoding] defaults to [UTF8].
+ /// [encoding] defaults to [utf8].
///
/// For more fine-grained control over the request, use [send] instead.
Future<Response> post(url, {Map<String, String> headers, body,
@@ -77,7 +77,7 @@
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
- /// [encoding] defaults to [UTF8].
+ /// [encoding] defaults to [utf8].
///
/// For more fine-grained control over the request, use [send] instead.
Future<Response> put(url, {Map<String, String> headers, body,
@@ -98,7 +98,7 @@
/// content-type of the request will be set to
/// `"application/x-www-form-urlencoded"`; this cannot be overridden.
///
- /// [encoding] defaults to [UTF8].
+ /// [encoding] defaults to [utf8].
///
/// For more fine-grained control over the request, use [send] instead.
Future<Response> patch(url, {Map<String, String> headers, body,
diff --git a/http/lib/src/multipart_file.dart b/http/lib/src/multipart_file.dart
index da4bfac..3724c0b 100644
--- a/http/lib/src/multipart_file.dart
+++ b/http/lib/src/multipart_file.dart
@@ -70,7 +70,7 @@
{String filename, MediaType contentType}) {
contentType = contentType == null ? new MediaType("text", "plain")
: contentType;
- var encoding = encodingForCharset(contentType.parameters['charset'], UTF8);
+ var encoding = encodingForCharset(contentType.parameters['charset'], utf8);
contentType = contentType.change(parameters: {'charset': encoding.name});
return new MultipartFile.fromBytes(field, encoding.encode(value),
diff --git a/http/lib/src/multipart_request.dart b/http/lib/src/multipart_request.dart
index 8132f80..3a0fc07 100644
--- a/http/lib/src/multipart_request.dart
+++ b/http/lib/src/multipart_request.dart
@@ -61,13 +61,13 @@
fields.forEach((name, value) {
length += "--".length + _BOUNDARY_LENGTH + "\r\n".length +
- UTF8.encode(_headerForField(name, value)).length +
- UTF8.encode(value).length + "\r\n".length;
+ utf8.encode(_headerForField(name, value)).length +
+ utf8.encode(value).length + "\r\n".length;
});
for (var file in _files) {
length += "--".length + _BOUNDARY_LENGTH + "\r\n".length +
- UTF8.encode(_headerForFile(file)).length +
+ utf8.encode(_headerForFile(file)).length +
file.length + "\r\n".length;
}
@@ -90,10 +90,10 @@
var controller = new StreamController<List<int>>(sync: true);
void writeAscii(String string) {
- controller.add(UTF8.encode(string));
+ controller.add(utf8.encode(string));
}
- writeUtf8(String string) => controller.add(UTF8.encode(string));
+ writeUtf8(String string) => controller.add(utf8.encode(string));
writeLine() => controller.add([13, 10]); // \r\n
fields.forEach((name, value) {
diff --git a/http/lib/src/request.dart b/http/lib/src/request.dart
index 67b664c..2ede981 100644
--- a/http/lib/src/request.dart
+++ b/http/lib/src/request.dart
@@ -36,7 +36,7 @@
/// If the request has a `Content-Type` header and that header has a `charset`
/// parameter, that parameter's value is used as the encoding. Otherwise, if
/// [encoding] has been set manually, that encoding is used. If that hasn't
- /// been set either, this defaults to [UTF8].
+ /// been set either, this defaults to [utf8].
///
/// If the `charset` parameter's value is not a known [Encoding], reading this
/// will throw a [FormatException].
@@ -130,7 +130,7 @@
/// Creates a new HTTP request.
Request(String method, Uri url)
- : _defaultEncoding = UTF8,
+ : _defaultEncoding = utf8,
_bodyBytes = new Uint8List(0),
super(method, url);
diff --git a/http/lib/src/response.dart b/http/lib/src/response.dart
index 9fa06ee..33160ae 100644
--- a/http/lib/src/response.dart
+++ b/http/lib/src/response.dart
@@ -21,7 +21,7 @@
/// The body of the response as a string. This is converted from [bodyBytes]
/// using the `charset` parameter of the `Content-Type` header field, if
/// available. If it's unavailable or if the encoding name is unknown,
- /// [LATIN1] is used by default, as per [RFC 2616][].
+ /// [latin1] is used by default, as per [RFC 2616][].
///
/// [RFC 2616]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
String get body => _encodingForHeaders(headers).decode(bodyBytes);
@@ -80,7 +80,7 @@
}
/// Returns the encoding to use for a response with the given headers. This
-/// defaults to [LATIN1] if the headers don't specify a charset or
+/// defaults to [latin1] if the headers don't specify a charset or
/// if that charset is unknown.
Encoding _encodingForHeaders(Map<String, String> headers) =>
encodingForCharset(_contentTypeForHeaders(headers).parameters['charset']);
diff --git a/http/lib/src/utils.dart b/http/lib/src/utils.dart
index 789c2d9..3dd9526 100644
--- a/http/lib/src/utils.dart
+++ b/http/lib/src/utils.dart
@@ -40,7 +40,7 @@
/// Returns the [Encoding] that corresponds to [charset]. Returns [fallback] if
/// [charset] is null or if no [Encoding] was found that corresponds to
/// [charset].
-Encoding encodingForCharset(String charset, [Encoding fallback = LATIN1]) {
+Encoding encodingForCharset(String charset, [Encoding fallback = latin1]) {
if (charset == null) return fallback;
var encoding = Encoding.getByName(charset);
return encoding == null ? fallback : encoding;
diff --git a/http/lib/testing.dart b/http/lib/testing.dart
index d5a7874..d960f6e 100644
--- a/http/lib/testing.dart
+++ b/http/lib/testing.dart
@@ -16,7 +16,7 @@
/// return new Response("", 404);
/// }
/// return new Response(
-/// JSON.encode({
+/// json.encode({
/// 'numbers': [1, 4, 15, 19, 214]
/// }),
/// 200,
diff --git a/http/pubspec.yaml b/http/pubspec.yaml
index f3e584f..8adb27f 100644
--- a/http/pubspec.yaml
+++ b/http/pubspec.yaml
@@ -1,5 +1,5 @@
name: http
-version: 0.11.3+16
+version: 0.11.3+17
author: "Dart Team <misc@dartlang.org>"
homepage: https://github.com/dart-lang/http
description: A composable, Future-based API for making HTTP requests.
@@ -11,4 +11,4 @@
dev_dependencies:
unittest: ">=0.9.0 <0.12.0"
environment:
- sdk: ">=1.23.0 <2.0.0"
+ sdk: ">=2.0.0-dev.61.0 <3.0.0"
diff --git a/io/.gitignore b/io/.gitignore
index dd3394e..01d42c0 100644
--- a/io/.gitignore
+++ b/io/.gitignore
@@ -1,3 +1,4 @@
+.dart_tool/
.pub/
.packages
pubspec.lock
diff --git a/io/.travis.yml b/io/.travis.yml
index 205a404..8c87100 100644
--- a/io/.travis.yml
+++ b/io/.travis.yml
@@ -2,11 +2,10 @@
dart:
- dev
- - stable
dart_task:
- test
- - dartanalyzer
+ - dartanalyzer: --fatal-warnings --fatal-lints .
- dartfmt
# Only building master means that we don't run two builds for each pull request.
diff --git a/io/BUILD.gn b/io/BUILD.gn
index b28afd2..fc3a1a3 100644
--- a/io/BUILD.gn
+++ b/io/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for io-0.3.2+1
+# This file is generated by importer.py for io-0.3.3
import("//build/dart/dart_library.gni")
diff --git a/io/CHANGELOG.md b/io/CHANGELOG.md
index 93ca915..e8a1f70 100644
--- a/io/CHANGELOG.md
+++ b/io/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 0.3.3
+
+* Updates for Dart 2 constants. Require at least Dart `2.0.0-dev.54`.
+
+* Fix the type of `StartProcess` typedef to match `Process.start` from
+ `dart:io`.
+
## 0.3.2+1
* `ansi.dart`
diff --git a/io/lib/src/permissions.dart b/io/lib/src/permissions.dart
index d72afd2..4267ded 100644
--- a/io/lib/src/permissions.dart
+++ b/io/lib/src/permissions.dart
@@ -67,6 +67,6 @@
}
bool _isExecutable(FileStat stat) =>
- stat.type == FileSystemEntityType.FILE &&
+ stat.type == FileSystemEntityType.file &&
_FilePermissionRole.values.any(
(role) => _hasPermission(stat, _FilePermission.execute, role: role));
diff --git a/io/lib/src/process_manager.dart b/io/lib/src/process_manager.dart
index 5a14f58..d66790d 100644
--- a/io/lib/src/process_manager.dart
+++ b/io/lib/src/process_manager.dart
@@ -14,7 +14,7 @@
/// Useful for taking different implementations of this base functionality.
typedef Future<io.Process> StartProcess(
String executable,
- Iterable<String> arguments, {
+ List<String> arguments, {
String workingDirectory,
Map<String, String> environment,
bool includeParentEnvironment,
@@ -71,7 +71,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- io.ProcessStartMode mode: io.ProcessStartMode.NORMAL,
+ io.ProcessStartMode mode: io.ProcessStartMode.normal,
}) async {
final process = io.Process.start(
executable,
@@ -99,7 +99,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- io.ProcessStartMode mode: io.ProcessStartMode.NORMAL,
+ io.ProcessStartMode mode: io.ProcessStartMode.normal,
}) async {
final process = io.Process.start(
executable,
@@ -130,7 +130,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- io.ProcessStartMode mode: io.ProcessStartMode.NORMAL,
+ io.ProcessStartMode mode: io.ProcessStartMode.normal,
}) async {
return io.Process.start(
executable,
@@ -159,7 +159,7 @@
void _onClosed() {}
@override
- bool kill([io.ProcessSignal signal = io.ProcessSignal.SIGTERM]) =>
+ bool kill([io.ProcessSignal signal = io.ProcessSignal.sigterm]) =>
_delegate.kill(signal);
@override
@@ -220,8 +220,7 @@
this._stdErrSub,
this._stdOut,
this._stdErr,
- )
- : super._(delegate);
+ ) : super._(delegate);
@override
void _onClosed() {
@@ -243,8 +242,7 @@
Stream<List<int>> stdin,
io.IOSink stdout,
io.IOSink stderr,
- )
- : super._(
+ ) : super._(
stdin,
stdout,
stderr,
@@ -256,8 +254,7 @@
Stream<List<int>> stdin,
io.IOSink stdout,
io.IOSink stderr,
- )
- : super._(
+ ) : super._(
stdin,
stdout,
stderr,
diff --git a/io/lib/src/shared_stdin.dart b/io/lib/src/shared_stdin.dart
index 23b3d50..bd71027 100644
--- a/io/lib/src/shared_stdin.dart
+++ b/io/lib/src/shared_stdin.dart
@@ -36,7 +36,7 @@
/// Returns a future that completes with the next line.
///
/// This is similar to the standard [Stdin.readLineSync], but asynchronous.
- Future<String> nextLine({Encoding encoding: SYSTEM_ENCODING}) {
+ Future<String> nextLine({Encoding encoding: systemEncoding}) {
return lines(encoding: encoding).first;
}
@@ -51,8 +51,8 @@
/// ```
///
/// ... but asynchronous.
- Stream<String> lines({Encoding encoding: SYSTEM_ENCODING}) {
- return transform(UTF8.decoder).transform(const LineSplitter());
+ Stream<String> lines({Encoding encoding: systemEncoding}) {
+ return transform(utf8.decoder).transform(const LineSplitter());
}
void _onInput(List<int> event) => _getCurrent().add(event);
diff --git a/io/pubspec.yaml b/io/pubspec.yaml
index 0e2818e..8089bb3 100644
--- a/io/pubspec.yaml
+++ b/io/pubspec.yaml
@@ -1,12 +1,12 @@
name: io
description: >
Utilities for the Dart VM Runtime.
-version: 0.3.2+1
+version: 0.3.3
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/io
environment:
- sdk: ">=1.22.0 <2.0.0"
+ sdk: ">=2.0.0-dev.54 <3.0.0"
dependencies:
charcode: ^1.0.0
@@ -16,5 +16,5 @@
dev_dependencies:
dart_style: ^1.0.7
- test: ^0.12.0
+ test: ^1.0.0
test_descriptor: ^1.0.0
diff --git a/shelf/BUILD.gn b/shelf/BUILD.gn
index da46724..6e622f4 100644
--- a/shelf/BUILD.gn
+++ b/shelf/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for shelf-0.7.3+1
+# This file is generated by importer.py for shelf-0.7.3+2
import("//build/dart/dart_library.gni")
diff --git a/shelf/CHANGELOG.md b/shelf/CHANGELOG.md
index bb3c05f..8a3240c 100644
--- a/shelf/CHANGELOG.md
+++ b/shelf/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.7.3+2
+
+* Fix constant evaluation analyzer error in `shelf_unmodifiable_map.dart`.
+
+* Update usage of HTTP constants from the Dart SDK. Now require 2.0.0-dev.61.
+
## 0.7.3+1
* Updated SDK version to 2.0.0-dev.55.0.
diff --git a/shelf/analysis_options.yaml b/shelf/analysis_options.yaml
index 3d7fdea..2b0a49b 100644
--- a/shelf/analysis_options.yaml
+++ b/shelf/analysis_options.yaml
@@ -1,5 +1,3 @@
-analyzer:
- strong-mode: true
linter:
rules:
- avoid_empty_else
diff --git a/shelf/lib/shelf_io.dart b/shelf/lib/shelf_io.dart
index cf457be..956e7ff 100644
--- a/shelf/lib/shelf_io.dart
+++ b/shelf/lib/shelf_io.dart
@@ -125,7 +125,7 @@
});
// Remove the Transfer-Encoding header per the adapter requirements.
- headers.remove(HttpHeaders.TRANSFER_ENCODING);
+ headers.remove(HttpHeaders.transferEncodingHeader);
void onHijack(void callback(StreamChannel<List<int>> channel)) {
request.response
@@ -167,7 +167,7 @@
// TODO(nweiz): Do this more cleanly when sdk#27886 is fixed.
response =
response.change(body: chunkedCoding.decoder.bind(response.read()));
- httpResponse.headers.set(HttpHeaders.TRANSFER_ENCODING, 'chunked');
+ httpResponse.headers.set(HttpHeaders.transferEncodingHeader, 'chunked');
} else if (response.statusCode >= 200 &&
response.statusCode != 204 &&
response.statusCode != 304 &&
@@ -175,14 +175,14 @@
response.mimeType != 'multipart/byteranges') {
// If the response isn't chunked yet and there's no other way to tell its
// length, enable `dart:io`'s chunked encoding.
- httpResponse.headers.set(HttpHeaders.TRANSFER_ENCODING, 'chunked');
+ httpResponse.headers.set(HttpHeaders.transferEncodingHeader, 'chunked');
}
- if (!response.headers.containsKey(HttpHeaders.SERVER)) {
- httpResponse.headers.set(HttpHeaders.SERVER, 'dart:io with Shelf');
+ if (!response.headers.containsKey(HttpHeaders.serverHeader)) {
+ httpResponse.headers.set(HttpHeaders.serverHeader, 'dart:io with Shelf');
}
- if (!response.headers.containsKey(HttpHeaders.DATE)) {
+ if (!response.headers.containsKey(HttpHeaders.dateHeader)) {
httpResponse.headers.date = new DateTime.now().toUtc();
}
diff --git a/shelf/lib/src/shelf_unmodifiable_map.dart b/shelf/lib/src/shelf_unmodifiable_map.dart
index 3e1d14f..d6a5c00 100644
--- a/shelf/lib/src/shelf_unmodifiable_map.dart
+++ b/shelf/lib/src/shelf_unmodifiable_map.dart
@@ -54,7 +54,7 @@
class _EmptyShelfUnmodifiableMap<V> extends MapView<String, V>
implements ShelfUnmodifiableMap<V> {
bool get _ignoreKeyCase => true;
- const _EmptyShelfUnmodifiableMap() : super(const {});
+ const _EmptyShelfUnmodifiableMap() : super(const <String, Null>{});
// Override modifier methods that care about the type of key they use so that
// when V is Null, they throw UnsupportedErrors instead of type errors.
diff --git a/shelf/pubspec.yaml b/shelf/pubspec.yaml
index cae569b..74c78ab 100644
--- a/shelf/pubspec.yaml
+++ b/shelf/pubspec.yaml
@@ -1,10 +1,10 @@
name: shelf
-version: 0.7.3+1
+version: 0.7.3+2
author: Dart Team <misc@dartlang.org>
description: Web Server Middleware for Dart
homepage: https://github.com/dart-lang/shelf
environment:
- sdk: '>=2.0.0-dev.55.0 <2.0.0'
+ sdk: '>=2.0.0-dev.61.0 <2.0.0'
dependencies:
async: '>=1.10.0 <3.0.0'
collection: '^1.5.0'
@@ -14,4 +14,4 @@
stream_channel: '^1.0.0'
dev_dependencies:
http: '>=0.9.2 <0.12.0'
- test: '^0.12.20'
+ test: '^1.2.0'
diff --git a/shelf_static/.gitignore b/shelf_static/.gitignore
index 9bd4f34..f73b2f9 100644
--- a/shelf_static/.gitignore
+++ b/shelf_static/.gitignore
@@ -1,4 +1,4 @@
-packages
-pubspec.lock
-/.pub
+.dart_tool/
.packages
+.pub/
+pubspec.lock
diff --git a/shelf_static/BUILD.gn b/shelf_static/BUILD.gn
index 971553d..f26ff78 100644
--- a/shelf_static/BUILD.gn
+++ b/shelf_static/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for shelf_static-0.2.7+1
+# This file is generated by importer.py for shelf_static-0.2.8
import("//build/dart/dart_library.gni")
diff --git a/shelf_static/CHANGELOG.md b/shelf_static/CHANGELOG.md
index 2372584..85a3c27 100644
--- a/shelf_static/CHANGELOG.md
+++ b/shelf_static/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.2.8
+
+* Update SDK constraint to `>=2.0.0-dev.61 <3.0.0`.
+
+* Directory listings are now sorted.
+
## 0.2.7+1
* Updated SDK version to 2.0.0-dev.17.0
diff --git a/shelf_static/analysis_options.yaml b/shelf_static/analysis_options.yaml
deleted file mode 100644
index a10d4c5..0000000
--- a/shelf_static/analysis_options.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
diff --git a/shelf_static/example/files/favicon.ico b/shelf_static/example/files/favicon.ico
index e605972..93b0890 100644
--- a/shelf_static/example/files/favicon.ico
+++ b/shelf_static/example/files/favicon.ico
Binary files differ
diff --git a/shelf_static/lib/src/directory_listing.dart b/shelf_static/lib/src/directory_listing.dart
index a391a52..a598243 100644
--- a/shelf_static/lib/src/directory_listing.dart
+++ b/shelf_static/lib/src/directory_listing.dart
@@ -23,37 +23,21 @@
font-family: sans-serif;
}
h1 {
- background-color: #607D8B;
- box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
+ background-color: #4078c0;
color: white;
- font-size: 56px;
font-weight: normal;
- line-height: 1.5;
- margin: 0;
- padding: 115px 30px 56px 30px;
+ margin: 0 0 10px 0;
+ padding: 16px 32px;
white-space: nowrap;
}
ul {
- list-style-type: none;
margin: 0;
- padding: 0;
}
li {
- margin: 0;
padding: 0;
}
a {
- color: #212121;
- text-decoration: none;
- display: block;
- font-size: 16px;
- height: 48px;
- line-height: 48px;
- padding-left: 16px;
- transition: background-color 200ms ease-in-out;
- }
- a:hover {
- background-color: #EEEEEE;
+ line-height: 1.4em;
}
</style>
</head>
@@ -85,15 +69,31 @@
}
add(_getHeader(sanitizer.convert(heading)));
- new Directory(dirPath).list().listen((FileSystemEntity entity) {
- String name = path.relative(entity.path, from: dirPath);
- if (entity is Directory) name += '/';
- String sanitizedName = sanitizer.convert(name);
- add(' <li><a href="$sanitizedName">$sanitizedName</a></li>\n');
- }, onDone: () {
+
+ // Return a sorted listing of the directory contents asynchronously.
+ new Directory(dirPath).list().toList().then((entities) {
+ entities.sort((e1, e2) {
+ if (e1 is Directory && e2 is! Directory) {
+ return -1;
+ }
+ if (e1 is! Directory && e2 is Directory) {
+ return 1;
+ }
+ return e1.path.compareTo(e2.path);
+ });
+
+ for (var entity in entities) {
+ String name = path.relative(entity.path, from: dirPath);
+ if (entity is Directory) name += '/';
+ String sanitizedName = sanitizer.convert(name);
+ add(' <li><a href="$sanitizedName">$sanitizedName</a></li>\n');
+ }
+
add(_trailer);
controller.close();
});
+
return new Response.ok(controller.stream,
- encoding: encoding, headers: {HttpHeaders.CONTENT_TYPE: 'text/html'});
+ encoding: encoding,
+ headers: {HttpHeaders.contentTypeHeader: 'text/html'});
}
diff --git a/shelf_static/lib/src/static_handler.dart b/shelf_static/lib/src/static_handler.dart
index afd42c8..b6131ea 100644
--- a/shelf_static/lib/src/static_handler.dart
+++ b/shelf_static/lib/src/static_handler.dart
@@ -189,12 +189,12 @@
}
var headers = {
- HttpHeaders.CONTENT_LENGTH: stat.size.toString(),
- HttpHeaders.LAST_MODIFIED: formatHttpDate(stat.changed)
+ HttpHeaders.contentLengthHeader: stat.size.toString(),
+ HttpHeaders.lastModifiedHeader: formatHttpDate(stat.changed)
};
var contentType = await getContentType();
- if (contentType != null) headers[HttpHeaders.CONTENT_TYPE] = contentType;
+ if (contentType != null) headers[HttpHeaders.contentTypeHeader] = contentType;
return new Response.ok(file.openRead(), headers: headers);
}
diff --git a/shelf_static/pubspec.yaml b/shelf_static/pubspec.yaml
index 8a8ec3b..b105264 100644
--- a/shelf_static/pubspec.yaml
+++ b/shelf_static/pubspec.yaml
@@ -1,10 +1,10 @@
name: shelf_static
-version: 0.2.7+1
+version: 0.2.8
author: Dart Team <misc@dartlang.org>
description: Static file server support for Shelf
homepage: https://github.com/dart-lang/shelf_static
environment:
- sdk: '>=2.0.0-dev.55.0 <2.0.0'
+ sdk: '>=2.0.0-dev.61.0 <3.0.0'
dependencies:
convert: '>=1.0.0 <3.0.0'
http_parser: '>=0.0.2+2 <4.0.0'
@@ -13,6 +13,6 @@
shelf: '>=0.5.7 <0.8.0'
dev_dependencies:
args: '^1.0.0'
- test: '>=0.12.0 <0.13.0'
+ test: '^1.2.0'
test_descriptor: '^1.0.0'
diff --git a/url_launcher/BUILD.gn b/url_launcher/BUILD.gn
index 5721320..408cfcc 100644
--- a/url_launcher/BUILD.gn
+++ b/url_launcher/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for url_launcher-3.0.2
+# This file is generated by importer.py for url_launcher-3.0.3
import("//build/dart/dart_library.gni")
diff --git a/url_launcher/CHANGELOG.md b/url_launcher/CHANGELOG.md
index 2d6a124..cf15fc6 100644
--- a/url_launcher/CHANGELOG.md
+++ b/url_launcher/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 3.0.3
+
+* Added statusBarBrightness field to `launch` to set iOS status bar brightness.
+
## 3.0.2
* Updated Gradle tooling to match Android Studio 3.1.2.
diff --git a/url_launcher/ios/Classes/UrlLauncherPlugin.m b/url_launcher/ios/Classes/UrlLauncherPlugin.m
index eeee84c..2c332ba 100644
--- a/url_launcher/ios/Classes/UrlLauncherPlugin.m
+++ b/url_launcher/ios/Classes/UrlLauncherPlugin.m
@@ -7,6 +7,7 @@
#import "UrlLauncherPlugin.h"
@interface FLTUrlLaunchSession : NSObject<SFSafariViewControllerDelegate>
+@property(nonatomic) UIStatusBarStyle previousStatusBarStyle;
@end
@implementation FLTUrlLaunchSession {
@@ -25,6 +26,10 @@
- (void)safariViewController:(SFSafariViewController *)controller
didCompleteInitialLoad:(BOOL)didLoadSuccessfully {
+ if (_previousStatusBarStyle != nil) {
+ UIApplication *application = [UIApplication sharedApplication];
+ application.statusBarStyle = _previousStatusBarStyle;
+ }
if (didLoadSuccessfully) {
_flutterResult(nil);
} else {
@@ -44,6 +49,7 @@
@implementation FLTUrlLauncherPlugin {
UIViewController *_viewController;
FLTUrlLaunchSession *_currentSession;
+ UIStatusBarStyle _previousStatusBarStyle;
}
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
@@ -71,6 +77,14 @@
result(@([self canLaunchURL:url]));
} else if ([@"launch" isEqualToString:call.method]) {
NSNumber *useSafariVC = call.arguments[@"useSafariVC"];
+ NSString *brightness = call.arguments[@"statusBarBrightness"];
+ UIApplication *application = [UIApplication sharedApplication];
+ _previousStatusBarStyle = application.statusBarStyle;
+ if ([brightness isEqualToString:@"Brightness.light"]) {
+ application.statusBarStyle = UIStatusBarStyleDefault;
+ } else if ([brightness isEqualToString:@"Brightness.dark"]) {
+ application.statusBarStyle = UIStatusBarStyleLightContent;
+ }
if (useSafariVC.boolValue) {
[self launchURLInVC:url result:result];
} else {
@@ -94,6 +108,10 @@
[application openURL:url
options:@{}
completionHandler:^(BOOL success) {
+ if (self->_previousStatusBarStyle != nil) {
+ UIApplication *application = [UIApplication sharedApplication];
+ application.statusBarStyle = self->_previousStatusBarStyle;
+ }
if (success) {
result(nil);
} else {
@@ -121,6 +139,7 @@
SFSafariViewController *safari = [[SFSafariViewController alloc] initWithURL:url];
_currentSession = [[FLTUrlLaunchSession alloc] initWithUrl:url withFlutterResult:result];
+ _currentSession.previousStatusBarStyle = _previousStatusBarStyle;
safari.delegate = _currentSession;
[_viewController presentViewController:safari animated:YES completion:nil];
}
diff --git a/url_launcher/lib/url_launcher.dart b/url_launcher/lib/url_launcher.dart
index 13483fa..1b50093 100644
--- a/url_launcher/lib/url_launcher.dart
+++ b/url_launcher/lib/url_launcher.dart
@@ -30,10 +30,17 @@
///
/// Note that if any of the above are set to true but the URL is not a web URL,
/// this will throw a [PlatformException].
+///
+/// [statusBarBrightness] is only used in iOS. Sets the status bar brightness
+/// of the application after opening a link. The previous value of the status
+/// bar is stored on the platform side and restored when returning to Flutter
+/// if used with `forceSafariVC` or on iOS version 10.0 and greater. Defaults
+/// to [Brightness.light] if unset, or does nothing if null is passed.
Future<void> launch(
String urlString, {
bool forceSafariVC,
bool forceWebView,
+ Brightness statusBarBrightness = Brightness.light,
}) {
assert(urlString != null);
final Uri url = Uri.parse(urlString.trimLeft());
@@ -50,6 +57,7 @@
'url': urlString,
'useSafariVC': forceSafariVC ?? isWebURL,
'useWebView': forceWebView ?? false,
+ 'statusBarBrightness': statusBarBrightness?.toString(),
},
);
}
diff --git a/url_launcher/pubspec.yaml b/url_launcher/pubspec.yaml
index 8b2a7f8..f502ee1 100644
--- a/url_launcher/pubspec.yaml
+++ b/url_launcher/pubspec.yaml
@@ -3,7 +3,7 @@
web, phone, SMS, and email schemes.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher
-version: 3.0.2
+version: 3.0.3
flutter:
plugin:
diff --git a/vm_service_client/.analysis_options b/vm_service_client/.analysis_options
deleted file mode 100644
index a10d4c5..0000000
--- a/vm_service_client/.analysis_options
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
diff --git a/vm_service_client/.gitignore b/vm_service_client/.gitignore
index 25a1df3..efbbce1 100644
--- a/vm_service_client/.gitignore
+++ b/vm_service_client/.gitignore
@@ -1,6 +1,7 @@
.buildlog
.DS_Store
.idea
+.dart_tool/
.pub/
.settings/
build/
diff --git a/vm_service_client/.travis.yml b/vm_service_client/.travis.yml
new file mode 100644
index 0000000..9febf48
--- /dev/null
+++ b/vm_service_client/.travis.yml
@@ -0,0 +1,18 @@
+language: dart
+
+dart:
+ - dev
+
+dart_task:
+ # Tests are not passing at the moment – investigating
+ #- test
+ - dartanalyzer
+ - dartfmt
+
+# Only building master means that we don't run two builds for each pull request.
+branches:
+ only: [master]
+
+cache:
+ directories:
+ - $HOME/.pub-cache
diff --git a/vm_service_client/BUILD.gn b/vm_service_client/BUILD.gn
index 4ffcfa5..af60c9e 100644
--- a/vm_service_client/BUILD.gn
+++ b/vm_service_client/BUILD.gn
@@ -1,4 +1,4 @@
-# This file is generated by importer.py for vm_service_client-0.2.4+3
+# This file is generated by importer.py for vm_service_client-0.2.5
import("//build/dart/dart_library.gni")
diff --git a/vm_service_client/CHANGELOG.md b/vm_service_client/CHANGELOG.md
index a2e60f6..353b467 100644
--- a/vm_service_client/CHANGELOG.md
+++ b/vm_service_client/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.2.5
+
+* Update usage of SDK constants.
+
+* Increase minimum Dart SDK to `2.0.0-dev.58.0`.
+
## 0.2.4+3
* Fix more Dart 2 runtime issues.
diff --git a/vm_service_client/lib/src/breakpoint.dart b/vm_service_client/lib/src/breakpoint.dart
index ec42f19..f1cc163 100644
--- a/vm_service_client/lib/src/breakpoint.dart
+++ b/vm_service_client/lib/src/breakpoint.dart
@@ -77,18 +77,18 @@
///
/// If the breakpoint is already removed, this will complete immediately.
Future get onRemove => _onRemoveMemo.runOnce(() async {
- await _scope.getInState(_scope.streams.debug, () async {
- try {
- await load();
- return false;
- } on VMSentinelException catch (_) {
- return true;
- }
- }, (json) {
- return json["kind"] == "BreakpointRemoved" &&
- json["breakpoint"]["id"] == _id;
- });
- });
+ await _scope.getInState(_scope.streams.debug, () async {
+ try {
+ await load();
+ return false;
+ } on VMSentinelException catch (_) {
+ return true;
+ }
+ }, (json) {
+ return json["kind"] == "BreakpointRemoved" &&
+ json["breakpoint"]["id"] == _id;
+ });
+ });
final _onRemoveMemo = new AsyncMemoizer();
VMBreakpoint._(Scope scope, Map json)
@@ -114,7 +114,8 @@
static VMBreakpointLocation _newVMBreakpointLocation(Scope scope, Map json) {
if (json == null) return null;
switch (json["type"]) {
- case "SourceLocation": return newVMSourceLocation(scope, json);
+ case "SourceLocation":
+ return newVMSourceLocation(scope, json);
case "UnresolvedSourceLocation":
return newVMUnresolvedSourceLocation(scope, json);
default:
@@ -153,8 +154,8 @@
Future remove() =>
_scope.sendRequest("removeBreakpoint", {"breakpointId": _id});
- bool operator ==(other) => other is VMBreakpoint &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMBreakpoint && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -165,8 +166,7 @@
class VMResolvedBreakpoint extends VMBreakpoint {
VMSourceLocation get location => super.location as VMSourceLocation;
- VMResolvedBreakpoint._(Scope scope, Map json)
- : super._(scope, json) {
+ VMResolvedBreakpoint._(Scope scope, Map json) : super._(scope, json) {
assert(super.location is VMSourceLocation);
}
diff --git a/vm_service_client/lib/src/class.dart b/vm_service_client/lib/src/class.dart
index 8e2f672..d6bb88e 100644
--- a/vm_service_client/lib/src/class.dart
+++ b/vm_service_client/lib/src/class.dart
@@ -41,8 +41,8 @@
_fixedId = json["fixedId"] ?? false,
name = json["name"];
- Future<VMClass> load() async => new VMClass._(
- _scope, await _scope.loadObject(_id));
+ Future<VMClass> load() async =>
+ new VMClass._(_scope, await _scope.loadObject(_id));
/// Evaluates [expression] in the context of this class.
///
@@ -50,8 +50,8 @@
Future<VMInstanceRef> evaluate(String expression) =>
_scope.evaluate(_id, expression);
- bool operator ==(other) => other is VMClassRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMClassRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -109,16 +109,15 @@
library = newVMLibraryRef(scope, json["library"]),
location = newVMSourceLocation(scope, json["location"]),
superclass = newVMClassRef(scope, json["super"]),
- interfaces = new List.unmodifiable(json["interfaces"]
- .map((interfaceJson) =>
- newVMTypeInstanceRef(scope, interfaceJson))),
+ interfaces = new List.unmodifiable(json["interfaces"].map(
+ (interfaceJson) => newVMTypeInstanceRef(scope, interfaceJson))),
fields = new UnmodifiableMapView(new Map.fromIterable(json["fields"],
key: (field) => field["name"],
value: (field) => newVMFieldRef(scope, field))),
- functions = new UnmodifiableMapView(
- new Map.fromIterable(json["functions"],
- key: (function) => function["name"],
- value: (function) => newVMFunctionRef(scope, function))),
+ functions = new UnmodifiableMapView(new Map.fromIterable(
+ json["functions"],
+ key: (function) => function["name"],
+ value: (function) => newVMFunctionRef(scope, function))),
subclasses = new List.unmodifiable(json["subclasses"]
.map((subclass) => newVMClassRef(scope, subclass))),
super._(scope, json);
diff --git a/vm_service_client/lib/src/code.dart b/vm_service_client/lib/src/code.dart
index e2019e3..ba7a110 100644
--- a/vm_service_client/lib/src/code.dart
+++ b/vm_service_client/lib/src/code.dart
@@ -42,8 +42,8 @@
Future<VMCode> load() async =>
new VMCode._(_scope, await _scope.loadObject(_id));
- bool operator ==(other) => other is VMCodeRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMCodeRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -87,12 +87,18 @@
factory VMCodeKind._parse(String name) {
switch (name) {
- case "Dart": return VMCodeKind.dart;
- case "Native": return VMCodeKind.native;
- case "Stub": return VMCodeKind.stub;
- case "Tag": return VMCodeKind.tag;
- case "Collected": return VMCodeKind.collected;
- default: throw new StateError("Unknown VM code kind \"$name\".");
+ case "Dart":
+ return VMCodeKind.dart;
+ case "Native":
+ return VMCodeKind.native;
+ case "Stub":
+ return VMCodeKind.stub;
+ case "Tag":
+ return VMCodeKind.tag;
+ case "Collected":
+ return VMCodeKind.collected;
+ default:
+ throw new StateError("Unknown VM code kind \"$name\".");
}
}
diff --git a/vm_service_client/lib/src/context.dart b/vm_service_client/lib/src/context.dart
index d360896..637bf64 100644
--- a/vm_service_client/lib/src/context.dart
+++ b/vm_service_client/lib/src/context.dart
@@ -40,8 +40,8 @@
Future<VMContext> load() async =>
new VMContext._(_scope, await _scope.loadObject(_id));
- bool operator ==(other) => other is VMContextRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMContextRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
}
@@ -64,8 +64,7 @@
: size = json["size"],
klass = newVMClassRef(scope, json["class"]),
parent = newVMContextRef(scope, json["parent"]),
- variables = new List.unmodifiable(json["variables"]
- .map((variable) =>
- newVMInstanceRefOrSentinel(scope, variable["value"]))),
+ variables = new List.unmodifiable(json["variables"].map((variable) =>
+ newVMInstanceRefOrSentinel(scope, variable["value"]))),
super._(scope, json);
}
diff --git a/vm_service_client/lib/src/error.dart b/vm_service_client/lib/src/error.dart
index ef1515b..abf0487 100644
--- a/vm_service_client/lib/src/error.dart
+++ b/vm_service_client/lib/src/error.dart
@@ -51,8 +51,8 @@
Future<VMError> load() async =>
new VMError._(_scope, await _scope.loadObject(_id));
- bool operator ==(other) => other is VMErrorRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMErrorRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -128,11 +128,16 @@
/// Parses the error from its service protocol name.
factory VMErrorKind._parse(String name) {
switch (name) {
- case "UnhandledException": return VMErrorKind.unhandledException;
- case "LanguageError": return VMErrorKind.languageError;
- case "InternalError": return VMErrorKind.internalError;
- case "TerminationError": return VMErrorKind.terminationError;
- default: throw new StateError("Unknown VM error kind \"$name\".");
+ case "UnhandledException":
+ return VMErrorKind.unhandledException;
+ case "LanguageError":
+ return VMErrorKind.languageError;
+ case "InternalError":
+ return VMErrorKind.internalError;
+ case "TerminationError":
+ return VMErrorKind.terminationError;
+ default:
+ throw new StateError("Unknown VM error kind \"$name\".");
}
}
diff --git a/vm_service_client/lib/src/field.dart b/vm_service_client/lib/src/field.dart
index 165ed2e..f5bf1f6 100644
--- a/vm_service_client/lib/src/field.dart
+++ b/vm_service_client/lib/src/field.dart
@@ -84,8 +84,10 @@
static VMObjectRef _newLibraryOrClassRef(Scope scope, Map json) {
if (json == null) return null;
switch (json["type"]) {
- case "@Library": return newVMLibraryRef(scope, json);
- case "@Class": return newVMClassRef(scope, json);
+ case "@Library":
+ return newVMLibraryRef(scope, json);
+ case "@Class":
+ return newVMClassRef(scope, json);
default:
throw new StateError('Unexpected Object type "${json["type"]}".');
}
@@ -94,8 +96,8 @@
Future<VMField> load() async =>
new VMField._(_scope, await _scope.loadObject(_id));
- bool operator ==(other) => other is VMFieldRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMFieldRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
diff --git a/vm_service_client/lib/src/flag.dart b/vm_service_client/lib/src/flag.dart
index 0280d9e..d3a69f4 100644
--- a/vm_service_client/lib/src/flag.dart
+++ b/vm_service_client/lib/src/flag.dart
@@ -14,7 +14,7 @@
class _FlagList extends DelegatingList<VMFlag> {
_FlagList(Map json)
: super(
- (json["flags"] as List).map((flag) => new VMFlag._(flag)).toList());
+ (json["flags"] as List).map((flag) => new VMFlag._(flag)).toList());
String toString() {
return "[" + super.where((flag) => flag.modified).join(", ") + ", ...]";
diff --git a/vm_service_client/lib/src/frame.dart b/vm_service_client/lib/src/frame.dart
index d1e9d6e..7a0c3ff 100644
--- a/vm_service_client/lib/src/frame.dart
+++ b/vm_service_client/lib/src/frame.dart
@@ -59,14 +59,14 @@
/// Throws a [VMErrorException] if evaluating the expression throws an error.
/// Throws a [VMSentinelException] if this frame has expired.
Future<VMInstanceRef> evaluate(String expression) async {
- var result = await _scope.sendRequest("evaluateInFrame", {
- "frameIndex": index,
- "expression": expression
- });
+ var result = await _scope.sendRequest(
+ "evaluateInFrame", {"frameIndex": index, "expression": expression});
switch (result["type"]) {
- case "@Error": throw new VMErrorException(newVMErrorRef(_scope, result));
- case "@Instance": return newVMInstanceRef(_scope, result);
+ case "@Error":
+ throw new VMErrorException(newVMErrorRef(_scope, result));
+ case "@Instance":
+ return newVMInstanceRef(_scope, result);
default:
throw new StateError('Unexpected Object type "${result["type"]}".');
}
@@ -97,4 +97,3 @@
String toString() => "var $name = $value";
}
-
diff --git a/vm_service_client/lib/src/function.dart b/vm_service_client/lib/src/function.dart
index b5bf69c..52128a1 100644
--- a/vm_service_client/lib/src/function.dart
+++ b/vm_service_client/lib/src/function.dart
@@ -61,10 +61,14 @@
static VMObjectRef _owner(Scope scope, Map json) {
if (json == null) return null;
switch (json["type"]) {
- case "@Library": return newVMLibraryRef(scope, json);
- case "@Class": return newVMClassRef(scope, json);
- case "@Function": return newVMFunctionRef(scope, json);
- default: throw new StateError('Unknown owner type "${json["type"]}".');
+ case "@Library":
+ return newVMLibraryRef(scope, json);
+ case "@Class":
+ return newVMClassRef(scope, json);
+ case "@Function":
+ return newVMFunctionRef(scope, json);
+ default:
+ throw new StateError('Unknown owner type "${json["type"]}".');
}
}
@@ -77,8 +81,8 @@
/// [rpc.RpcException] with code `102`.
Future<VMBreakpoint> addBreakpoint() async {
try {
- var response = await _scope.sendRequest(
- "addBreakpointAtEntry", {"functionId": _id});
+ var response =
+ await _scope.sendRequest("addBreakpointAtEntry", {"functionId": _id});
return newVMBreakpoint(_scope, response);
} on rpc.RpcException catch (error) {
// Error 102 indicates that the breakpoint couldn't be created.
@@ -87,8 +91,8 @@
}
}
- bool operator ==(other) => other is VMFunctionRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMFunctionRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
diff --git a/vm_service_client/lib/src/instance.dart b/vm_service_client/lib/src/instance.dart
index 5a92be9..e27df49 100644
--- a/vm_service_client/lib/src/instance.dart
+++ b/vm_service_client/lib/src/instance.dart
@@ -25,17 +25,28 @@
if (json == null) return null;
assert(json["type"] == "@Instance" || json["type"] == "Instance");
switch (json["kind"]) {
- case "Null": return new VMNullInstanceRef._(scope, json);
- case "Bool": return new VMBoolInstanceRef._(scope, json);
- case "Double": return new VMDoubleInstanceRef._(scope, json);
- case "Int": return new VMIntInstanceRef._(scope, json);
- case "String": return new VMStringInstanceRef._(scope, json);
- case "Float32x4": return new VMFloat32x4InstanceRef._(scope, json);
- case "Float64x2": return new VMFloat64x2InstanceRef._(scope, json);
- case "Int32x4": return new VMInt32x4InstanceRef._(scope, json);
- case "StackTrace": return new VMStackTraceInstanceRef._(scope, json);
- case "List": return new VMListInstanceRef._(scope, json);
- case "Map": return new VMMapInstanceRef._(scope, json);
+ case "Null":
+ return new VMNullInstanceRef._(scope, json);
+ case "Bool":
+ return new VMBoolInstanceRef._(scope, json);
+ case "Double":
+ return new VMDoubleInstanceRef._(scope, json);
+ case "Int":
+ return new VMIntInstanceRef._(scope, json);
+ case "String":
+ return new VMStringInstanceRef._(scope, json);
+ case "Float32x4":
+ return new VMFloat32x4InstanceRef._(scope, json);
+ case "Float64x2":
+ return new VMFloat64x2InstanceRef._(scope, json);
+ case "Int32x4":
+ return new VMInt32x4InstanceRef._(scope, json);
+ case "StackTrace":
+ return new VMStackTraceInstanceRef._(scope, json);
+ case "List":
+ return new VMListInstanceRef._(scope, json);
+ case "Map":
+ return new VMMapInstanceRef._(scope, json);
case "Uint8ClampedList":
return new VMTypedDataInstanceRef<Uint8ClampedList>._(scope, json);
case "Uint8List":
@@ -64,15 +75,22 @@
return new VMTypedDataInstanceRef<Float32x4List>._(scope, json);
case "Float64x2List":
return new VMTypedDataInstanceRef<Float64x2List>._(scope, json);
- case "Closure": return new VMClosureInstanceRef._(scope, json);
+ case "Closure":
+ return new VMClosureInstanceRef._(scope, json);
case "MirrorReference":
return new VMMirrorReferenceInstanceRef._(scope, json);
- case "RegExp": return new VMRegExpInstanceRef._(scope, json);
- case "WeakProperty": return new VMWeakPropertyInstanceRef._(scope, json);
- case "Type": return new VMTypeInstanceRef._(scope, json);
- case "TypeParameter": return new VMTypeParameterInstanceRef._(scope, json);
- case "TypeRef": return new VMTypeRefInstanceRef._(scope, json);
- case "BoundedType": return new VMBoundedTypeInstanceRef._(scope, json);
+ case "RegExp":
+ return new VMRegExpInstanceRef._(scope, json);
+ case "WeakProperty":
+ return new VMWeakPropertyInstanceRef._(scope, json);
+ case "Type":
+ return new VMTypeInstanceRef._(scope, json);
+ case "TypeParameter":
+ return new VMTypeParameterInstanceRef._(scope, json);
+ case "TypeRef":
+ return new VMTypeRefInstanceRef._(scope, json);
+ case "BoundedType":
+ return new VMBoundedTypeInstanceRef._(scope, json);
default:
// The VM service protocol specifies that unknown instance kinds are to be
// treated as plain instances.
@@ -84,17 +102,28 @@
if (json == null) return null;
assert(json["type"] == "Instance");
switch (json["kind"]) {
- case "Null": return new VMNullInstance._(scope, json);
- case "Bool": return new VMBoolInstance._(scope, json);
- case "Double": return new VMDoubleInstance._(scope, json);
- case "Int": return new VMIntInstance._(scope, json);
- case "String": return new VMStringInstance._(scope, json);
- case "Float32x4": return new VMFloat32x4Instance._(scope, json);
- case "Float64x2": return new VMFloat64x2Instance._(scope, json);
- case "Int32x4": return new VMInt32x4Instance._(scope, json);
- case "StackTrace": return new VMStackTraceInstance._(scope, json);
- case "List": return new VMListInstance._(scope, json);
- case "Map": return new VMMapInstance._(scope, json);
+ case "Null":
+ return new VMNullInstance._(scope, json);
+ case "Bool":
+ return new VMBoolInstance._(scope, json);
+ case "Double":
+ return new VMDoubleInstance._(scope, json);
+ case "Int":
+ return new VMIntInstance._(scope, json);
+ case "String":
+ return new VMStringInstance._(scope, json);
+ case "Float32x4":
+ return new VMFloat32x4Instance._(scope, json);
+ case "Float64x2":
+ return new VMFloat64x2Instance._(scope, json);
+ case "Int32x4":
+ return new VMInt32x4Instance._(scope, json);
+ case "StackTrace":
+ return new VMStackTraceInstance._(scope, json);
+ case "List":
+ return new VMListInstance._(scope, json);
+ case "Map":
+ return new VMMapInstance._(scope, json);
case "Uint8ClampedList":
case "Uint8List":
case "Uint16List":
@@ -110,15 +139,22 @@
case "Float32x4List":
case "Float64x2List":
return new VMTypedDataInstance._(scope, json);
- case "Closure": return new VMClosureInstance._(scope, json);
+ case "Closure":
+ return new VMClosureInstance._(scope, json);
case "MirrorReference":
return new VMMirrorReferenceInstance._(scope, json);
- case "RegExp": return new VMRegExpInstance._(scope, json);
- case "WeakProperty": return new VMWeakPropertyInstance._(scope, json);
- case "Type": return new VMTypeInstance._(scope, json);
- case "TypeParameter": return new VMTypeParameterInstance._(scope, json);
- case "TypeRef": return new VMTypeRefInstance._(scope, json);
- case "BoundedType": return new VMBoundedTypeInstance._(scope, json);
+ case "RegExp":
+ return new VMRegExpInstance._(scope, json);
+ case "WeakProperty":
+ return new VMWeakPropertyInstance._(scope, json);
+ case "Type":
+ return new VMTypeInstance._(scope, json);
+ case "TypeParameter":
+ return new VMTypeParameterInstance._(scope, json);
+ case "TypeRef":
+ return new VMTypeRefInstance._(scope, json);
+ case "BoundedType":
+ return new VMBoundedTypeInstance._(scope, json);
default:
// The VM service protocol specifies that unknown instance kinds are to be
// treated as plain instances.
@@ -130,17 +166,20 @@
if (json == null) return null;
assert(json["type"] == "@Instance" || json["type"] == "Instance");
switch (json["kind"]) {
- case "Type": return new VMTypeInstanceRef._(scope, json);
- case "TypeParameter": return new VMTypeParameterInstanceRef._(scope, json);
- case "TypeRef": return new VMTypeRefInstanceRef._(scope, json);
- case "BoundedType": return new VMBoundedTypeInstanceRef._(scope, json);
+ case "Type":
+ return new VMTypeInstanceRef._(scope, json);
+ case "TypeParameter":
+ return new VMTypeParameterInstanceRef._(scope, json);
+ case "TypeRef":
+ return new VMTypeRefInstanceRef._(scope, json);
+ case "BoundedType":
+ return new VMBoundedTypeInstanceRef._(scope, json);
default:
throw new StateError('Unknown Type-like kind "${json["kind"]}".');
}
}
-VMTypeInstanceRef newVMTypeInstanceRef(Scope scope,
- Map json) {
+VMTypeInstanceRef newVMTypeInstanceRef(Scope scope, Map json) {
if (json == null) return null;
assert(json["type"] == "@Instance" || json["type"] == "Instance");
assert(json["kind"] == "Type");
@@ -196,8 +235,7 @@
/// instance will return identical Dart objects.
Future<Object> getValue({onUnknownValue(value)}) async {
if (Zone.current[#_cache] != null) return _getValue(onUnknownValue);
- return runZoned(() => _getValue(onUnknownValue),
- zoneValues: {#_cache: {}});
+ return runZoned(() => _getValue(onUnknownValue), zoneValues: {#_cache: {}});
}
/// A helper method for [getValue] that doesn't try to create a new cache.
@@ -216,8 +254,7 @@
return cache[this];
}
- Future<VMInstance> load() async =>
- new VMInstance._(_scope, await _load());
+ Future<VMInstance> load() async => new VMInstance._(_scope, await _load());
/// Evaluates [expression] in the context of this instance.
///
@@ -228,8 +265,8 @@
Future<Map> _load() => _scope.loadObject(_id);
- bool operator ==(other) => other is VMInstanceRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMInstanceRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -257,8 +294,7 @@
/// The value as a local Dart instance.
T get value;
- VMValueInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMValueInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMValueInstance<T>> load();
@@ -271,16 +307,14 @@
}
/// An instance whose value is synchronously accessible via the reference.
-abstract class VMValueInstance<T>
- implements VMValueInstanceRef<T>, VMInstance {
+abstract class VMValueInstance<T> implements VMValueInstanceRef<T>, VMInstance {
}
/// A reference to a `null` instance.
class VMNullInstanceRef extends VMValueInstanceRef<Null> {
Null get value => null;
- VMNullInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMNullInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMNullInstance> load() async =>
new VMNullInstance._(_scope, await _load());
@@ -395,7 +429,7 @@
/// of the form "[W, X, Y, Z]" where W, X, Y, and Z are floats.
static Float32x4 _parse(String value) {
var lanes = value
- // Substring to get rid of the surrounding [ and ].
+ // Substring to get rid of the surrounding [ and ].
.substring(1, value.length - 1)
.split(",")
.map(double.parse)
@@ -434,7 +468,7 @@
/// of the form "[X, Y]" where X and Y are floats.
static Float64x2 _parse(String value) {
var lanes = value
- // Substring to get rid of the surrounding [ and ].
+ // Substring to get rid of the surrounding [ and ].
.substring(1, value.length - 1)
.split(",")
.map(double.parse)
@@ -471,7 +505,7 @@
/// of the form "[M, N, P, Q]" where N, M, P, and Q are integers.
static Int32x4 _parse(String value) {
var lanes = value
- // Substring to get rid of the surrounding [ and ].
+ // Substring to get rid of the surrounding [ and ].
.substring(1, value.length - 1)
.split(",")
.map((lane) => int.parse(lane, radix: 16))
@@ -684,14 +718,15 @@
await Future.wait(associations.map((association) async {
var results = await Future.wait(
[association.key, association.value].map((value) {
- if (value is VMInstanceRef) {
- return value._getValue(onUnknownValue);
- } else if (onUnknownValue != null) {
- return onUnknownValue(value);
- } else {
- throw new VMSentinelException(value);
- }
- }), eagerError: true);
+ if (value is VMInstanceRef) {
+ return value._getValue(onUnknownValue);
+ } else if (onUnknownValue != null) {
+ return onUnknownValue(value);
+ } else {
+ throw new VMSentinelException(value);
+ }
+ }),
+ eagerError: true);
map[results.first] = results.last;
}), eagerError: true);
@@ -795,24 +830,38 @@
super._(scope, json);
static TypedData _value(Map json) {
- List<int> byteList = BASE64.decode(json["bytes"]);
+ List<int> byteList = base64Decode(json["bytes"]);
var bytes = new Uint8List.fromList(byteList);
switch (json["kind"]) {
- case "Uint8ClampedList": return bytes.buffer.asUint8ClampedList();
- case "Uint8List": return bytes.buffer.asUint8List();
- case "Uint16List": return bytes.buffer.asUint16List();
- case "Uint32List": return bytes.buffer.asUint32List();
- case "Uint64List": return bytes.buffer.asUint64List();
- case "Int8List": return bytes.buffer.asInt8List();
- case "Int16List": return bytes.buffer.asInt16List();
- case "Int32List": return bytes.buffer.asInt32List();
- case "Int64List": return bytes.buffer.asInt64List();
- case "Float32List": return bytes.buffer.asFloat32List();
- case "Float64List": return bytes.buffer.asFloat64List();
- case "Int32x4List": return bytes.buffer.asInt32x4List();
- case "Float32x4List": return bytes.buffer.asFloat32x4List();
- case "Float64x2List": return bytes.buffer.asFloat64x2List();
+ case "Uint8ClampedList":
+ return bytes.buffer.asUint8ClampedList();
+ case "Uint8List":
+ return bytes.buffer.asUint8List();
+ case "Uint16List":
+ return bytes.buffer.asUint16List();
+ case "Uint32List":
+ return bytes.buffer.asUint32List();
+ case "Uint64List":
+ return bytes.buffer.asUint64List();
+ case "Int8List":
+ return bytes.buffer.asInt8List();
+ case "Int16List":
+ return bytes.buffer.asInt16List();
+ case "Int32List":
+ return bytes.buffer.asInt32List();
+ case "Int64List":
+ return bytes.buffer.asInt64List();
+ case "Float32List":
+ return bytes.buffer.asFloat32List();
+ case "Float64List":
+ return bytes.buffer.asFloat64List();
+ case "Int32x4List":
+ return bytes.buffer.asInt32x4List();
+ case "Float32x4List":
+ return bytes.buffer.asFloat32x4List();
+ case "Float64x2List":
+ return bytes.buffer.asFloat64x2List();
default:
throw new StateError('Unknown TypedData kind "${json["kind"]}".');
}
@@ -878,9 +927,8 @@
super._(scope, json);
Future<RegExp> _getValue(onUnknownValue(value)) async {
- var value = pattern.isValueTruncated
- ? (await pattern.load()).value
- : pattern.value;
+ var value =
+ pattern.isValueTruncated ? (await pattern.load()).value : pattern.value;
return new RegExp(value,
multiLine: isMultiLine, caseSensitive: isCaseSensitive);
}
@@ -890,8 +938,7 @@
/// A reference to an instance of the built-in VM closure implementation.
class VMClosureInstanceRef extends VMInstanceRef {
- VMClosureInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMClosureInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMClosureInstance> load() async =>
new VMClosureInstance._(_scope, await _load());
@@ -921,8 +968,7 @@
/// A reference to an instance of the VM-internal MirrorReference class.
class VMMirrorReferenceInstanceRef extends VMInstanceRef {
- VMMirrorReferenceInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMMirrorReferenceInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMMirrorReferenceInstance> load() async =>
new VMMirrorReferenceInstance._(_scope, await _load());
@@ -946,8 +992,7 @@
/// A reference to an instance of the VM-internal WeakProperty class.
class VMWeakPropertyInstanceRef extends VMInstanceRef {
- VMWeakPropertyInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMWeakPropertyInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMWeakPropertyInstance> load() async =>
new VMWeakPropertyInstance._(_scope, await _load());
@@ -973,15 +1018,14 @@
/// A reference to an instance that's used as a type.
abstract class VMTypeLikeInstanceRef extends VMInstanceRef {
- VMTypeLikeInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMTypeLikeInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMTypeLikeInstance> load();
}
/// An instance that's used as a type.
-abstract class VMTypeLikeInstance
- implements VMTypeLikeInstanceRef, VMInstance {}
+abstract class VMTypeLikeInstance implements VMTypeLikeInstanceRef, VMInstance {
+}
/// A reference to an instance of [Type].
class VMTypeInstanceRef extends VMTypeLikeInstanceRef {
@@ -1050,8 +1094,7 @@
/// A reference to an instance of the VM-internal TypeRef class.
class VMTypeRefInstanceRef extends VMTypeLikeInstanceRef {
- VMTypeRefInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMTypeRefInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMTypeRefInstance> load() async =>
new VMTypeRefInstance._(_scope, await _load());
@@ -1075,8 +1118,7 @@
/// A reference to an instance of the VM-internal BoundedType class.
class VMBoundedTypeInstanceRef extends VMTypeLikeInstanceRef {
- VMBoundedTypeInstanceRef._(Scope scope, Map json)
- : super._(scope, json);
+ VMBoundedTypeInstanceRef._(Scope scope, Map json) : super._(scope, json);
Future<VMBoundedTypeInstance> load() async =>
new VMBoundedTypeInstance._(_scope, await _load());
diff --git a/vm_service_client/lib/src/isolate.dart b/vm_service_client/lib/src/isolate.dart
index a3f540e..cb52f26 100644
--- a/vm_service_client/lib/src/isolate.dart
+++ b/vm_service_client/lib/src/isolate.dart
@@ -117,27 +117,27 @@
///
/// If the isolate has already exited, this will complete immediately.
Future get onExit => _onExitMemo.runOnce(() async {
- try {
- await _scope.getInState(_scope.streams.isolate, () async {
try {
- await load();
- return null;
- } on VMSentinelException catch (_) {
- // Return a non-null value to indicate that the breakpoint is in the
- // expected state—that is, it no longer exists.
- return true;
+ await _scope.getInState(_scope.streams.isolate, () async {
+ try {
+ await load();
+ return null;
+ } on VMSentinelException catch (_) {
+ // Return a non-null value to indicate that the breakpoint is in the
+ // expected state—that is, it no longer exists.
+ return true;
+ }
+ }, (json) {
+ if (json["isolate"]["id"] != _scope.isolateId) return null;
+ if (json["kind"] != "IsolateExit") return null;
+ return true;
+ });
+ } on StateError catch (_) {
+ // Ignore state errors. They indicate that the underlying stream closed
+ // before an exit event was fired, which means that the process and thus
+ // this isolate is dead.
}
- }, (json) {
- if (json["isolate"]["id"] != _scope.isolateId) return null;
- if (json["kind"] != "IsolateExit") return null;
- return true;
});
- } on StateError catch (_) {
- // Ignore state errors. They indicate that the underlying stream closed
- // before an exit event was fired, which means that the process and thus
- // this isolate is dead.
- }
- });
final _onExitMemo = new AsyncMemoizer();
VMIsolateRef._(this._scope, Map json)
@@ -170,13 +170,13 @@
_stdout = _transform(_scope.streams.stdout, (json, sink) {
if (json["kind"] != "WriteEvent") return;
- var bytes = BASE64.decode(json["bytes"]);
+ var bytes = base64Decode(json["bytes"]);
sink.add(bytes);
});
_stderr = _transform(_scope.streams.stderr, (json, sink) {
if (json["kind"] != "WriteEvent") return;
- sink.add(BASE64.decode(json["bytes"]));
+ sink.add(base64Decode(json["bytes"]));
});
_onExtensionEvent = _transform(_scope.streams.extension, (json, sink) {
@@ -223,8 +223,10 @@
return _scope.getInState(_scope.streams.debug, () async {
return (await load()).isPaused;
}, (json) {
- return json["kind"] == "PauseStart" || json["kind"] == "PauseException" ||
- json["kind"] == "PauseExit" || json["kind"] == "PauseInterrupted" ||
+ return json["kind"] == "PauseStart" ||
+ json["kind"] == "PauseException" ||
+ json["kind"] == "PauseExit" ||
+ json["kind"] == "PauseInterrupted" ||
json["kind"] == "PauseBreakpoint";
});
}
@@ -242,8 +244,8 @@
throw new VMSentinelException(newVMSentinel(response));
} else {
return response["rootLib"] == null ||
- // Work around sdk#24140
- response["rootLib"]["type"] == "@Instance"
+ // Work around sdk#24140
+ response["rootLib"]["type"] == "@Instance"
? new VMIsolate._(_scope, response)
: new VMRunnableIsolate._(_scope, response);
}
@@ -258,7 +260,7 @@
///
/// This is supported as of VM service version 3.1, or Dart SDK version 1.14.
Stream<VMExtensionEvent> selectExtensionEvents(String kind,
- {bool prefix: false}) {
+ {bool prefix: false}) {
return transform(_onExtensionEvent, (event, sink) {
if (prefix == null ? event.kind == kind : event.kind.startsWith(kind)) {
sink.add(event);
@@ -284,8 +286,8 @@
/// Throws an [rpc.RpcException] if the isolate isn't paused.
Future resume({VMStep step}) {
if (step == null) step = VMStep.resume;
- return _scope.sendRequest("resume",
- step == VMStep.resume ? {} : {"step": step._value});
+ return _scope.sendRequest(
+ "resume", step == VMStep.resume ? {} : {"step": step._value});
}
/// Sets the [name] of the isolate.
@@ -308,8 +310,8 @@
if (column != null) params["column"] = column;
try {
- var response = await _scope.sendRequest(
- "addBreakpointWithScriptUri", params);
+ var response =
+ await _scope.sendRequest("addBreakpointWithScriptUri", params);
return newVMBreakpoint(_scope, response);
} on rpc.RpcException catch (error) {
// Error 102 indicates that the breakpoint couldn't be created.
@@ -349,8 +351,8 @@
/// This is supported as of VM service version 3.1, or Dart SDK version 1.14.
Future<Object> invokeExtension(String method, [Map<String, String> params]) {
if (!method.startsWith('ext.')) {
- throw new ArgumentError.value(method, 'method',
- 'must begin with "ext." prefix');
+ throw new ArgumentError.value(
+ method, 'method', 'must begin with "ext." prefix');
}
return _scope.sendRequestRaw(method, params);
}
@@ -387,8 +389,8 @@
return newSourceReport(_scope, json);
}
- bool operator ==(other) => other is VMIsolateRef &&
- other._scope.isolateId == _scope.isolateId;
+ bool operator ==(other) =>
+ other is VMIsolateRef && other._scope.isolateId == _scope.isolateId;
int get hashCode => _scope.isolateId.hashCode;
@@ -441,7 +443,7 @@
breakpoints = new List.unmodifiable(json["breakpoints"]
.map((breakpoint) => newVMBreakpoint(scope, breakpoint))),
extensionRpcs = new UnmodifiableListView(
- DelegatingList.typed(json["extensionRPCs"] ?? [])),
+ List.castFrom(json["extensionRPCs"] ?? [])),
super._(scope, json);
}
@@ -465,10 +467,10 @@
VMRunnableIsolate._(Scope scope, Map json)
: rootLibrary = newVMLibraryRef(scope, json["rootLib"]),
- libraries = new UnmodifiableMapView(
- new Map.fromIterable(json["libraries"],
- key: (library) => Uri.parse(library["uri"]),
- value: (library) => newVMLibraryRef(scope, library))),
+ libraries = new UnmodifiableMapView(new Map.fromIterable(
+ json["libraries"],
+ key: (library) => Uri.parse(library["uri"]),
+ value: (library) => newVMLibraryRef(scope, library))),
super._(scope, json);
Future<VMRunnableIsolate> loadRunnable() => load();
diff --git a/vm_service_client/lib/src/library.dart b/vm_service_client/lib/src/library.dart
index 5fdd5d2..0f881e1 100644
--- a/vm_service_client/lib/src/library.dart
+++ b/vm_service_client/lib/src/library.dart
@@ -49,18 +49,14 @@
/// Enables breakpoints and stepping for this library.
Future setDebuggable() async {
- await _scope.sendRequest("setLibraryDebuggable", {
- "libraryId": _id,
- "isDebuggable": true
- });
+ await _scope.sendRequest(
+ "setLibraryDebuggable", {"libraryId": _id, "isDebuggable": true});
}
/// Disables breakpoints and stepping for this library.
Future setNotDebuggable() async {
- await _scope.sendRequest("setLibraryDebuggable", {
- "libraryId": _id,
- "isDebuggable": false
- });
+ await _scope.sendRequest(
+ "setLibraryDebuggable", {"libraryId": _id, "isDebuggable": false});
}
/// Evaluates [expression] in the context of this library.
@@ -69,8 +65,8 @@
Future<VMInstanceRef> evaluate(String expression) =>
_scope.evaluate(_id, expression);
- bool operator ==(other) => other is VMLibraryRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMLibraryRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -110,15 +106,15 @@
isDebuggable = json["debuggable"],
dependencies = new List.unmodifiable(json["dependencies"]
.map((dependency) => new VMLibraryDependency._(scope, dependency))),
- scripts = new List.unmodifiable(json["scripts"]
- .map((script) => newVMScriptRef(scope, script))),
+ scripts = new List.unmodifiable(
+ json["scripts"].map((script) => newVMScriptRef(scope, script))),
fields = new UnmodifiableMapView(new Map.fromIterable(json["variables"],
key: (field) => field["name"],
value: (field) => newVMFieldRef(scope, field))),
- functions = new UnmodifiableMapView(
- new Map.fromIterable(json["functions"],
- key: (function) => function["name"],
- value: (function) => newVMFunctionRef(scope, function))),
+ functions = new UnmodifiableMapView(new Map.fromIterable(
+ json["functions"],
+ key: (function) => function["name"],
+ value: (function) => newVMFunctionRef(scope, function))),
classes = new UnmodifiableMapView(new Map.fromIterable(json["classes"],
key: (klass) => klass["name"],
value: (klass) => newVMClassRef(scope, klass))),
diff --git a/vm_service_client/lib/src/pause_event.dart b/vm_service_client/lib/src/pause_event.dart
index 518e50f..a58a57a 100644
--- a/vm_service_client/lib/src/pause_event.dart
+++ b/vm_service_client/lib/src/pause_event.dart
@@ -12,14 +12,22 @@
assert(json["type"] == "Event");
switch (json["kind"]) {
- case "PauseStart": return new VMPauseStartEvent._(scope, json);
- case "PauseExit": return new VMPauseExitEvent._(scope, json);
- case "PauseBreakpoint": return new VMPauseBreakpointEvent._(scope, json);
- case "PauseInterrupted": return new VMPauseInterruptedEvent._(scope, json);
- case "PauseException": return new VMPauseExceptionEvent._(scope, json);
- case "Resume": return new VMResumeEvent._(scope, json);
- case "None": return new VMNoneEvent._(scope, json);
- default: return null;
+ case "PauseStart":
+ return new VMPauseStartEvent._(scope, json);
+ case "PauseExit":
+ return new VMPauseExitEvent._(scope, json);
+ case "PauseBreakpoint":
+ return new VMPauseBreakpointEvent._(scope, json);
+ case "PauseInterrupted":
+ return new VMPauseInterruptedEvent._(scope, json);
+ case "PauseException":
+ return new VMPauseExceptionEvent._(scope, json);
+ case "Resume":
+ return new VMResumeEvent._(scope, json);
+ case "None":
+ return new VMNoneEvent._(scope, json);
+ default:
+ return null;
}
}
@@ -48,8 +56,7 @@
/// An event indicating that an isolate was paused as it started, before it
/// executed any code.
class VMPauseStartEvent extends VMPauseEvent {
- VMPauseStartEvent._(Scope scope, Map json)
- : super._(scope, json);
+ VMPauseStartEvent._(Scope scope, Map json) : super._(scope, json);
String toString() => "pause before start";
}
@@ -57,8 +64,7 @@
/// An event indicating that an isolate was paused as it exited, before it
/// terminated.
class VMPauseExitEvent extends VMPauseEvent {
- VMPauseExitEvent._(Scope scope, Map json)
- : super._(scope, json);
+ VMPauseExitEvent._(Scope scope, Map json) : super._(scope, json);
String toString() => "pause before exit";
}
@@ -85,8 +91,7 @@
///
/// This usually means its process received `SIGQUIT`.
class VMPauseInterruptedEvent extends VMPauseEvent {
- VMPauseInterruptedEvent._(Scope scope, Map json)
- : super._(scope, json);
+ VMPauseInterruptedEvent._(Scope scope, Map json) : super._(scope, json);
String toString() => "pause on interrupt";
}
@@ -105,16 +110,14 @@
/// An event indicating that an isolate was unpaused.
class VMResumeEvent extends VMPauseEvent {
- VMResumeEvent._(Scope scope, Map json)
- : super._(scope, json);
+ VMResumeEvent._(Scope scope, Map json) : super._(scope, json);
String toString() => "resume";
}
/// An event indicating that an isolate was unpaused.
class VMNoneEvent extends VMPauseEvent {
- VMNoneEvent._(Scope scope, Map json)
- : super._(scope, json);
+ VMNoneEvent._(Scope scope, Map json) : super._(scope, json);
String toString() => "none";
}
diff --git a/vm_service_client/lib/src/scope.dart b/vm_service_client/lib/src/scope.dart
index 88a4eba..e24f148 100644
--- a/vm_service_client/lib/src/scope.dart
+++ b/vm_service_client/lib/src/scope.dart
@@ -30,9 +30,9 @@
/// Returns the [VMObjectRef.observatoryUrl] for an object with the given
/// [id].
- Uri observatoryUrlFor(String id) => Uri.parse(
- "#/inspect?isolateId=${Uri.encodeQueryComponent(isolateId)}&"
- "objectId=${Uri.encodeQueryComponent(id)}");
+ Uri observatoryUrlFor(String id) =>
+ Uri.parse("#/inspect?isolateId=${Uri.encodeQueryComponent(isolateId)}&"
+ "objectId=${Uri.encodeQueryComponent(id)}");
/// Given the ID for a [VMObjectRef], loads the JSON for its corresponding
/// [VMObject].
@@ -69,15 +69,16 @@
/// Throws a [VMErrorException] if evaluating the expression throws an error.
/// Throws a [VMSentinelException] if the object has expired.
Future<VMInstanceRef> evaluate(String id, String expression) async {
- var result = await sendRequest("evaluate", {
- "targetId": id,
- "expression": expression
- });
+ var result = await sendRequest(
+ "evaluate", {"targetId": id, "expression": expression});
switch (result["type"]) {
- case "Sentinel": throw new VMSentinelException(newVMSentinel(result));
- case "@Error": throw new VMErrorException(newVMErrorRef(this, result));
- case "@Instance": return newVMInstanceRef(this, result);
+ case "Sentinel":
+ throw new VMSentinelException(newVMSentinel(result));
+ case "@Error":
+ throw new VMErrorException(newVMErrorRef(this, result));
+ case "@Instance":
+ return newVMInstanceRef(this, result);
default:
throw new StateError('Unexpected Object type "${result["type"]}".');
}
@@ -104,8 +105,8 @@
/// This returns the value returned by [immediate] if it's not `null` or
/// `false`, or else the first non-`null`, non-`false` value returned by
/// [onEvent].
- Future<T> getInState<T>(Stream<Map> stream, Future<T> immediate(),
- onEvent(Map json)) async {
+ Future<T> getInState<T>(
+ Stream<Map> stream, Future<T> immediate(), onEvent(Map json)) async {
var completer = new Completer.sync();
// Don't top-level errors from the completer. These may come in from the
diff --git a/vm_service_client/lib/src/script.dart b/vm_service_client/lib/src/script.dart
index 616d923..145103d 100644
--- a/vm_service_client/lib/src/script.dart
+++ b/vm_service_client/lib/src/script.dart
@@ -5,7 +5,6 @@
import 'dart:async';
import 'dart:math' as math;
-import 'package:collection/collection.dart';
import 'package:json_rpc_2/json_rpc_2.dart' as rpc;
import 'package:source_span/source_span.dart';
@@ -23,8 +22,8 @@
return new VMScriptRef._(scope, json);
}
-VMScriptToken newVMScriptToken(String isolateId, String scriptId,
- int position) {
+VMScriptToken newVMScriptToken(
+ String isolateId, String scriptId, int position) {
if (position == null) return null;
return new VMScriptToken._(isolateId, scriptId, position);
}
@@ -123,8 +122,8 @@
return newSourceReport(_scope, json);
}
- bool operator ==(other) => other is VMScriptRef &&
- (_fixedId ? _id == other._id : super == other);
+ bool operator ==(other) =>
+ other is VMScriptRef && (_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -170,6 +169,7 @@
_sourceFile ??= new SourceFile.fromString(source, url: uri);
return _sourceFile;
}
+
SourceFile _sourceFile;
VMScript._(Scope scope, Map json)
@@ -284,6 +284,7 @@
_offset ??= _script.sourceFile.getOffset(line, column);
return _offset;
}
+
int _offset;
SourceFile get file => _script.sourceFile;
@@ -294,12 +295,14 @@
_ensureLineAndColumn();
return _line;
}
+
int _line;
int get column {
_ensureLineAndColumn();
return _column;
}
+
int _column;
_ScriptLocation(this._script, this._position);
@@ -355,18 +358,20 @@
_start ??= new _ScriptLocation(_script, _startPosition);
return _start;
}
+
FileLocation _start;
FileLocation get end {
_end ??= new _ScriptLocation(_script, _endPosition);
return _end;
}
+
FileLocation _end;
String get text => _script.source.substring(start.offset, end.offset);
String get context => file.getText(file.getOffset(start.line),
- end.line == file.lines - 1 ? null : file.getOffset(end.line + 1));
+ end.line == file.lines - 1 ? null : file.getOffset(end.line + 1));
_ScriptSpan(this._script, this._startPosition, this._endPosition,
[this._start, this._end]);
@@ -378,8 +383,8 @@
_ScriptSpan otherFile = other;
var result = _startPosition.compareTo(otherFile._startPosition);
- return result == 0 ?
- _endPosition.compareTo(otherFile._endPosition)
+ return result == 0
+ ? _endPosition.compareTo(otherFile._endPosition)
: result;
}
@@ -400,8 +405,8 @@
bool operator ==(other) => other is _ScriptSpan
? _startPosition == other._startPosition &&
- _endPosition == other._endPosition &&
- sourceUrl == other.sourceUrl
+ _endPosition == other._endPosition &&
+ sourceUrl == other.sourceUrl
: super == other;
FileSpan expand(FileSpan other) {
@@ -413,7 +418,10 @@
if (other is _ScriptSpan) {
var startPosition = math.min(this._startPosition, other._startPosition);
var endPosition = math.max(this._endPosition, other._endPosition);
- return new _ScriptSpan(_script, startPosition, endPosition,
+ return new _ScriptSpan(
+ _script,
+ startPosition,
+ endPosition,
startPosition == this._startPosition ? this._start : other._start,
endPosition == this._endPosition ? this._end : other._end);
} else {
diff --git a/vm_service_client/lib/src/sentinel.dart b/vm_service_client/lib/src/sentinel.dart
index 1d81ad4..9d7f7d6 100644
--- a/vm_service_client/lib/src/sentinel.dart
+++ b/vm_service_client/lib/src/sentinel.dart
@@ -5,13 +5,20 @@
VMSentinel newVMSentinel(Map json) {
assert(json["type"] == "Sentinel");
switch (json["kind"]) {
- case "Collected": return VMSentinel.collected;
- case "Expired": return VMSentinel.expired;
- case "NotInitialized": return VMSentinel.notInitialized;
- case "BeingInitialized": return VMSentinel.beingInitialized;
- case "OptimizedOut": return VMSentinel.optimizedOut;
- case "Free": return VMSentinel.free;
- default: throw new StateError('Unknown Sentinel kind "${json["kind"]}".');
+ case "Collected":
+ return VMSentinel.collected;
+ case "Expired":
+ return VMSentinel.expired;
+ case "NotInitialized":
+ return VMSentinel.notInitialized;
+ case "BeingInitialized":
+ return VMSentinel.beingInitialized;
+ case "OptimizedOut":
+ return VMSentinel.optimizedOut;
+ case "Free":
+ return VMSentinel.free;
+ default:
+ throw new StateError('Unknown Sentinel kind "${json["kind"]}".');
}
}
diff --git a/vm_service_client/lib/src/source_report.dart b/vm_service_client/lib/src/source_report.dart
index e3f7d0e..a216aae 100644
--- a/vm_service_client/lib/src/source_report.dart
+++ b/vm_service_client/lib/src/source_report.dart
@@ -2,8 +2,6 @@
// 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:collection/collection.dart';
-
import 'script.dart';
import 'scope.dart';
import 'source_location.dart';
@@ -95,15 +93,15 @@
var hits = json['coverage'] == null
? null
- : _getTokens(script, DelegatingList.typed(json['coverage']['hits']));
+ : _getTokens(script, List.castFrom(json['coverage']['hits']));
var misses = json['coverage'] == null
? null
- : _getTokens(script, DelegatingList.typed(json['coverage']['misses']));
+ : _getTokens(script, List.castFrom(json['coverage']['misses']));
var possibleBreakpoints = json['possibleBreakpoints'] == null
? null
- : _getTokens(script, DelegatingList.typed(json['possibleBreakpoints']));
+ : _getTokens(script, List.castFrom(json['possibleBreakpoints']));
return new VMSourceReportRange._(
compiled, hits, misses, possibleBreakpoints, location);
diff --git a/vm_service_client/lib/src/stack.dart b/vm_service_client/lib/src/stack.dart
index fcdf5aa..b016b94 100644
--- a/vm_service_client/lib/src/stack.dart
+++ b/vm_service_client/lib/src/stack.dart
@@ -34,15 +34,15 @@
final List<VMMessage> messages;
VMStack._(Scope scope, Map json)
- : frames = new List.unmodifiable(json["frames"]
- .map((frame) => newVMFrame(scope, frame))),
- messages = new List.unmodifiable(json["messages"]
- .map((message) => newVMMessage(scope, message)));
+ : frames = new List.unmodifiable(
+ json["frames"].map((frame) => newVMFrame(scope, frame))),
+ messages = new List.unmodifiable(
+ json["messages"].map((message) => newVMMessage(scope, message)));
/// Returns the trace of this stack.
Future<Trace> getTrace() async {
var scripts = <String, VMScript>{};
- return new Trace(await Future.wait(
- frames.map((frame) => frameToFrame(frame, scripts))));
+ return new Trace(
+ await Future.wait(frames.map((frame) => frameToFrame(frame, scripts))));
}
}
diff --git a/vm_service_client/lib/src/stream_manager.dart b/vm_service_client/lib/src/stream_manager.dart
index d28dee7..258be40 100644
--- a/vm_service_client/lib/src/stream_manager.dart
+++ b/vm_service_client/lib/src/stream_manager.dart
@@ -103,36 +103,37 @@
/// unsubscribes once it has no listeners.
StreamController<Map> _controller(String streamID) {
StreamController<Map> controller;
- controller = new StreamController.broadcast(sync: true, onListen: () {
- // Work around sdk#24350.
- if ((streamID == "Stdout" || streamID == "Stderr") &&
- _debugSubscription == null) {
- _debugSubscription = debug.listen(null);
- }
+ controller = new StreamController.broadcast(
+ sync: true,
+ onListen: () {
+ // Work around sdk#24350.
+ if ((streamID == "Stdout" || streamID == "Stderr") &&
+ _debugSubscription == null) {
+ _debugSubscription = debug.listen(null);
+ }
- _peer.sendRequest("streamListen", {
- "streamId": streamID
- }).catchError((error, stackTrace) {
- controller.addError(error, stackTrace);
- });
- }, onCancel: () {
- if (_peer.isClosed) return;
+ _peer.sendRequest("streamListen", {"streamId": streamID}).catchError(
+ (error, stackTrace) {
+ controller.addError(error, stackTrace);
+ });
+ },
+ onCancel: () {
+ if (_peer.isClosed) return;
- // Work around sdk#24350.
- if (_debugSubscription != null &&
- !_stdoutController.hasListener &&
- !_stderrController.hasListener) {
- _debugSubscription.cancel();
- _debugSubscription = null;
- }
+ // Work around sdk#24350.
+ if (_debugSubscription != null &&
+ !_stdoutController.hasListener &&
+ !_stderrController.hasListener) {
+ _debugSubscription.cancel();
+ _debugSubscription = null;
+ }
- _peer.sendRequest("streamCancel", {
- "streamId": streamID
- }).catchError((_) {
- // Do nothing if canceling the stream failed, since no one's listening
- // to it anyway.
- });
- });
+ _peer.sendRequest("streamCancel", {"streamId": streamID}).catchError(
+ (_) {
+ // Do nothing if canceling the stream failed, since no one's listening
+ // to it anyway.
+ });
+ });
return controller;
}
}
diff --git a/vm_service_client/lib/src/type_arguments.dart b/vm_service_client/lib/src/type_arguments.dart
index 3d2ce13..7899146 100644
--- a/vm_service_client/lib/src/type_arguments.dart
+++ b/vm_service_client/lib/src/type_arguments.dart
@@ -9,8 +9,7 @@
import 'object.dart';
import 'scope.dart';
-VMTypeArgumentsRef newVMTypeArgumentsRef(Scope scope,
- Map json) {
+VMTypeArgumentsRef newVMTypeArgumentsRef(Scope scope, Map json) {
if (json == null) return null;
assert(json["type"] == "@TypeArguments" || json["type"] == "TypeArguments");
return new VMTypeArgumentsRef._(scope, json);
@@ -41,7 +40,8 @@
Future<VMTypeArguments> load() async =>
new VMTypeArguments._(_scope, await _scope.loadObject(_id));
- bool operator ==(other) => other is VMTypeArgumentsRef &&
+ bool operator ==(other) =>
+ other is VMTypeArgumentsRef &&
(_fixedId ? _id == other._id : super == other);
int get hashCode => _fixedId ? _id.hashCode : super.hashCode;
@@ -61,7 +61,7 @@
VMTypeArguments._(Scope scope, Map json)
: klass = newVMClassRef(scope, json["class"]),
size = json["size"],
- types = new List.unmodifiable(json["types"]
- .map((type) => newVMTypeLikeInstanceRef(scope, type))),
+ types = new List.unmodifiable(
+ json["types"].map((type) => newVMTypeLikeInstanceRef(scope, type))),
super._(scope, json);
}
diff --git a/vm_service_client/lib/src/unresolved_source_location.dart b/vm_service_client/lib/src/unresolved_source_location.dart
index fddfdd0..3b071fc 100644
--- a/vm_service_client/lib/src/unresolved_source_location.dart
+++ b/vm_service_client/lib/src/unresolved_source_location.dart
@@ -6,8 +6,8 @@
import 'scope.dart';
import 'script.dart';
-VMUnresolvedSourceLocation newVMUnresolvedSourceLocation(Scope scope,
- Map json) {
+VMUnresolvedSourceLocation newVMUnresolvedSourceLocation(
+ Scope scope, Map json) {
if (json == null) return null;
assert(json["type"] == "UnresolvedSourceLocation");
return new VMUnresolvedSourceLocation._(scope, json);
@@ -35,10 +35,9 @@
VMUnresolvedSourceLocation._(Scope scope, Map json)
: script = newVMScriptRef(scope, json["script"]),
- uri = Uri.parse(
- json["scriptUri"] == null
- ? json["script"]["uri"]
- : json["scriptUri"]),
+ uri = Uri.parse(json["scriptUri"] == null
+ ? json["script"]["uri"]
+ : json["scriptUri"]),
token = json["tokenPos"] == null
? null
: newVMScriptToken(
diff --git a/vm_service_client/lib/src/utils.dart b/vm_service_client/lib/src/utils.dart
index 1b27539..359d479 100644
--- a/vm_service_client/lib/src/utils.dart
+++ b/vm_service_client/lib/src/utils.dart
@@ -29,18 +29,18 @@
/// Transforms [stream] with a [StreamTransformer] that transforms data events
/// using [handleData].
-Stream<T> transform<S, T>(Stream<S> stream,
- void handleData(S data, EventSink<T> sink)) =>
- stream.transform(
- new StreamTransformer.fromHandlers(handleData: handleData));
+Stream<T> transform<S, T>(
+ Stream<S> stream, void handleData(S data, EventSink<T> sink)) =>
+ stream
+ .transform(new StreamTransformer.fromHandlers(handleData: handleData));
/// Loads a `stack_trace` [Frame] for [frame].
///
/// If [scripts] is passed, it should be a map of [VMScript]s that have already
/// been loaded, indexed by [name]. This function modifys the map so that it can
/// be passed in to future invocations to avoid unnecessary loads.
-Future<Frame> frameToFrame(VMFrame frame, [Map<String, VMScript> scripts])
- async {
+Future<Frame> frameToFrame(VMFrame frame,
+ [Map<String, VMScript> scripts]) async {
var scopes = [];
VMObjectRef scope = frame.function;
while (scope is VMFunctionRef) {
@@ -59,7 +59,8 @@
// The special "evaluate" scheme is used for evaluating code with the VM
// service. Different scripts can have the same "evalute" scheme, so we
// don't record them.
- if (scripts != null && uri.scheme != 'evaluate') scripts[uri.toString()] = script;
+ if (scripts != null && uri.scheme != 'evaluate')
+ scripts[uri.toString()] = script;
}
var location = await script.sourceLocation(frame.location.token);
diff --git a/vm_service_client/lib/src/vm.dart b/vm_service_client/lib/src/vm.dart
index 5e6e8ef..284ff06 100644
--- a/vm_service_client/lib/src/vm.dart
+++ b/vm_service_client/lib/src/vm.dart
@@ -54,8 +54,7 @@
///
/// Note that since this object is immutable, it needs to be reloaded to see
/// the new name.
- Future setName(String name) =>
- _peer.sendRequest("setVMName", {"name": name});
+ Future setName(String name) => _peer.sendRequest("setVMName", {"name": name});
/// Loads the full representation of the VM.
Future<VM> load() async =>
diff --git a/vm_service_client/lib/vm_service_client.dart b/vm_service_client/lib/vm_service_client.dart
index 5c24eb6..9bdb474 100644
--- a/vm_service_client/lib/vm_service_client.dart
+++ b/vm_service_client/lib/vm_service_client.dart
@@ -28,19 +28,24 @@
export 'src/flag.dart' hide newVMFlagList;
export 'src/frame.dart' hide newVMFrame;
export 'src/function.dart' hide newVMFunctionRef;
-export 'src/instance.dart' hide newVMInstanceRef, newVMInstance,
- newVMTypeLikeInstanceRef, newVMTypeInstanceRef, newVMInstanceRefOrSentinel;
+export 'src/instance.dart'
+ hide
+ newVMInstanceRef,
+ newVMInstance,
+ newVMTypeLikeInstanceRef,
+ newVMTypeInstanceRef,
+ newVMInstanceRefOrSentinel;
export 'src/isolate.dart' hide newVMIsolateRef;
export 'src/library.dart' hide newVMLibraryRef;
export 'src/message.dart' hide newVMMessage;
export 'src/object.dart';
export 'src/pause_event.dart' hide newVMPauseEvent;
-export 'src/script.dart' hide newVMScriptRef, newVMScriptToken,
- newVMScriptTokenFromPosition;
+export 'src/script.dart'
+ hide newVMScriptRef, newVMScriptToken, newVMScriptTokenFromPosition;
export 'src/sentinel.dart' hide newVMSentinel;
export 'src/service_version.dart' hide newVMServiceVersion;
-export 'src/source_location.dart' hide newVMSourceLocation,
- newVMSourceLocationFromPosition;
+export 'src/source_location.dart'
+ hide newVMSourceLocation, newVMSourceLocationFromPosition;
export 'src/source_report.dart' hide newSourceReport;
export 'src/stack.dart' hide newVMStack;
export 'src/type_arguments.dart' hide newVMTypeArgumentsRef;
diff --git a/vm_service_client/pubspec.yaml b/vm_service_client/pubspec.yaml
index d374ab8..ed7e617 100644
--- a/vm_service_client/pubspec.yaml
+++ b/vm_service_client/pubspec.yaml
@@ -1,11 +1,11 @@
name: vm_service_client
-version: 0.2.4+3
+version: 0.2.5
description: A client for the Dart VM service.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/vm_service_client
environment:
- sdk: '>=2.0.0-dev.20.0 <2.0.0'
+ sdk: '>=2.0.0-dev.58.0 <2.0.0'
dependencies:
async: '>=1.7.0 <3.0.0'
@@ -18,4 +18,4 @@
web_socket_channel: '^1.0.0'
dev_dependencies:
- test: '^0.12.22'
+ test: ^1.2.0