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

Unified Diff: lib/src/runner/browser/compiler_pool.dart

Issue 2184543002: Use the package_resolver package. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/runner/browser/platform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/compiler_pool.dart
diff --git a/lib/src/runner/browser/compiler_pool.dart b/lib/src/runner/browser/compiler_pool.dart
index 6503db516f75d4ff5f3665ae45982bb4237955f9..39b32f357db698302038a86389a248ad83ba82be 100644
--- a/lib/src/runner/browser/compiler_pool.dart
+++ b/lib/src/runner/browser/compiler_pool.dart
@@ -7,6 +7,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:async/async.dart';
+import 'package:package_resolver/package_resolver.dart';
import 'package:path/path.dart' as p;
import 'package:pool/pool.dart';
@@ -44,13 +45,11 @@ class CompilerPool {
/// Compile the Dart code at [dartPath] to [jsPath].
///
- /// This wraps the Dart code in the standard browser-testing wrapper. If
- /// [packageRoot] is provided, it's used as the package root for the
- /// compilation.
+ /// This wraps the Dart code in the standard browser-testing wrapper.
///
/// The returned [Future] will complete once the `dart2js` process completes
/// *and* all its output has been printed to the command line.
- Future compile(String dartPath, String jsPath, {String packageRoot}) {
+ Future compile(String dartPath, String jsPath) {
return _pool.withResource(() {
if (_closed) return null;
@@ -73,12 +72,12 @@ class CompilerPool {
var dart2jsPath = _config.dart2jsPath;
if (Platform.isWindows) dart2jsPath += '.bat';
- var args = ["--checked", wrapperPath, "--out=$jsPath"]
- ..addAll(_config.dart2jsArgs);
-
- if (packageRoot != null) {
- args.add("--package-root=${p.toUri(p.absolute(packageRoot))}");
- }
+ var args = [
+ "--checked",
+ wrapperPath,
+ "--out=$jsPath",
+ await PackageResolver.current.processArgument
+ ]..addAll(_config.dart2jsArgs);
if (_config.color) args.add("--enable-diagnostic-colors");
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/runner/browser/platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698