Commit a95c9fdb authored by James Robinson's avatar James Robinson Committed by GitHub

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.
parent f0d2f5c5
1b73d4d06f2bfda32b07ae4e73729c8e8ed7695c
3551e7a48e2e336777b15c7637af92fd7605b6c5
......@@ -4,7 +4,7 @@
import 'package:flutter/material.dart';
import 'package:sky_services/sky/input_event.mojom.dart' as mojom;
import 'package:flutter_services/input_event.dart' as mojom;
GlobalKey _key = new GlobalKey();
......
......@@ -10,7 +10,7 @@ import 'dart:typed_data';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
import 'package:sky_services/pointer/pointer.mojom.dart';
import 'package:flutter_services/pointer.dart';
ui.Color color;
......
......@@ -4,7 +4,7 @@
import 'dart:async';
import 'package:sky_services/media/media.mojom.dart' as mojom;
import 'package:flutter_services/media.dart' as mojom;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
......
......@@ -10,7 +10,7 @@ import 'dart:ui' as ui show window;
import 'package:flutter/foundation.dart';
import 'package:mojo/bindings.dart' as mojo_bindings;
import 'package:mojo/core.dart' as mojo_core;
import 'package:sky_services/pointer/pointer.mojom.dart';
import 'package:flutter_services/pointer.dart';
import 'arena.dart';
import 'converter.dart';
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky_services/pointer/pointer.mojom.dart' as mojom;
import 'package:flutter_services/pointer.dart' as mojom;
import 'events.dart';
......
......@@ -4,7 +4,7 @@
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:sky_services/flutter/platform/system_chrome.mojom.dart' as mojom;
import 'package:flutter_services/platform/system_chrome.dart' as mojom;
import 'constants.dart';
import 'icon_theme.dart';
......
......@@ -14,7 +14,7 @@ import 'material.dart';
import 'text_selection.dart';
import 'theme.dart';
export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
export 'package:flutter_services/editing.dart' show KeyboardType;
/// A material design text input field.
///
......
......@@ -10,7 +10,7 @@ import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:meta/meta.dart';
import 'package:mojo/core.dart' as core;
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
import 'box.dart';
import 'debug.dart';
......
......@@ -7,13 +7,13 @@ import 'dart:collection';
import 'dart:ui' as ui;
import 'package:flutter/services.dart';
import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as mojom;
import 'package:mojo_services/mojo/ui/view_containers.mojom.dart' as mojom;
import 'package:mojo_services/mojo/ui/view_provider.mojom.dart' as mojom;
import 'package:mojo_services/mojo/ui/view_properties.mojom.dart' as mojom;
import 'package:mojo_services/mojo/ui/view_token.mojom.dart' as mojom;
import 'package:mojo_services/mojo/ui/views.mojom.dart' as mojom;
import 'package:mojo_services/mojo/geometry.mojom.dart' as mojom;
import 'package:flutter_services/mojo/gfx/composition/scene_token.dart' as mojom;
import 'package:flutter_services/mojo/ui/view_containers.dart' as mojom;
import 'package:flutter_services/mojo/ui/view_provider.dart' as mojom;
import 'package:flutter_services/mojo/ui/view_properties.dart' as mojom;
import 'package:flutter_services/mojo/ui/view_token.dart' as mojom;
import 'package:flutter_services/mojo/ui/views.dart' as mojom;
import 'package:flutter_services/mojo/geometry.dart' as mojom;
import 'package:mojo/application.dart';
import 'package:mojo/core.dart' as core;
import 'package:mojo/mojo/service_provider.mojom.dart' as mojom;
......
......@@ -8,7 +8,7 @@ import 'dart:ui' show Offset;
import 'package:flutter/painting.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:meta/meta.dart';
import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as mojom;
import 'package:flutter_services/mojo/gfx/composition/scene_token.dart' as mojom;
import 'debug.dart';
......
......@@ -10,7 +10,7 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/scheduler.dart';
import 'package:meta/meta.dart';
import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as mojom;
import 'package:flutter_services/mojo/gfx/composition/scene_token.dart' as mojom;
import 'package:vector_math/vector_math_64.dart';
import 'debug.dart';
......
......@@ -8,7 +8,7 @@ import 'dart:ui' show Rect;
import 'package:flutter/foundation.dart';
import 'package:flutter/painting.dart';
import 'package:meta/meta.dart';
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
import 'package:vector_math/vector_math_64.dart';
import 'node.dart';
......
......@@ -4,11 +4,11 @@
import 'dart:ui';
import 'package:sky_services/activity/activity.mojom.dart';
import 'package:flutter_services/activity.dart';
import 'shell.dart';
export 'package:sky_services/activity/activity.mojom.dart' show Activity, Intent, ComponentName, StringExtra;
export 'package:flutter_services/activity.dart' show Activity, Intent, ComponentName, StringExtra;
// Dart wrapper around Activity mojo service available in Flutter on Android.
......
......@@ -11,7 +11,7 @@ import 'dart:typed_data';
import 'package:flutter/foundation.dart';
import 'package:flutter/http.dart' as http;
import 'package:mojo/core.dart' as core;
import 'package:mojo_services/mojo/asset_bundle/asset_bundle.mojom.dart' as mojom;
import 'package:flutter_services/mojo/asset_bundle/asset_bundle.dart' as mojom;
/// A collection of resources used by the application.
///
......
......@@ -4,11 +4,11 @@
import 'dart:async';
import 'package:sky_services/editing/editing.mojom.dart' as mojom;
import 'package:flutter_services/editing.dart' as mojom;
import 'shell.dart';
export 'package:sky_services/editing/editing.mojom.dart' show ClipboardData;
export 'package:flutter_services/editing.dart' show ClipboardData;
mojom.ClipboardProxy _initClipboardProxy() {
return shell.connectToApplicationService('mojo:clipboard', mojom.Clipboard.connectToService);
......
......@@ -4,7 +4,7 @@
import 'dart:async';
import 'package:sky_services/flutter/platform/haptic_feedback.mojom.dart' as mojom;
import 'package:flutter_services/platform/haptic_feedback.dart' as mojom;
import 'shell.dart';
......
......@@ -6,7 +6,7 @@ import 'dart:async';
import 'dart:convert';
import 'package:mojo/core.dart' as core;
import 'package:sky_services/flutter/platform/app_messages.mojom.dart' as mojom;
import 'package:flutter_services/platform/app_messages.dart' as mojom;
import 'shell.dart';
......
......@@ -4,11 +4,11 @@
import 'dart:async';
import 'package:sky_services/editing/editing.mojom.dart' as mojom;
import 'package:flutter_services/editing.dart' as mojom;
import 'shell.dart';
export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
export 'package:flutter_services/editing.dart' show KeyboardType;
/// An interface to the system's keyboard.
///
......
......@@ -5,7 +5,7 @@
import 'dart:async';
import 'dart:io';
import 'package:sky_services/flutter/platform/path_provider.mojom.dart' as mojom;
import 'package:flutter_services/platform/path_provider.dart' as mojom;
import 'shell.dart';
......
......@@ -4,13 +4,13 @@
import 'dart:async';
import 'package:sky_services/flutter/platform/system_chrome.mojom.dart' as mojom;
import 'package:sky_services/flutter/platform/system_chrome.mojom.dart'
import 'package:flutter_services/platform/system_chrome.dart' as mojom;
import 'package:flutter_services/platform/system_chrome.dart'
show DeviceOrientation, SystemUiOverlay, SystemUiOverlayStyle;
import 'shell.dart';
export 'package:sky_services/flutter/platform/system_chrome.mojom.dart'
export 'package:flutter_services/platform/system_chrome.dart'
show DeviceOrientation, SystemUiOverlay, SystemUiOverlayStyle;
mojom.SystemChromeProxy _initSystemChromeProxy() {
......
......@@ -4,12 +4,12 @@
import 'dart:async';
import 'package:sky_services/flutter/platform/system_sound.mojom.dart' as mojom;
import 'package:sky_services/flutter/platform/system_sound.mojom.dart' show SystemSoundType;
import 'package:flutter_services/platform/system_sound.dart' as mojom;
import 'package:flutter_services/platform/system_sound.dart' show SystemSoundType;
import 'shell.dart';
export 'package:sky_services/flutter/platform/system_sound.mojom.dart' show SystemSoundType;
export 'package:flutter_services/platform/system_sound.dart' show SystemSoundType;
mojom.SystemSoundProxy _initSystemSoundProxy() {
return shell.connectToApplicationService('mojo:flutter_platform', mojom.SystemSound.connectToService);
......
......@@ -4,7 +4,7 @@
import 'dart:async';
import 'package:sky_services/flutter/platform/url_launcher.mojom.dart' as mojom;
import 'package:flutter_services/platform/url_launcher.dart' as mojom;
import 'shell.dart';
mojom.UrlLauncherProxy _initUrlLauncherProxy() {
......
......@@ -7,7 +7,7 @@ import 'dart:async';
import 'package:flutter/rendering.dart' show RenderEditableLine, SelectionChangedHandler;
import 'package:flutter/services.dart';
import 'package:meta/meta.dart';
import 'package:sky_services/editing/editing.mojom.dart' as mojom;
import 'package:flutter_services/editing.dart' as mojom;
import 'basic.dart';
import 'focus.dart';
......@@ -18,7 +18,7 @@ import 'scrollable.dart';
import 'text_selection.dart';
export 'package:flutter/painting.dart' show TextSelection;
export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
export 'package:flutter_services/editing.dart' show KeyboardType;
const Duration _kCursorBlinkHalfPeriod = const Duration(milliseconds: 500);
......
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
import 'package:flutter/services.dart';
import 'package:sky_services/raw_keyboard/raw_keyboard.mojom.dart' as mojom;
import 'package:sky_services/sky/input_event.mojom.dart' as mojom;
import 'package:flutter_services/raw_keyboard.dart' as mojom;
import 'package:flutter_services/input_event.dart' as mojom;
import 'basic.dart';
import 'framework.dart';
......
......@@ -8,7 +8,7 @@ import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/rendering.dart';
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
import 'basic.dart';
import 'binding.dart';
......
......@@ -15,10 +15,10 @@ dependencies:
async: "^1.10.0"
http_parser: ">=0.0.1 <4.0.0"
flutter_services:
path: ../../bin/cache/pkg/flutter_services
sky_engine:
path: ../../bin/cache/pkg/sky_engine
sky_services:
path: ../../bin/cache/pkg/sky_services
dev_dependencies:
flutter_test:
......
......@@ -7,7 +7,7 @@ import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:mojo/bindings.dart' as mojo_bindings;
import 'package:sky_services/pointer/pointer.mojom.dart';
import 'package:flutter_services/pointer.dart';
import 'package:test/test.dart';
typedef void HandleEventCallback(PointerEvent event);
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
import 'package:flutter/rendering.dart';
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
class TestSemanticsClient {
TestSemanticsClient(PipelineOwner pipelineOwner) {
......
......@@ -4,7 +4,7 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sky_services/flutter/platform/system_chrome.mojom.dart' as mojom;
import 'package:flutter_services/platform/system_chrome.dart' as mojom;
void main() {
testWidgets('SystemChrome overlay style test', (WidgetTester tester) async {
......
......@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
import '../rendering/test_semantics_client.dart';
......
......@@ -4,7 +4,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:sky_services/editing/editing.mojom.dart' as mojom;
import 'package:flutter_services/editing.dart' as mojom;
class MockKeyboard extends mojom.KeyboardProxy {
MockKeyboard() : super.unbound();
......
......@@ -7,7 +7,7 @@ import 'dart:async';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:sky_services/editing/editing.mojom.dart' as mojom;
import 'package:flutter_services/editing.dart' as mojom;
class MockKeyboard extends mojom.KeyboardProxy {
MockKeyboard() : super.unbound();
......
......@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
import '../rendering/test_semantics_client.dart';
......
......@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sky_services/semantics/semantics.mojom.dart' as mojom;
import 'package:flutter_services/semantics.dart' as mojom;
import '../rendering/test_semantics_client.dart';
......
......@@ -19,7 +19,7 @@ import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:mojo/core.dart';
import 'package:sky_services/media/media.mojom.dart';
import 'package:flutter_services/media.dart';
import 'package:vector_math/vector_math_64.dart';
part 'src/action.dart';
......
......@@ -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);
}
......
......@@ -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']) {
......
......@@ -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);
}
}
......@@ -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>[
......
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