ensure dart2js does not compile unsupported packages (#40368)

This commit is contained in:
Jonah Williams
2019-09-12 15:25:21 -07:00
committed by GitHub
parent 1667d0caa4
commit 91af071570
47 changed files with 157 additions and 116 deletions

View File

@@ -411,8 +411,11 @@ Future<void> bootstrapDart2Js(BuildStep buildStep, String flutterWebSdk, bool pr
final AssetId dartEntrypointId = buildStep.inputId;
final AssetId moduleId = dartEntrypointId.changeExtension(moduleExtension(flutterWebPlatform));
final Module module = Module.fromJson(json.decode(await buildStep.readAsString(moduleId)));
final List<Module> allDeps = await module.computeTransitiveDependencies(buildStep, throwIfUnsupported: false)..add(module);
final List<Module> allDeps = await module.computeTransitiveDependencies(
buildStep,
throwIfUnsupported: true,
skipPlatformCheckPackages: skipPlatformCheckPackages,
)..add(module);
final ScratchSpace scratchSpace = await buildStep.fetchResource(scratchSpaceResource);
final Iterable<AssetId> allSrcs = allDeps.expand((Module module) => module.sources);
await scratchSpace.ensureAssets(allSrcs, buildStep);

View File

@@ -27,6 +27,7 @@ const Map<String, String> _kManuallyPinnedDependencies = <String, String>{
'test_api': '0.2.5', // |
'test_core': '0.2.5', // |
'vm_service_client': '0.2.6+2', // Final version before being marked deprecated.
'protobuf': '0.13.15' // TODO(jonahwilliams): remove usage and update.
};
class UpdatePackagesCommand extends FlutterCommand {