From d27cd520de24a5b1180354825d2d93d04181ae6c Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 23 May 2018 18:32:01 -0700 Subject: [PATCH] Don't link the core snapshot in the Android engine. (#17855) Allows one to use a different core snapshot without a custom engine build by just packaging a different one in the APK. --- bin/internal/engine.version | 2 +- packages/flutter_tools/lib/src/bundle.dart | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/internal/engine.version b/bin/internal/engine.version index a2ffe89520..35cc645581 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -8f7a59b529d9397970770a29b9dfe042c12ddc54 +86d96fd0ce8d58d2dfcd4398eb97aa66873d3bf7 diff --git a/packages/flutter_tools/lib/src/bundle.dart b/packages/flutter_tools/lib/src/bundle.dart index 7218d7d9ab..1844c678e5 100644 --- a/packages/flutter_tools/lib/src/bundle.dart +++ b/packages/flutter_tools/lib/src/bundle.dart @@ -25,6 +25,8 @@ const String defaultPrivateKeyPath = 'privatekey.der'; const String _kKernelKey = 'kernel_blob.bin'; const String _kSnapshotKey = 'snapshot_blob.bin'; +const String _kVMSnapshotData = 'vm_snapshot_data'; +const String _kIsolateSnapshotData = 'isolate_snapshot_data'; const String _kDylibKey = 'libapp.so'; const String _kPlatformKernelKey = 'platform.dill'; @@ -150,14 +152,21 @@ Future assemble({ printTrace('Building bundle'); final Map assetEntries = new Map.from(assetBundle.entries); + final String vmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData); + final String isolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData); if (kernelContent != null) { final String platformKernelDill = artifacts.getArtifactPath(Artifact.platformKernelDill); assetEntries[_kKernelKey] = kernelContent; assetEntries[_kPlatformKernelKey] = new DevFSFileContent(fs.file(platformKernelDill)); + assetEntries[_kVMSnapshotData] = new DevFSFileContent(fs.file(vmSnapshotData)); + assetEntries[_kIsolateSnapshotData] = new DevFSFileContent(fs.file(isolateSnapshotData)); } - if (snapshotFile != null) + if (snapshotFile != null) { assetEntries[_kSnapshotKey] = new DevFSFileContent(snapshotFile); + assetEntries[_kVMSnapshotData] = new DevFSFileContent(fs.file(vmSnapshotData)); + assetEntries[_kIsolateSnapshotData] = new DevFSFileContent(fs.file(isolateSnapshotData)); + } if (dylibFile != null) assetEntries[_kDylibKey] = new DevFSFileContent(dylibFile);