Unverified Commit db901ce5 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] remove dependencies checks that are no longer relevant in assemble-land (#50225)

parent 69ecca55
......@@ -10,7 +10,6 @@ import '../artifacts.dart';
import '../build_info.dart';
import '../bundle.dart';
import '../compile.dart';
import '../dart/package_map.dart';
import '../globals.dart' as globals;
import '../macos/xcode.dart';
import '../project.dart';
......@@ -109,22 +108,9 @@ class AOTSnapshotter {
// TODO(cbracken): replace IOSArch with TargetPlatform.ios_{armv7,arm64}.
assert(platform != TargetPlatform.ios || darwinArch != null);
final PackageMap packageMap = PackageMap(packagesPath);
final String packageMapError = packageMap.checkValid();
if (packageMapError != null) {
globals.printError(packageMapError);
return 1;
}
final Directory outputDir = globals.fs.directory(outputPath);
outputDir.createSync(recursive: true);
final String skyEnginePkg = _getPackagePath(packageMap, 'sky_engine');
final String uiPath = globals.fs.path.join(skyEnginePkg, 'lib', 'ui', 'ui.dart');
final String vmServicePath = globals.fs.path.join(skyEnginePkg, 'sdk_ext', 'vmservice_io.dart');
final List<String> inputPaths = <String>[uiPath, vmServicePath, mainPath];
final Set<String> outputPaths = <String>{};
final List<String> genSnapshotArgs = <String>[
'--deterministic',
];
......@@ -136,13 +122,11 @@ class AOTSnapshotter {
final String assembly = globals.fs.path.join(outputDir.path, 'snapshot_assembly.S');
if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin_x64) {
// Assembly AOT snapshot.
outputPaths.add(assembly);
genSnapshotArgs.add('--snapshot_kind=app-aot-assembly');
genSnapshotArgs.add('--assembly=$assembly');
genSnapshotArgs.add('--strip');
} else {
final String aotSharedLibrary = globals.fs.path.join(outputDir.path, 'app.so');
outputPaths.add(aotSharedLibrary);
genSnapshotArgs.add('--snapshot_kind=app-aot-elf');
genSnapshotArgs.add('--elf=$aotSharedLibrary');
genSnapshotArgs.add('--strip');
......@@ -181,13 +165,6 @@ class AOTSnapshotter {
genSnapshotArgs.add(mainPath);
// TODO(jonahwilliams): fully remove input checks once all callers are
// using assemble.
final Iterable<String> missingInputs = inputPaths.where((String p) => !globals.fs.isFileSync(p));
if (missingInputs.isNotEmpty) {
globals.printTrace('Missing input files: $missingInputs from $inputPaths');
}
final SnapshotType snapshotType = SnapshotType(platform, buildMode);
final int genSnapshotExitCode =
await _timedStep('snapshot(CompileTime)', 'aot-snapshot',
......@@ -201,12 +178,6 @@ class AOTSnapshotter {
return genSnapshotExitCode;
}
// Write path to gen_snapshot, since snapshots have to be re-generated when we roll
// the Dart SDK.
// TODO(jonahwilliams): remove when all callers are using assemble.
final String genSnapshotPath = GenSnapshot.getSnapshotterPath(snapshotType);
outputDir.childFile('gen_snapshot.d').writeAsStringSync('gen_snapshot.d: $genSnapshotPath\n');
// On iOS and macOS, we use Xcode to compile the snapshot into a dynamic library that the
// end-developer can link into their app.
if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin_x64) {
......@@ -354,10 +325,6 @@ class AOTSnapshotter {
].contains(platform);
}
String _getPackagePath(PackageMap packageMap, String package) {
return globals.fs.path.dirname(globals.fs.path.fromUri(packageMap.map[package]));
}
/// This method is used to measure duration of an action and emit it into
/// verbose output from flutter_tool for other tools (e.g. benchmark runner)
/// to find.
......
......@@ -63,22 +63,10 @@ void main() {
} else {
assert(false);
}
final String skyEngineLine = globals.platform.isWindows
? r'sky_engine:file:///C:/bin/cache/pkg/sky_engine/lib/'
: 'sky_engine:file:///bin/cache/pkg/sky_engine/lib/';
globals.fs.file('.packages')
..createSync()
..writeAsStringSync('''
# Generated
$skyEngineLine
flutter_tools:lib/''');
final String engineArtifacts = globals.fs.path.join('bin', 'cache',
'artifacts', 'engine');
final List<String> paths = <String>[
globals.fs.path.join('bin', 'cache', 'pkg', 'sky_engine', 'lib', 'ui',
'ui.dart'),
globals.fs.path.join('bin', 'cache', 'pkg', 'sky_engine', 'sdk_ext',
'vmservice_io.dart'),
globals.fs.path.join('bin', 'cache', 'dart-sdk', 'bin', 'dart'),
globals.fs.path.join('bin', 'cache', 'dart-sdk', 'bin', 'dart.exe'),
globals.fs.path.join(engineArtifacts, getNameForHostPlatform(hostPlatform),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment