From db901ce5dd259aecef084432036ba3a75ccb9871 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 6 Feb 2020 13:59:18 -0800 Subject: [PATCH] [flutter_tools] remove dependencies checks that are no longer relevant in assemble-land (#50225) --- .../flutter_tools/lib/src/base/build.dart | 33 ------------------- .../build_system/targets/dart_test.dart | 14 +------- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index 370e7503c8..940f4e6f25 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -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 inputPaths = [uiPath, vmServicePath, mainPath]; - final Set outputPaths = {}; final List genSnapshotArgs = [ '--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 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. diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart index 590887d3ae..1afc129a03 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart @@ -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 paths = [ - 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),