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

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

Issue 2894273002: Revert "First step for modular output in fasta." (Closed)
Patch Set: Created 3 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 | « pkg/compiler/lib/src/kernel/fasta_support.dart ('k') | pkg/front_end/lib/kernel_generator.dart » ('j') | no next file with comments »
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 acc4e11ffbdf9017700be8e748b7aa9639d5795e..83283fb15562d755239cee2cbcb9770eca19f006 100644
--- a/pkg/front_end/lib/compiler_options.dart
+++ b/pkg/front_end/lib/compiler_options.dart
@@ -4,12 +4,15 @@
library front_end.compiler_options;
+import 'dart:async';
+
import 'package:front_end/src/base/performace_logger.dart';
import 'package:front_end/src/incremental/byte_store.dart';
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;
@@ -147,3 +150,24 @@ class CompilerOptions {
// SDK itself.
List<Uri> additionalLibraries = [];
}
+
+Future<bool> validateOptions(CompilerOptions options) async {
+ 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 | « pkg/compiler/lib/src/kernel/fasta_support.dart ('k') | pkg/front_end/lib/kernel_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698