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

Unified Diff: pkg/compiler/lib/compiler.dart

Issue 1162363004: Support Package Resolution Configuration files. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « DEPS ('k') | pkg/compiler/lib/src/apiimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/compiler.dart
diff --git a/pkg/compiler/lib/compiler.dart b/pkg/compiler/lib/compiler.dart
index 3db762d3e780c341f3d7b62cb0647a14350116f4..710ad444d61a817b96096f7ab408a60bdff77980 100644
--- a/pkg/compiler/lib/compiler.dart
+++ b/pkg/compiler/lib/compiler.dart
@@ -5,6 +5,7 @@
library compiler;
import 'dart:async';
+import 'package:package_config/packages.dart';
import 'src/apiimpl.dart';
// Unless explicitly allowed, passing [:null:] for any argument to the
@@ -58,13 +59,19 @@ typedef EventSink<String> CompilerOutputProvider(String name,
* [:null:]. If [uri] is not [:null:], neither are [begin] and
* [end]. [uri] indicates the compilation unit from where the
* diagnostic originates. [begin] and [end] are zero-based character
- * offsets from the beginning of the compilaton unit. [message] is the
+ * offsets from the beginning of the compilation unit. [message] is the
* diagnostic message, and [kind] indicates indicates what kind of
* diagnostic it is.
*/
typedef void DiagnosticHandler(Uri uri, int begin, int end,
String message, Diagnostic kind);
+/**
+ * Provides a package lookup mechanism in the case that no package root or
+ * package resolution configuration file are explicitly specified.
+ */
+typedef Future<Packages> PackagesDiscoveryProvider(Uri uri);
+
/// Information resulting from the compilation.
class CompilationResult {
/// `true` if the compilation succeeded, that is, compilation didn't fail due
@@ -103,7 +110,9 @@ Future<CompilationResult> compile(
DiagnosticHandler handler,
[List<String> options = const [],
CompilerOutputProvider outputProvider,
- Map<String, dynamic> environment = const {}]) {
+ Map<String, dynamic> environment = const {},
+ Uri packageConfig,
+ PackagesDiscoveryProvider packagesDiscoveryProvider]) {
if (!libraryRoot.path.endsWith("/")) {
throw new ArgumentError("libraryRoot must end with a /");
}
@@ -118,7 +127,9 @@ Future<CompilationResult> compile(
libraryRoot,
packageRoot,
options,
- environment);
+ environment,
+ packageConfig,
+ packagesDiscoveryProvider);
return compiler.run(script).then((bool success) {
return new CompilationResult(compiler, isSuccess: success);
});
« no previous file with comments | « DEPS ('k') | pkg/compiler/lib/src/apiimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698