Isolate imports of generated Dart code from generated path (#5960)

This rewrites imports of various mojom.dart files from the Flutter
engine repo to instead import normal-looking dart files from the
(new) flutter_services package. This package handles exporting the
correct symbols from generated code wherever that may live.

Includes an engine roll to 3551e7a48e2e336777b15c7637af92fd7605b6c5
which contains the new flutter_services package.
This commit is contained in:
James Robinson
2016-09-21 14:00:29 -07:00
committed by GitHub
parent f0d2f5c58a
commit a95c9fdb58
40 changed files with 62 additions and 65 deletions

View File

@@ -242,13 +242,14 @@ class FlutterEngine {
FlutterEngine(this.cache);
static const String kName = 'engine';
static const String kFlutterServices = 'flutter_services';
static const String kSkyEngine = 'sky_engine';
static const String kSkyServices = 'sky_services';
static const String kSdkBundle = 'sdk.ds';
final Cache cache;
List<String> _getPackageDirs() => const <String>[kSkyEngine, kSkyServices];
List<String> _getPackageDirs() => const <String>[kSkyEngine, kSkyServices, kFlutterServices];
List<String> _getEngineDirs() {
List<String> dirs = <String>[
@@ -341,9 +342,9 @@ class FlutterEngine {
Status summaryStatus = logger.startProgress('Building Dart SDK summary...');
try {
String flutterServicesPath = path.join(pkgDir.path, kFlutterServices);
String skyEnginePath = path.join(pkgDir.path, kSkyEngine);
String skyServicesPath = path.join(pkgDir.path, kSkyServices);
buildSkyEngineSdkSummary(skyEnginePath, skyServicesPath, kSdkBundle);
buildSkyEngineSdkSummary(skyEnginePath, flutterServicesPath, kSdkBundle);
} finally {
summaryStatus.stop(showElapsedTime: true);
}

View File

@@ -203,12 +203,6 @@ class AnalyzeCommand extends FlutterCommand {
}
Map<String, String> packages = dependencies.asPackageMap();
// override the sky_engine and sky_services packages if the user is using a local build
if (tools.engineBuildPath != null) {
packages['sky_engine'] = path.join(tools.engineBuildPath, 'gen/dart-pkg/sky_engine/lib');
packages['sky_services'] = path.join(tools.engineBuildPath, 'gen/dart-pkg/sky_services/lib');
}
Cache.releaseLockEarly();
if (argResults['preamble']) {

View File

@@ -71,6 +71,8 @@ class PackagesGetCommand extends FlutterCommand {
return 1;
}
// TODO: If the user is using a local build, we should use the packages from their build instead of the cache.
return pubGet(directory: target, upgrade: upgrade, checkLastModified: false);
}
}

View File

@@ -17,18 +17,18 @@ import 'package:package_config/packages.dart';
import 'package:path/path.dart' as pathos;
import 'package:yaml/src/yaml_node.dart'; // ignore: implementation_imports
/// Given the [skyEnginePath] and [skyServicesPath], locate corresponding
/// Given the [skyEnginePath] and [flutterServicesPath], locate corresponding
/// `_embedder.yaml` and `_sdkext`, compose the full embedded Dart SDK, and
/// build the [outBundleName] file with its linked summary.
void buildSkyEngineSdkSummary(
String skyEnginePath, String skyServicesPath, String outBundleName) {
String skyEnginePath, String flutterServicesPath, String outBundleName) {
ResourceProvider resourceProvider = PhysicalResourceProvider.INSTANCE;
ContextBuilder builder = new ContextBuilder(resourceProvider, null, null);
Packages packages = builder.createPackageMap(skyServicesPath);
Packages packages = builder.createPackageMap(flutterServicesPath);
Map<String, List<Folder>> packageMap = builder.convertPackagesToMap(packages);
if (packageMap == null) {
printError('The expected .packages was not found in $skyServicesPath.');
printError('The expected .packages was not found in $flutterServicesPath.');
return;
}
packageMap['sky_engine'] = <Folder>[