Commit f75e6074 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Minor stylistic cleanup in flutter_tools/lib/src/dart/summary.dart (#6788)

I was in here trying to figure out why we rebuild sky_services (the
answer is, because we rebuild every package we've ever downloaded, but
that's not really a problem for new users so whatever), and while I
was here I did some cleanup.
parent 8c70ad43
...@@ -27,9 +27,7 @@ void buildSkyEngineSdkSummary(String skyEnginePath, String outBundleName) { ...@@ -27,9 +27,7 @@ void buildSkyEngineSdkSummary(String skyEnginePath, String outBundleName) {
] ]
}; };
//
// Read the `_embedder.yaml` file. // Read the `_embedder.yaml` file.
//
EmbedderYamlLocator yamlLocator = new EmbedderYamlLocator(packageMap); EmbedderYamlLocator yamlLocator = new EmbedderYamlLocator(packageMap);
Map<Folder, YamlMap> embedderYamls = yamlLocator.embedderYamls; Map<Folder, YamlMap> embedderYamls = yamlLocator.embedderYamls;
if (embedderYamls.length != 1) { if (embedderYamls.length != 1) {
...@@ -38,20 +36,14 @@ void buildSkyEngineSdkSummary(String skyEnginePath, String outBundleName) { ...@@ -38,20 +36,14 @@ void buildSkyEngineSdkSummary(String skyEnginePath, String outBundleName) {
return; return;
} }
//
// Create the EmbedderSdk instance. // Create the EmbedderSdk instance.
//
EmbedderSdk sdk = new EmbedderSdk(resourceProvider, embedderYamls); EmbedderSdk sdk = new EmbedderSdk(resourceProvider, embedderYamls);
sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = true; sdk.analysisOptions = new AnalysisOptionsImpl()..strongMode = true;
//
// Gather sources. // Gather sources.
//
List<Source> sources = sdk.uris.map(sdk.mapDartUri).toList(); List<Source> sources = sdk.uris.map(sdk.mapDartUri).toList();
//
// Build. // Build.
//
List<int> bytes = new SummaryBuilder(sources, sdk.context, true).build(); List<int> bytes = new SummaryBuilder(sources, sdk.context, true).build();
String outputPath = pathos.join(skyEnginePath, outBundleName); String outputPath = pathos.join(skyEnginePath, outBundleName);
new io.File(outputPath).writeAsBytesSync(bytes); new io.File(outputPath).writeAsBytesSync(bytes);
...@@ -64,15 +56,11 @@ Future<Null> buildUnlinkedForPackages(String flutterPath) async { ...@@ -64,15 +56,11 @@ Future<Null> buildUnlinkedForPackages(String flutterPath) async {
Folder flutterFolder = provider.getFolder(flutterPath); Folder flutterFolder = provider.getFolder(flutterPath);
//
// Build in packages/. // Build in packages/.
//
Folder packagesFolder = flutterFolder.getChildAssumingFolder('packages'); Folder packagesFolder = flutterFolder.getChildAssumingFolder('packages');
await _buildUnlinkedForDirectChildren(manager, packagesFolder); await _buildUnlinkedForDirectChildren(manager, packagesFolder);
//
// Build in bin/cache/pkg/. // Build in bin/cache/pkg/.
//
Folder pkgFolder = flutterFolder Folder pkgFolder = flutterFolder
.getChildAssumingFolder('bin') .getChildAssumingFolder('bin')
.getChildAssumingFolder('cache') .getChildAssumingFolder('cache')
...@@ -81,16 +69,19 @@ Future<Null> buildUnlinkedForPackages(String flutterPath) async { ...@@ -81,16 +69,19 @@ Future<Null> buildUnlinkedForPackages(String flutterPath) async {
} }
Future<Null> _buildUnlinkedForDirectChildren( Future<Null> _buildUnlinkedForDirectChildren(
PubSummaryManager manager, Folder packagesFolder) async { PubSummaryManager manager,
Folder packagesFolder
) async {
for (Resource child in packagesFolder.getChildren()) { for (Resource child in packagesFolder.getChildren()) {
if (child is Folder) { if (child is Folder)
await _buildUnlinkedForPackage(manager, child); await _buildUnlinkedForPackage(manager, child);
}
} }
} }
Future<Null> _buildUnlinkedForPackage( Future<Null> _buildUnlinkedForPackage(
PubSummaryManager manager, Folder packageFolder) async { PubSummaryManager manager,
Folder packageFolder
) async {
if (packageFolder.exists) { if (packageFolder.exists) {
String name = packageFolder.shortName; String name = packageFolder.shortName;
File pubspecFile = packageFolder.getChildAssumingFile('pubspec.yaml'); File pubspecFile = packageFolder.getChildAssumingFile('pubspec.yaml');
......
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