Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: lib/src/command/serve.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/command/list_package_dirs.dart ('k') | lib/src/command_runner.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:math' as math; 6 import 'dart:math' as math;
7 7
8 import 'package:barback/barback.dart'; 8 import 'package:barback/barback.dart';
9 9
10 import '../barback/asset_environment.dart'; 10 import '../barback/asset_environment.dart';
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 Future onRunTransformerCommand() async { 81 Future onRunTransformerCommand() async {
82 var port = parseInt(argResults['port'], 'port'); 82 var port = parseInt(argResults['port'], 'port');
83 var adminPort = argResults['admin-port'] == null ? null : 83 var adminPort = argResults['admin-port'] == null ? null :
84 parseInt(argResults['admin-port'], 'admin port'); 84 parseInt(argResults['admin-port'], 'admin port');
85 85
86 var watcherType = argResults['force-poll'] ? 86 var watcherType = argResults['force-poll'] ?
87 WatcherType.POLLING : WatcherType.AUTO; 87 WatcherType.POLLING : WatcherType.AUTO;
88 88
89 var environmentConstants = new Map.fromIterable(argResults["define"], 89 var environmentConstants = new Map<String, String>.fromIterable(
90 argResults["define"],
90 key: (pair) => pair.split("=").first, 91 key: (pair) => pair.split("=").first,
91 value: (pair) => pair.split("=").last); 92 value: (pair) => pair.split("=").last);
92 93
93 var environment = await AssetEnvironment.create(entrypoint, mode, 94 var environment = await AssetEnvironment.create(entrypoint, mode,
94 watcherType: watcherType, hostname: hostname, basePort: port, 95 watcherType: watcherType, hostname: hostname, basePort: port,
95 useDart2JS: useDart2JS, environmentConstants: environmentConstants); 96 useDart2JS: useDart2JS, environmentConstants: environmentConstants);
96 var directoryLength = sourceDirectories.map((dir) => dir.length) 97 var directoryLength = sourceDirectories.map((dir) => dir.length)
97 .reduce(math.max); 98 .reduce(math.max);
98 99
99 if (adminPort != null) { 100 if (adminPort != null) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 "${padRight(server.rootDirectory, directoryLength)} " 179 "${padRight(server.rootDirectory, directoryLength)} "
179 "on ${log.bold('http://$hostname:${server.port}')}"); 180 "on ${log.bold('http://$hostname:${server.port}')}");
180 } 181 }
181 182
182 /// Reports [error] and exits the server. 183 /// Reports [error] and exits the server.
183 void _fatalError(error, [stackTrace]) { 184 void _fatalError(error, [stackTrace]) {
184 if (_completer.isCompleted) return; 185 if (_completer.isCompleted) return;
185 _completer.completeError(error, stackTrace); 186 _completer.completeError(error, stackTrace);
186 } 187 }
187 } 188 }
OLDNEW
« no previous file with comments | « lib/src/command/list_package_dirs.dart ('k') | lib/src/command_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698