forked from firka/flutter
Move script snapshot argumtents to Snapshotter (#16722)
This moves --vm_snapshot_data and --isolate_snapshot_data argument hardcoding from GenSnapshot (a minimal wrapper around gen_snapshot invocations) to Snapshotter.buildScriptSnapshot(). These arguments are present in both AOT and script snapshots, but differ semantically: for script snapshots they're inputs from the host engine artifacts directory, for AOT snapshots they're outputs to the build directory.
This commit is contained in:
@@ -26,6 +26,9 @@ class SnapshotType {
|
||||
|
||||
final TargetPlatform platform;
|
||||
final BuildMode mode;
|
||||
|
||||
@override
|
||||
String toString() => '$platform $mode';
|
||||
}
|
||||
|
||||
/// Interface to the gen_snapshot command-line tool.
|
||||
@@ -38,13 +41,9 @@ class GenSnapshot {
|
||||
@required String depfilePath,
|
||||
Iterable<String> additionalArgs: const <String>[],
|
||||
}) {
|
||||
final String vmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData);
|
||||
final String isolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData);
|
||||
final List<String> args = <String>[
|
||||
'--await_is_keyword',
|
||||
'--causal_async_stacks',
|
||||
'--vm_snapshot_data=$vmSnapshotData',
|
||||
'--isolate_snapshot_data=$isolateSnapshotData',
|
||||
'--packages=$packagesPath',
|
||||
'--dependencies=$depfilePath',
|
||||
'--print_snapshot_sizes',
|
||||
@@ -172,9 +171,13 @@ class Snapshotter {
|
||||
@required String packagesPath
|
||||
}) async {
|
||||
final SnapshotType snapshotType = new SnapshotType(null, BuildMode.debug);
|
||||
final String vmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData);
|
||||
final String isolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData);
|
||||
final List<String> args = <String>[
|
||||
'--snapshot_kind=script',
|
||||
'--script_snapshot=$snapshotPath',
|
||||
'--vm_snapshot_data=$vmSnapshotData',
|
||||
'--isolate_snapshot_data=$isolateSnapshotData',
|
||||
'--enable-mirrors=false',
|
||||
mainPath,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user