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.
This commit is contained in:
Ryan Macnak 2018-05-23 18:32:01 -07:00 committed by GitHub
parent bf0f4e6b2e
commit d27cd520de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -1 +1 @@
8f7a59b529d9397970770a29b9dfe042c12ddc54
86d96fd0ce8d58d2dfcd4398eb97aa66873d3bf7

View file

@ -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<void> assemble({
printTrace('Building bundle');
final Map<String, DevFSContent> assetEntries = new Map<String, DevFSContent>.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);