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

Unified Diff: tools/patch_sdk.dart

Issue 2938903003: Add a vmservice_sdk directory in runtime/bin. (Closed)
Patch Set: Compile dart:vmservice_io only if forVm Created 3 years, 6 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 | « runtime/bin/vmservice_sdk/lib/libraries.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/patch_sdk.dart
diff --git a/tools/patch_sdk.dart b/tools/patch_sdk.dart
index bd6654fc0a75f6559a333eac2f82d4e43e240dbb..3ff5d4828b2bca8ce046143d8cba024b086a60f6 100644
--- a/tools/patch_sdk.dart
+++ b/tools/patch_sdk.dart
@@ -120,25 +120,33 @@ Future _main(List<String> argv) async {
librariesJson.toFilePath(), JSON.encode({"libraries": locations}));
if (forVm || forFlutter) {
- var vmserviceName = forVm ? 'vmservice_io' : 'vmservice_sky';
- var targetName = forVm ? 'vm_fasta' : 'flutter_fasta';
- Uri vmserviceUri = outDirUri.resolve('$vmserviceName.dill');
await fasta.compilePlatform(outDirUri, platform,
packages: packages,
outlineOutput: outline,
backendTarget: forVm ? 'vm_fasta' : 'flutter_fasta');
+ } else {
+ await dart2js.compilePlatform(outDirUri, platform,
+ packages: packages, outlineOutput: outline);
+ }
+
+ if (forVm) {
+ var base = path.fromUri(Platform.script);
+ Uri repositoryDir =
+ new Uri.directory(path.dirname(path.dirname(path.absolute(base))));
+ var vmserviceName = 'vmservice_io';
+ Uri vmserviceSdk = repositoryDir.resolve('runtime/bin/vmservice_sdk/');
+ Uri vmserviceUri = outDirUri.resolve('$vmserviceName.dill');
+ // TODO(sigmundch): Specify libraries.json directly instead of "--sdk"
+ // after #29882 is fixed.
await fasta.compile([
- "--sdk=$outDirUri",
+ "--sdk=$vmserviceSdk",
"--platform=$outline",
- "--target=$targetName",
+ "--target=vm_fasta",
"--packages=$packages",
"dart:$vmserviceName",
"-o",
"$vmserviceUri",
]);
- } else {
- await dart2js.compilePlatform(outDirUri, platform,
- packages: packages, outlineOutput: outline);
}
Uri platformFinalLocation = outDirUri.resolve('platform.dill');
@@ -243,16 +251,6 @@ _copyExtraLibraries(String sdkOut, Map<String, String> locations) {
_writeSync(builtinLibraryOut, readInputFile(builtinLibraryIn));
locations['_builtin'] = path.join('_builtin', '_builtin.dart');
- for (var file in ['loader.dart', 'server.dart', 'vmservice_io.dart']) {
- var libraryIn = path.join(dartDir, 'runtime', 'bin', 'vmservice', file);
- var libraryOut = path.join(sdkOut, 'vmservice_io', file);
- _writeSync(libraryOut, readInputFile(libraryIn));
- }
-
- locations[forVm ? "vmservice_io" : "vmservice_sky"] =
- path.join('vmservice_io', 'vmservice_io.dart');
- locations["_vmservice"] = path.join('vmservice', 'vmservice.dart');
-
if (forFlutter) {
// Flutter repo has this layout:
// engine/src/
« no previous file with comments | « runtime/bin/vmservice_sdk/lib/libraries.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698