committed by
GitHub
parent
e2dccc5e48
commit
906103dd10
@@ -1 +1 @@
|
||||
f9c1f5fa539fdfcbcae65a1dd09d1d05949da459
|
||||
6e54f5e31f084d2e54a510959f68b89e4d2fdffd
|
||||
|
||||
@@ -18,7 +18,6 @@ enum Artifact {
|
||||
dartVmEntryPointsAndroidTxt,
|
||||
genSnapshot,
|
||||
skyShell,
|
||||
skySnapshot,
|
||||
snapshotDart,
|
||||
flutterFramework,
|
||||
vmSnapshotData,
|
||||
@@ -43,8 +42,6 @@ String _artifactToFileName(Artifact artifact) {
|
||||
return 'dart_vm_entry_points_android.txt';
|
||||
case Artifact.genSnapshot:
|
||||
return 'gen_snapshot';
|
||||
case Artifact.skySnapshot:
|
||||
return 'sky_snapshot';
|
||||
case Artifact.skyShell:
|
||||
return 'sky_shell';
|
||||
case Artifact.snapshotDart:
|
||||
@@ -144,18 +141,17 @@ class CachedArtifacts extends Artifacts {
|
||||
|
||||
String _getHostArtifactPath(Artifact artifact, TargetPlatform platform) {
|
||||
switch (artifact) {
|
||||
case Artifact.genSnapshot:
|
||||
// For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for
|
||||
// android_arm in profile mode because it is available on all supported host platforms.
|
||||
return _getAndroidArtifactPath(artifact, TargetPlatform.android_arm, BuildMode.profile);
|
||||
case Artifact.skyShell:
|
||||
case Artifact.skySnapshot:
|
||||
if (platform == TargetPlatform.windows_x64)
|
||||
throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.');
|
||||
continue returnResourcePath;
|
||||
case Artifact.genSnapshot:
|
||||
continue fallThrough;
|
||||
fallThrough:
|
||||
case Artifact.vmSnapshotData:
|
||||
case Artifact.isolateSnapshotData:
|
||||
if (platform != TargetPlatform.windows_x64)
|
||||
throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.');
|
||||
continue returnResourcePath;
|
||||
returnResourcePath:
|
||||
case Artifact.icudtlDat:
|
||||
final String engineArtifactsPath = cache.getArtifactDirectory('engine').path;
|
||||
final String platformDirName = getNameForTargetPlatform(platform);
|
||||
@@ -228,8 +224,6 @@ class LocalEngineArtifacts extends Artifacts {
|
||||
return _genSnapshotPath(platform);
|
||||
case Artifact.skyShell:
|
||||
return _skyShellPath(platform);
|
||||
case Artifact.skySnapshot:
|
||||
return _skySnapshotPath();
|
||||
case Artifact.isolateSnapshotData:
|
||||
case Artifact.vmSnapshotData:
|
||||
return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact));
|
||||
@@ -256,13 +250,6 @@ class LocalEngineArtifacts extends Artifacts {
|
||||
return fs.path.join(engineOutPath, clang, _artifactToFileName(Artifact.genSnapshot));
|
||||
}
|
||||
|
||||
String _skySnapshotPath() {
|
||||
final String clangPath = fs.path.join(engineOutPath, 'clang_x64', _artifactToFileName(Artifact.skySnapshot));
|
||||
if (fs.isFileSync(clangPath))
|
||||
return clangPath;
|
||||
return fs.path.join(engineOutPath, _artifactToFileName(Artifact.skySnapshot));
|
||||
}
|
||||
|
||||
String _skyShellPath(TargetPlatform platform) {
|
||||
if (getCurrentHostPlatform() == HostPlatform.linux_x64) {
|
||||
return fs.path.join(engineOutPath, _artifactToFileName(Artifact.skyShell));
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'artifacts.dart';
|
||||
import 'asset.dart';
|
||||
import 'base/common.dart';
|
||||
import 'base/file_system.dart';
|
||||
import 'base/platform.dart';
|
||||
import 'base/process.dart';
|
||||
import 'build_info.dart';
|
||||
import 'dart/package_map.dart';
|
||||
@@ -33,52 +32,6 @@ Future<int> createSnapshot({
|
||||
String snapshotPath,
|
||||
String depfilePath,
|
||||
String packages
|
||||
}) {
|
||||
if (platform.isWindows) {
|
||||
return _creteScriptSnapshotWithGenSnapshot(
|
||||
mainPath: mainPath,
|
||||
snapshotPath: snapshotPath,
|
||||
depfilePath: depfilePath,
|
||||
packages: packages
|
||||
);
|
||||
}
|
||||
return _createScriptSnapshotWithSkySnapshot(
|
||||
mainPath: mainPath,
|
||||
snapshotPath: snapshotPath,
|
||||
depfilePath: depfilePath,
|
||||
packages: packages
|
||||
);
|
||||
}
|
||||
|
||||
Future<int> _createScriptSnapshotWithSkySnapshot({
|
||||
String mainPath,
|
||||
String snapshotPath,
|
||||
String depfilePath,
|
||||
String packages
|
||||
}) {
|
||||
assert(mainPath != null);
|
||||
assert(snapshotPath != null);
|
||||
assert(packages != null);
|
||||
final String snapshotterPath = artifacts.getArtifactPath(Artifact.skySnapshot);
|
||||
|
||||
final List<String> args = <String>[
|
||||
snapshotterPath,
|
||||
'--packages=$packages',
|
||||
'--snapshot=$snapshotPath'
|
||||
];
|
||||
if (depfilePath != null) {
|
||||
args.add('--depfile=$depfilePath');
|
||||
args.add('--build-output=$snapshotPath');
|
||||
}
|
||||
args.add(mainPath);
|
||||
return runCommandAndStreamOutput(args);
|
||||
}
|
||||
|
||||
Future<int> _creteScriptSnapshotWithGenSnapshot({
|
||||
String mainPath,
|
||||
String snapshotPath,
|
||||
String depfilePath,
|
||||
String packages
|
||||
}) {
|
||||
assert(mainPath != null);
|
||||
assert(snapshotPath != null);
|
||||
|
||||
Reference in New Issue
Block a user