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

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

Issue 2009163003: Add support for --dart2js-path and --dart2js-args. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 5f45825de230615b3f1dceace11330b8ec07b4ab..cb240f41d98fe83ed273f4ba100035968a456309 100644
--- a/lib/src/runner/browser/compiler_pool.dart
+++ b/lib/src/runner/browser/compiler_pool.dart
@@ -11,6 +11,7 @@ import 'package:path/path.dart' as p;
import 'package:pool/pool.dart';
import '../../util/io.dart';
+import '../configuration.dart';
import '../load_exception.dart';
/// A pool of `dart2js` instances.
@@ -20,8 +21,8 @@ class CompilerPool {
/// The internal pool that controls the number of process running at once.
final Pool _pool;
- /// Whether to enable colors on dart2js.
- final bool _color;
+ /// The test runner configuration.
+ final Configuration _config;
/// The currently-active dart2js processes.
final _processes = new Set<Process>();
@@ -32,15 +33,10 @@ class CompilerPool {
/// The memoizer for running [close] exactly once.
final _closeMemo = new AsyncMemoizer();
- /// Creates a compiler pool that runs up to [concurrency] instances of
- /// `dart2js` at once.
- ///
- /// If [concurrency] isn't provided, it defaults to 4.
- ///
- /// If [color] is true, `dart2js` will be run with colors enabled.
- CompilerPool({int concurrency, bool color: false})
- : _pool = new Pool(concurrency == null ? 4 : concurrency),
- _color = color;
+ /// Creates a compiler pool that multiple instances of `dart2js` at once.
+ CompilerPool(Configuration config)
+ : _pool = new Pool(config.concurrency),
+ _config = config;
/// Compile the Dart code at [dartPath] to [jsPath].
///
@@ -70,16 +66,17 @@ class CompilerPool {
}
''');
- var dart2jsPath = p.join(sdkDir, 'bin', 'dart2js');
+ var dart2jsPath = _config.dart2jsPath;
if (Platform.isWindows) dart2jsPath += '.bat';
- var args = ["--checked", wrapperPath, "--out=$jsPath"];
+ var args = ["--checked", wrapperPath, "--out=$jsPath"]
+ ..addAll(_config.dart2jsArgs);
if (packageRoot != null) {
args.add("--package-root=${p.toUri(p.absolute(packageRoot))}");
}
- if (_color) args.add("--enable-diagnostic-colors");
+ if (_config.color) args.add("--enable-diagnostic-colors");
var process = await Process.start(dart2jsPath, args);
if (_closed) {
« no previous file with comments | « no previous file | lib/src/runner/browser/platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698