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

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

Issue 2988063002: Use dart2js_plaform.dill from the sdk. (Closed)
Patch Set: add comment about why --host-checked and --use-sdk is not supported 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 | « pkg/compiler/lib/src/kernel/kernel_strategy.dart ('k') | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 382e938ddfd7ee09f7f46450afb171706d540583..6bea483442eeb0adb0de94c71a80283b64202369 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -5,7 +5,6 @@
library dart2js.library_loader;
import 'dart:async';
-import 'dart:io' show Platform;
import 'package:front_end/front_end.dart' as fe;
import 'package:kernel/ast.dart' as ir;
@@ -824,6 +823,8 @@ class ResolutionLibraryLoaderTask extends CompilerTask
// TODO(sigmund): move this class to a new file under src/kernel/.
class KernelLibraryLoaderTask extends CompilerTask
implements LibraryLoaderTask {
+ final Uri sdkRoot;
+
final DiagnosticReporter reporter;
final api.CompilerInput compilerInput;
@@ -834,8 +835,8 @@ class KernelLibraryLoaderTask extends CompilerTask
List<LibraryEntity> _allLoadedLibraries;
- KernelLibraryLoaderTask(
- this._elementMap, this.compilerInput, this.reporter, Measurer measurer)
+ KernelLibraryLoaderTask(this.sdkRoot, this._elementMap, this.compilerInput,
+ this.reporter, Measurer measurer)
: _allLoadedLibraries = new List<LibraryEntity>(),
super(measurer);
@@ -854,19 +855,13 @@ class KernelLibraryLoaderTask extends CompilerTask
program = new ir.Program();
new BinaryBuilder(input.data).readProgram(program);
} else {
- // TODO(sigmund): remove this hack. Ship platform.dill with the SDK
- // instead.
- // Note: this logic only works on development and bot configurations,
- // but will not work when using dart2js outside the repo.
- var executableUri = new Uri.file(Platform.resolvedExecutable);
- Uri platformFile = executableUri.path.endsWith('dart-sdk/bin/dart')
- ? executableUri.resolve('../../patched_dart2js_sdk/platform.dill')
- : executableUri.resolve('patched_dart2js_sdk/platform.dill');
var options = new fe.CompilerOptions()
..fileSystem = new CompilerFileSystem(compilerInput)
..target = new Dart2jsTarget(new TargetFlags())
..compileSdk = true
- ..linkedDependencies = [platformFile]
+ ..linkedDependencies = [
+ sdkRoot.resolve('_internal/dart2js_platform.dill')
+ ]
..onError = (e) => reportFrontEndMessage(reporter, e);
program = await fe.kernelForProgram(resolvedUri, options);
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_strategy.dart ('k') | tests/compiler/dart2js_extra/dart2js_extra.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698