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

Unified Diff: utils/kernel-service/kernel-service.dart

Issue 2979003002: support resolving .packages in FE (Closed)
Patch Set: cl comments Created 3 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 | « tests/standalone/standalone.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/kernel-service/kernel-service.dart
diff --git a/utils/kernel-service/kernel-service.dart b/utils/kernel-service/kernel-service.dart
index cea8f86fbebf17a60ded5898dcdb164f2eb60bed..ae3410f04d754ea374197849043dc81970043180 100644
--- a/utils/kernel-service/kernel-service.dart
+++ b/utils/kernel-service/kernel-service.dart
@@ -21,7 +21,7 @@
library runtime.tools.kernel_service;
import 'dart:async' show Future;
-import 'dart:io' show File, Platform hide FileSystemEntity;
+import 'dart:io' show Platform hide FileSystemEntity;
import 'dart:isolate';
import 'dart:typed_data' show Uint8List;
@@ -44,10 +44,7 @@ Future<CompilationResult> _parseScriptInFileSystem(
{bool verbose: false, bool strongMode: false}) async {
final Uri packagesUri = (Platform.packageConfig != null)
? Uri.parse(Platform.packageConfig)
- : await _findPackagesFile(fileSystem, script);
- if (packagesUri == null) {
- throw "Could not find .packages";
- }
+ : null;
final Uri patchedSdk = Uri.base
.resolveUri(new Uri.file(Platform.resolvedExecutable))
@@ -88,25 +85,6 @@ Future<CompilationResult> _parseScriptInFileSystem(
}
}
-/// This duplicates functionality from the Loader which we can't easily
-/// access from here.
-// TODO(sigmund): delete, this should be supported by the default options in
-// package:front_end.
-Future<Uri> _findPackagesFile(FileSystem fileSystem, Uri base) async {
- var dir = new File.fromUri(base).parent;
- while (true) {
- final packagesFile = dir.uri.resolve(".packages");
- if (await fileSystem.entityForUri(packagesFile).exists()) {
- return packagesFile;
- }
- if (dir.parent.path == dir.path) {
- break;
- }
- dir = dir.parent;
- }
- return null;
-}
-
Future<CompilationResult> _processLoadRequestImpl(
String inputFilePathOrUri, FileSystem fileSystem) {
Uri scriptUri = Uri.parse(inputFilePathOrUri);
« no previous file with comments | « tests/standalone/standalone.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698