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

Unified Diff: pkg/front_end/lib/compiler_options.dart

Issue 2856223003: Implement the kernel_generator API using fasta (Closed)
Patch Set: Created 3 years, 8 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 | pkg/front_end/lib/kernel_generator.dart » ('j') | pkg/front_end/lib/kernel_generator.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/compiler_options.dart
diff --git a/pkg/front_end/lib/compiler_options.dart b/pkg/front_end/lib/compiler_options.dart
index 8653baa02915515c847126e816f5d9e052d1ec23..c828a38f9f04a7f33ef26873a567ba57b6655901 100644
--- a/pkg/front_end/lib/compiler_options.dart
+++ b/pkg/front_end/lib/compiler_options.dart
@@ -4,9 +4,11 @@
library front_end.compiler_options;
+import 'dart:async';
import 'compilation_error.dart';
import 'file_system.dart';
import 'physical_file_system.dart';
+import 'src/simple_error.dart';
/// Default error handler used by [CompilerOptions.onError].
void defaultErrorHandler(CompilationError error) => throw error;
@@ -134,3 +136,24 @@ class CompilerOptions {
// SDK itself.
List<Uri> additionalLibraries = [];
}
+
+Future<bool> validateOptions(CompilerOptions options) async {
Paul Berry 2017/05/03 22:22:26 These checks should be moved into ProcessedOptions
+ var fs = options.fileSystem;
+ var root = options.sdkRoot;
+
+ bool _report(String msg) {
+ options.onError(new SimpleError(msg));
+ return false;
+ }
+
+ if (root != null && !await fs.entityForUri(root).exists()) {
+ return _report("SDK root directory not found: ${options.sdkRoot}");
+ }
+
+ var summary = options.sdkSummary;
+ if (summary != null && !await fs.entityForUri(summary).exists()) {
+ return _report("SDK summary not found: ${options.sdkSummary}");
+ }
+
+ return true;
+}
« no previous file with comments | « no previous file | pkg/front_end/lib/kernel_generator.dart » ('j') | pkg/front_end/lib/kernel_generator.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698