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

Unified Diff: pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart

Issue 2995913002: Update incremental load example so you can point to different sdk (Closed)
Patch Set: Use options.rest Created 3 years, 4 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/example/incremental_reload/run.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart
diff --git a/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart b/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart
index b725d76460c9696adf60f097f4db654180a1c3e1..a62aabc62d33bca424d8b9024af2906b245c0ec3 100644
--- a/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart
+++ b/pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart
@@ -16,22 +16,22 @@ import 'package:front_end/src/byte_store/file_byte_store.dart';
import 'package:front_end/src/byte_store/byte_store.dart';
import 'package:kernel/ast.dart';
import 'package:kernel/binary/limited_ast_to_binary.dart';
+import 'package:kernel/target/targets.dart';
/// Create an instance of an [IncrementalCompiler] to compile a program whose
/// main entry point file is [entry]. This uses some default options
/// for the location of the sdk and temporary folder to save intermediate
/// results.
-// TODO(sigmund): make this example work outside of the SDK repo.
Future<IncrementalCompiler> createIncrementalCompiler(String entry,
- {bool persistent: true}) {
+ {bool persistent: true, Uri sdkRoot, Target target}) {
var entryUri = Uri.base.resolve(entry);
var dartVm = Uri.base.resolve(Platform.resolvedExecutable);
- var sdkRoot = dartVm.resolve("patched_sdk/");
var tmpDir = Directory.systemTemp.createTempSync('ikg_cache');
var options = new CompilerOptions()
- ..sdkRoot = sdkRoot
+ ..sdkRoot = sdkRoot ?? dartVm.resolve("patched_sdk/")
..packagesFileUri = Uri.base.resolve('.packages')
..strongMode = false
+ ..target = target
// Note: we do not report error on the console because the incremental
// compiler is an ongoing background service that shouldn't polute stdout.
// TODO(sigmund): do something with the errors.
« no previous file with comments | « no previous file | pkg/front_end/example/incremental_reload/run.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698