From 9970481b7a6b3bb632df75150e797ad00378009f Mon Sep 17 00:00:00 2001 From: Tong Mu Date: Wed, 29 Jun 2022 17:08:08 -0700 Subject: [PATCH] [gen_keycodes] Mark generated file names with infix `.g.` (#106142) --- dev/tools/gen_keycodes/README.md | 12 ++++++------ dev/tools/gen_keycodes/bin/gen_keycodes.dart | 16 ++++++++-------- dev/tools/gen_keycodes/data/README.md | 8 ++++---- dev/tools/gen_keycodes/data/keyboard_maps.tmpl | 4 ++-- ...cal_key_data.json => logical_key_data.g.json} | 0 ...al_key_data.json => physical_key_data.g.json} | 0 dev/tools/gen_keycodes/lib/base_code_gen.dart | 2 +- dev/tools/gen_keycodes/lib/gtk_code_gen.dart | 2 +- dev/tools/gen_keycodes/lib/ios_code_gen.dart | 2 +- .../gen_keycodes/lib/keyboard_keys_code_gen.dart | 2 +- .../gen_keycodes/lib/keyboard_maps_code_gen.dart | 4 ++-- dev/tools/gen_keycodes/lib/logical_key_data.dart | 4 ++-- dev/tools/gen_keycodes/lib/macos_code_gen.dart | 2 +- .../gen_keycodes/lib/physical_key_data.dart | 2 +- dev/tools/gen_keycodes/lib/web_code_gen.dart | 2 +- dev/tools/gen_keycodes/lib/windows_code_gen.dart | 2 +- .../gen_keycodes/test/gen_keycodes_test.dart | 14 +++++++------- packages/flutter/lib/services.dart | 4 ++-- .../lib/src/services/hardware_keyboard.dart | 2 +- .../{keyboard_key.dart => keyboard_key.g.dart} | 0 .../{keyboard_maps.dart => keyboard_maps.g.dart} | 4 ++-- .../flutter/lib/src/services/raw_keyboard.dart | 4 ++-- .../lib/src/services/raw_keyboard_android.dart | 4 ++-- .../lib/src/services/raw_keyboard_fuchsia.dart | 4 ++-- .../lib/src/services/raw_keyboard_ios.dart | 4 ++-- .../lib/src/services/raw_keyboard_linux.dart | 4 ++-- .../lib/src/services/raw_keyboard_macos.dart | 4 ++-- .../lib/src/services/raw_keyboard_web.dart | 4 ++-- .../lib/src/services/raw_keyboard_windows.dart | 4 ++-- .../flutter/test/material/ink_well_test.dart | 2 +- .../test/material/raw_material_button_test.dart | 2 +- 31 files changed, 62 insertions(+), 62 deletions(-) rename dev/tools/gen_keycodes/data/{logical_key_data.json => logical_key_data.g.json} (100%) rename dev/tools/gen_keycodes/data/{physical_key_data.json => physical_key_data.g.json} (100%) rename packages/flutter/lib/src/services/{keyboard_key.dart => keyboard_key.g.dart} (100%) rename packages/flutter/lib/src/services/{keyboard_maps.dart => keyboard_maps.g.dart} (99%) diff --git a/dev/tools/gen_keycodes/README.md b/dev/tools/gen_keycodes/README.md index 5e200913232e..f9ff1ad13820 100644 --- a/dev/tools/gen_keycodes/README.md +++ b/dev/tools/gen_keycodes/README.md @@ -5,8 +5,8 @@ the `LogicalKeyboardKey` and `PhysicalKeyboardKey` classes. It generates multiple files across Flutter. For framework, it generates -* [`keyboard_key.dart`](../../../packages/flutter/lib/src/services/keyboard_key.dart), which contains the definition and list of logical keys and physical keys; and -* [`keyboard_maps.dart`](../../../packages/flutter/lib/src/services/keyboard_maps.dart), which contains platform-specific immutable maps used for the `RawKeyboard` API. +* [`keyboard_key.g.dart`](../../../packages/flutter/lib/src/services/keyboard_key.g.dart), which contains the definition and list of logical keys and physical keys; and +* [`keyboard_maps.g.dart`](../../../packages/flutter/lib/src/services/keyboard_maps.g.dart), which contains platform-specific immutable maps used for the `RawKeyboard` API. For engine, it generates one key mapping file for each platform, as well as some files for testing purposes. @@ -14,9 +14,9 @@ files for testing purposes. It draws information from various source bases, including online repositories, and manual mapping in the `data` subdirectory. It incorporates this information into a giant list of physical keys -([`physical_key_data.json`](data/physical_key_data.json)), +([`physical_key_data.g.json`](data/physical_key_data.g.json)), and another for logical keys -([`logical_key_data.json`](data/logical_key_data.json)). +([`logical_key_data.g.json`](data/logical_key_data.g.json)). The two files are checked in, and can be used as the data source next time so that output files can be generated without the Internet. @@ -35,7 +35,7 @@ anew before generating the files. To do this, run: /PATH/TO/ROOT/bin/gen_keycodes --collect ``` -This will generate `physical_key_data.json` and `logical_key_data.json`. These +This will generate `physical_key_data.g.json` and `logical_key_data.g.json`. These files should be checked in. By default this tool assumes that the gclient directory for flutter/engine @@ -121,7 +121,7 @@ The planes are planned as follows: platforms managed by Flutter will start to send the new value, making it a breaking change. Therefore, when handling an unrecognized key on a platform managed by Flutter, it is recommended to file a new issue to add this value - to `keyboard_key.dart` instead of using the platform-plane value. However, + to `keyboard_key.g.dart` instead of using the platform-plane value. However, for a custom platform (see below), since the platform author has full control over key mapping, such change will not cause breakage and it is recommended to use the platform-plane value to avoid adding platform-exclusive values diff --git a/dev/tools/gen_keycodes/bin/gen_keycodes.dart b/dev/tools/gen_keycodes/bin/gen_keycodes.dart index 156de145303e..dd04a7087edb 100644 --- a/dev/tools/gen_keycodes/bin/gen_keycodes.dart +++ b/dev/tools/gen_keycodes/bin/gen_keycodes.dart @@ -108,7 +108,7 @@ Future main(List rawArguments) async { ); argParser.addOption( 'physical-data', - defaultsTo: path.join(dataRoot, 'physical_key_data.json'), + defaultsTo: path.join(dataRoot, 'physical_key_data.g.json'), help: 'The path to where the physical key data file should be written when ' 'collected, and read from when generating output code. If --physical-data is ' 'not specified, the output will be written to/read from the current ' @@ -117,7 +117,7 @@ Future main(List rawArguments) async { ); argParser.addOption( 'logical-data', - defaultsTo: path.join(dataRoot, 'logical_key_data.json'), + defaultsTo: path.join(dataRoot, 'logical_key_data.g.json'), help: 'The path to where the logical key data file should be written when ' 'collected, and read from when generating output code. If --logical-data is ' 'not specified, the output will be written to/read from the current ' @@ -126,16 +126,16 @@ Future main(List rawArguments) async { ); argParser.addOption( 'code', - defaultsTo: path.join(flutterRoot.path, 'packages', 'flutter', 'lib', 'src', 'services', 'keyboard_key.dart'), - help: 'The path to where the output "keyboard_key.dart" file should be ' + defaultsTo: path.join(flutterRoot.path, 'packages', 'flutter', 'lib', 'src', 'services', 'keyboard_key.g.dart'), + help: 'The path to where the output "keyboard_key.g.dart" file should be ' 'written. If --code is not specified, the output will be written to the ' 'correct directory in the flutter tree. If the output directory does not ' 'exist, it, and the path to it, will be created.', ); argParser.addOption( 'maps', - defaultsTo: path.join(flutterRoot.path, 'packages', 'flutter', 'lib', 'src', 'services', 'keyboard_maps.dart'), - help: 'The path to where the output "keyboard_maps.dart" file should be ' + defaultsTo: path.join(flutterRoot.path, 'packages', 'flutter', 'lib', 'src', 'services', 'keyboard_maps.g.dart'), + help: 'The path to where the output "keyboard_maps.g.dart" file should be ' 'written. If --maps is not specified, the output will be written to the ' 'correct directory in the flutter tree. If the output directory does not ' 'exist, it, and the path to it, will be created.', @@ -145,7 +145,7 @@ Future main(List rawArguments) async { negatable: false, help: 'If this flag is set, then collect and parse header files from ' 'Chromium and Android instead of reading pre-parsed data from ' - '"physical_key_data.json" and "logical_key_data.json", and then ' + '"physical_key_data.g.json" and "logical_key_data.g.json", and then ' 'update these files with the fresh data.', ); argParser.addFlag( @@ -226,7 +226,7 @@ Future main(List rawArguments) async { KeyboardMapsCodeGenerator(physicalData, logicalData)); await generate('engine utils', path.join(PlatformCodeGenerator.engineRoot, - 'shell', 'platform', 'embedder', 'test_utils', 'key_codes.h'), + 'shell', 'platform', 'embedder', 'test_utils', 'key_codes.g.h'), KeyCodesCcGenerator(physicalData, logicalData)); await generate('android utils', path.join(PlatformCodeGenerator.engineRoot, 'shell', 'platform', diff --git a/dev/tools/gen_keycodes/data/README.md b/dev/tools/gen_keycodes/data/README.md index 80ddefa6ccba..d4542a0c7010 100644 --- a/dev/tools/gen_keycodes/data/README.md +++ b/dev/tools/gen_keycodes/data/README.md @@ -4,8 +4,8 @@ | File name | Explanation | | ---- | ---- | -| [`physical_key_data.json`](physical_key_data.json) | Contains the merged physical key data from all the other sources. This file is regenerated if "--collect" is specified for the gen_keycodes script, or used as a source otherwise. | -| [`logical_key_data.json`](logical_key_data.json) | Contains the merged logical key data from all the other sources. This file is regenerated if "--collect" is specified for the gen_keycodes script, or used as a source otherwise. | +| [`physical_key_data.g.json`](physical_key_data.g.json) | Contains the merged physical key data from all the other sources. This file is regenerated if "--collect" is specified for the gen_keycodes script, or used as a source otherwise. | +| [`logical_key_data.g.json`](logical_key_data.g.json) | Contains the merged logical key data from all the other sources. This file is regenerated if "--collect" is specified for the gen_keycodes script, or used as a source otherwise. | | [`supplemental_hid_codes.inc`](supplemental_hid_codes.inc) | A supplementary HID list on top of Chromium's list of HID codes for extra physical keys. Certain entries may also overwrite Chromium's corresponding entries. | | [`supplemental_key_data.inc`](supplemental_key_data.inc) | A supplementary key list on top of Chromium's list of keys for extra logical keys.| | [`chromium_modifiers.json`](chromium_modifiers.json) | Maps the web's `key` for modifier keys to the names of the logical keys for these keys' left and right variations.This is used when generating logical keys to provide independent values for sided logical keys. Web uses the same `key` for modifier keys of different sides, but Flutter's logical key model treats them as different keys.| @@ -17,8 +17,8 @@ | File name | Explanation | | ---- | ---- | -| [`keyboard_key.tmpl`](keyboard_key.tmpl) | The template for `keyboard_key.dart`. | -| [`keyboard_maps.tmpl`](keyboard_maps.tmpl) | The template for `keyboard_maps.dart`. | +| [`keyboard_key.tmpl`](keyboard_key.tmpl) | The template for `keyboard_key.g.dart`. | +| [`keyboard_maps.tmpl`](keyboard_maps.tmpl) | The template for `keyboard_maps.g.dart`. | ### Android diff --git a/dev/tools/gen_keycodes/data/keyboard_maps.tmpl b/dev/tools/gen_keycodes/data/keyboard_maps.tmpl index 8a80093e6c83..36e4c0226a57 100644 --- a/dev/tools/gen_keycodes/data/keyboard_maps.tmpl +++ b/dev/tools/gen_keycodes/data/keyboard_maps.tmpl @@ -9,9 +9,9 @@ // Edit the template dev/tools/gen_keycodes/data/keyboard_maps.tmpl instead. // See dev/tools/gen_keycodes/README.md for more information. -import 'keyboard_key.dart'; +import 'keyboard_key.g.dart'; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; /// Maps Android-specific key codes to the matching [LogicalKeyboardKey]. const Map kAndroidToLogicalKey = { diff --git a/dev/tools/gen_keycodes/data/logical_key_data.json b/dev/tools/gen_keycodes/data/logical_key_data.g.json similarity index 100% rename from dev/tools/gen_keycodes/data/logical_key_data.json rename to dev/tools/gen_keycodes/data/logical_key_data.g.json diff --git a/dev/tools/gen_keycodes/data/physical_key_data.json b/dev/tools/gen_keycodes/data/physical_key_data.g.json similarity index 100% rename from dev/tools/gen_keycodes/data/physical_key_data.json rename to dev/tools/gen_keycodes/data/physical_key_data.g.json diff --git a/dev/tools/gen_keycodes/lib/base_code_gen.dart b/dev/tools/gen_keycodes/lib/base_code_gen.dart index 9dd0791af1ea..a49292ba85a4 100644 --- a/dev/tools/gen_keycodes/lib/base_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/base_code_gen.dart @@ -34,7 +34,7 @@ abstract class BaseCodeGenerator { Map mappings(); /// Substitutes the various platform specific maps into the template file for - /// keyboard_maps.dart. + /// keyboard_maps.g.dart. String generate() { final String template = File(templatePath).readAsStringSync(); return _injectDictionary(template, mappings()); diff --git a/dev/tools/gen_keycodes/lib/gtk_code_gen.dart b/dev/tools/gen_keycodes/lib/gtk_code_gen.dart index d07668d7996c..983d8f25e673 100644 --- a/dev/tools/gen_keycodes/lib/gtk_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/gtk_code_gen.dart @@ -129,7 +129,7 @@ class GtkCodeGenerator extends PlatformCodeGenerator { @override String outputPath(String platform) => path.join(PlatformCodeGenerator.engineRoot, - 'shell', 'platform', 'linux', 'key_mapping.cc'); + 'shell', 'platform', 'linux', 'key_mapping.g.cc'); @override Map mappings() { diff --git a/dev/tools/gen_keycodes/lib/ios_code_gen.dart b/dev/tools/gen_keycodes/lib/ios_code_gen.dart index 60f251b666f5..0d9e800037cf 100644 --- a/dev/tools/gen_keycodes/lib/ios_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/ios_code_gen.dart @@ -122,7 +122,7 @@ class IOSCodeGenerator extends PlatformCodeGenerator { @override String outputPath(String platform) => path.join(PlatformCodeGenerator.engineRoot, - 'shell', 'platform', 'darwin', 'ios', 'framework', 'Source', 'KeyCodeMap.mm'); + 'shell', 'platform', 'darwin', 'ios', 'framework', 'Source', 'KeyCodeMap.g.mm'); @override Map mappings() { diff --git a/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart b/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart index 1e3542917b45..2aa39f577d85 100644 --- a/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart @@ -46,7 +46,7 @@ class SynonymKeyInfo { String get constantName => upperCamelToLowerCamel(name); } -/// Generates the keyboard_key.dart based on the information in the key data +/// Generates the keyboard_key.g.dart based on the information in the key data /// structure given to it. class KeyboardKeysCodeGenerator extends BaseCodeGenerator { KeyboardKeysCodeGenerator(super.keyData, super.logicalData); diff --git a/dev/tools/gen_keycodes/lib/keyboard_maps_code_gen.dart b/dev/tools/gen_keycodes/lib/keyboard_maps_code_gen.dart index 28e78b79752b..cf4e65c66810 100644 --- a/dev/tools/gen_keycodes/lib/keyboard_maps_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/keyboard_maps_code_gen.dart @@ -34,7 +34,7 @@ bool _isDigit(String? char) { return charCode >= charDigit0 && charCode <= charDigit9; } -/// Generates the keyboard_maps.dart files, based on the information in the key +/// Generates the keyboard_maps.g.dart files, based on the information in the key /// data structure given to it. class KeyboardMapsCodeGenerator extends BaseCodeGenerator { KeyboardMapsCodeGenerator(super.keyData, super.logicalData); @@ -176,7 +176,7 @@ class KeyboardMapsCodeGenerator extends BaseCodeGenerator { String get _windowsKeyCodeMap { final OutputLines lines = OutputLines('Windows key code map'); for (final LogicalKeyEntry entry in logicalData.entries) { - // Letter keys on Windows are not recorded in logical_key_data.json, + // Letter keys on Windows are not recorded in logical_key_data.g.json, // because they are not used by the embedding. Add them manually. final List? keyCodes = entry.windowsValues.isNotEmpty ? entry.windowsValues diff --git a/dev/tools/gen_keycodes/lib/logical_key_data.dart b/dev/tools/gen_keycodes/lib/logical_key_data.dart index d9431921a29a..183ec4e4b017 100644 --- a/dev/tools/gen_keycodes/lib/logical_key_data.dart +++ b/dev/tools/gen_keycodes/lib/logical_key_data.dart @@ -569,7 +569,7 @@ class LogicalKeyEntry { /// A string indicating the letter on the keycap of a letter key. /// - /// This is only used to generate the key label mapping in keyboard_map.dart. + /// This is only used to generate the key label mapping in keyboard_maps.g.dart. /// [LogicalKeyboardKey.keyLabel] uses a different definition and is generated /// differently. final String? keyLabel; @@ -607,7 +607,7 @@ class LogicalKeyEntry { } /// Gets the named used for the key constant in the definitions in - /// keyboard_key.dart. + /// keyboard_key.g.dart. /// /// If set by the constructor, returns the name set, but otherwise constructs /// the name from the various different names available, making sure that the diff --git a/dev/tools/gen_keycodes/lib/macos_code_gen.dart b/dev/tools/gen_keycodes/lib/macos_code_gen.dart index 1d49bdf060eb..cbd697ebb5a4 100644 --- a/dev/tools/gen_keycodes/lib/macos_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/macos_code_gen.dart @@ -119,7 +119,7 @@ class MacOSCodeGenerator extends PlatformCodeGenerator { @override String outputPath(String platform) => path.join(PlatformCodeGenerator.engineRoot, - 'shell', 'platform', 'darwin', 'macos', 'framework', 'Source', 'KeyCodeMap.mm'); + 'shell', 'platform', 'darwin', 'macos', 'framework', 'Source', 'KeyCodeMap.g.mm'); @override Map mappings() { diff --git a/dev/tools/gen_keycodes/lib/physical_key_data.dart b/dev/tools/gen_keycodes/lib/physical_key_data.dart index 5bbe5ab97221..aef81d0d673c 100644 --- a/dev/tools/gen_keycodes/lib/physical_key_data.dart +++ b/dev/tools/gen_keycodes/lib/physical_key_data.dart @@ -313,7 +313,7 @@ class PhysicalKeyEntry { String get commentName => getCommentName(constantName); /// Gets the named used for the key constant in the definitions in - /// keyboard_key.dart. + /// keyboard_key.g.dart. /// /// If set by the constructor, returns the name set, but otherwise constructs /// the name from the various different names available, making sure that the diff --git a/dev/tools/gen_keycodes/lib/web_code_gen.dart b/dev/tools/gen_keycodes/lib/web_code_gen.dart index 3dca72b055d1..37a2898bac9f 100644 --- a/dev/tools/gen_keycodes/lib/web_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/web_code_gen.dart @@ -66,7 +66,7 @@ class WebCodeGenerator extends PlatformCodeGenerator { @override String outputPath(String platform) => path.join(PlatformCodeGenerator.engineRoot, - 'lib', 'web_ui', 'lib', 'src', 'engine', 'key_map.dart'); + 'lib', 'web_ui', 'lib', 'src', 'engine', 'key_map.g.dart'); @override Map mappings() { diff --git a/dev/tools/gen_keycodes/lib/windows_code_gen.dart b/dev/tools/gen_keycodes/lib/windows_code_gen.dart index 7dacaeee89bd..4ef32c08a70e 100644 --- a/dev/tools/gen_keycodes/lib/windows_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/windows_code_gen.dart @@ -83,7 +83,7 @@ class WindowsCodeGenerator extends PlatformCodeGenerator { @override String outputPath(String platform) => path.join(PlatformCodeGenerator.engineRoot, - 'shell', 'platform', 'windows', 'flutter_key_map.cc'); + 'shell', 'platform', 'windows', 'flutter_key_map.g.cc'); @override Map mappings() { diff --git a/dev/tools/gen_keycodes/test/gen_keycodes_test.dart b/dev/tools/gen_keycodes/test/gen_keycodes_test.dart index b6e256c638f0..9c53ca79f9e3 100644 --- a/dev/tools/gen_keycodes/test/gen_keycodes_test.dart +++ b/dev/tools/gen_keycodes/test/gen_keycodes_test.dart @@ -23,9 +23,9 @@ String readDataFile(String fileName) { } final PhysicalKeyData physicalData = PhysicalKeyData.fromJson( - json.decode(readDataFile('physical_key_data.json')) as Map); + json.decode(readDataFile('physical_key_data.g.json')) as Map); final LogicalKeyData logicalData = LogicalKeyData.fromJson( - json.decode(readDataFile('logical_key_data.json')) as Map); + json.decode(readDataFile('logical_key_data.g.json')) as Map); final Map keyGoals = parseMapOfBool( readDataFile('layout_goals.json')); @@ -71,7 +71,7 @@ void main() { ); final String output = codeGenerator.generate(); - expect(codeGenerator.outputPath(platform), endsWith('KeyCodeMap.mm')); + expect(codeGenerator.outputPath(platform), endsWith('KeyCodeMap.g.mm')); expect(output, contains('kValueMask')); expect(output, contains('keyCodeToPhysicalKey')); expect(output, contains('keyCodeToLogicalKey')); @@ -89,7 +89,7 @@ void main() { ); final String output = codeGenerator.generate(); - expect(codeGenerator.outputPath(platform), endsWith('KeyCodeMap.mm')); + expect(codeGenerator.outputPath(platform), endsWith('KeyCodeMap.g.mm')); expect(output, contains('kValueMask')); expect(output, contains('keyCodeToPhysicalKey')); expect(output, contains('keyCodeToLogicalKey')); @@ -109,7 +109,7 @@ void main() { ); final String output = codeGenerator.generate(); - expect(codeGenerator.outputPath(platform), endsWith('flutter_key_map.cc')); + expect(codeGenerator.outputPath(platform), endsWith('flutter_key_map.g.cc')); expect(output, contains('KeyboardKeyEmbedderHandler::windowsToPhysicalMap_')); expect(output, contains('KeyboardKeyEmbedderHandler::windowsToLogicalMap_')); expect(output, contains('KeyboardKeyEmbedderHandler::scanCodeToLogicalMap_')); @@ -126,7 +126,7 @@ void main() { ); final String output = codeGenerator.generate(); - expect(codeGenerator.outputPath(platform), endsWith('key_mapping.cc')); + expect(codeGenerator.outputPath(platform), endsWith('key_mapping.g.cc')); expect(output, contains('initialize_modifier_bit_to_checked_keys')); expect(output, contains('initialize_lock_bit_to_checked_keys')); checkCommonOutput(output); @@ -140,7 +140,7 @@ void main() { ); final String output = codeGenerator.generate(); - expect(codeGenerator.outputPath(platform), endsWith('key_map.dart')); + expect(codeGenerator.outputPath(platform), endsWith('key_map.g.dart')); expect(output, contains('kWebToLogicalKey')); expect(output, contains('kWebToPhysicalKey')); expect(output, contains('kWebLogicalLocationMap')); diff --git a/packages/flutter/lib/services.dart b/packages/flutter/lib/services.dart index bcf7988a5808..370df35324c4 100644 --- a/packages/flutter/lib/services.dart +++ b/packages/flutter/lib/services.dart @@ -20,8 +20,8 @@ export 'src/services/deferred_component.dart'; export 'src/services/font_loader.dart'; export 'src/services/haptic_feedback.dart'; export 'src/services/hardware_keyboard.dart'; -export 'src/services/keyboard_key.dart'; -export 'src/services/keyboard_maps.dart'; +export 'src/services/keyboard_key.g.dart'; +export 'src/services/keyboard_maps.g.dart'; export 'src/services/message_codec.dart'; export 'src/services/message_codecs.dart'; export 'src/services/mouse_cursor.dart'; diff --git a/packages/flutter/lib/src/services/hardware_keyboard.dart b/packages/flutter/lib/src/services/hardware_keyboard.dart index 8ab8002420c7..493b4ed66e07 100644 --- a/packages/flutter/lib/src/services/hardware_keyboard.dart +++ b/packages/flutter/lib/src/services/hardware_keyboard.dart @@ -13,7 +13,7 @@ export 'dart:ui' show KeyData; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show RawKeyboard, RawKeyEvent; /// Represents a lock mode of a keyboard, such as [KeyboardLockMode.capsLock]. diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.g.dart similarity index 100% rename from packages/flutter/lib/src/services/keyboard_key.dart rename to packages/flutter/lib/src/services/keyboard_key.g.dart diff --git a/packages/flutter/lib/src/services/keyboard_maps.dart b/packages/flutter/lib/src/services/keyboard_maps.g.dart similarity index 99% rename from packages/flutter/lib/src/services/keyboard_maps.dart rename to packages/flutter/lib/src/services/keyboard_maps.g.dart index 18aeb35242cb..66abf825bf1c 100644 --- a/packages/flutter/lib/src/services/keyboard_maps.dart +++ b/packages/flutter/lib/src/services/keyboard_maps.g.dart @@ -9,9 +9,9 @@ // Edit the template dev/tools/gen_keycodes/data/keyboard_maps.tmpl instead. // See dev/tools/gen_keycodes/README.md for more information. -import 'keyboard_key.dart'; +import 'keyboard_key.g.dart'; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; /// Maps Android-specific key codes to the matching [LogicalKeyboardKey]. const Map kAndroidToLogicalKey = { diff --git a/packages/flutter/lib/src/services/raw_keyboard.dart b/packages/flutter/lib/src/services/raw_keyboard.dart index 1520a6c78354..937081e82de5 100644 --- a/packages/flutter/lib/src/services/raw_keyboard.dart +++ b/packages/flutter/lib/src/services/raw_keyboard.dart @@ -7,7 +7,7 @@ import 'package:flutter/foundation.dart'; import 'binding.dart'; import 'hardware_keyboard.dart'; -import 'keyboard_key.dart'; +import 'keyboard_key.g.dart'; import 'raw_keyboard_android.dart'; import 'raw_keyboard_fuchsia.dart'; import 'raw_keyboard_ios.dart'; @@ -19,7 +19,7 @@ import 'system_channels.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder, ValueChanged; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; /// An enum describing the side of the keyboard that a key is on, to allow /// discrimination between which key is pressed (e.g. the left or right SHIFT diff --git a/packages/flutter/lib/src/services/raw_keyboard_android.dart b/packages/flutter/lib/src/services/raw_keyboard_android.dart index e7d1764bf70a..c74ea76026bf 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_android.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_android.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; // Android sets the 0x80000000 bit on a character to indicate that it is a diff --git a/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart b/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart index da047bb656fc..5158117f14aa 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// Platform-specific key event data for Fuchsia. diff --git a/packages/flutter/lib/src/services/raw_keyboard_ios.dart b/packages/flutter/lib/src/services/raw_keyboard_ios.dart index df86f353c020..f5f952cd4922 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_ios.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_ios.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// Maps iOS specific string values of nonvisible keys to logical keys diff --git a/packages/flutter/lib/src/services/raw_keyboard_linux.dart b/packages/flutter/lib/src/services/raw_keyboard_linux.dart index 8f58243c143f..c7e0d21a779f 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_linux.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_linux.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// Platform-specific key event data for Linux. diff --git a/packages/flutter/lib/src/services/raw_keyboard_macos.dart b/packages/flutter/lib/src/services/raw_keyboard_macos.dart index bbc82e8be452..952ec0cabd7b 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_macos.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_macos.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// Convert a UTF32 rune to its lower case. diff --git a/packages/flutter/lib/src/services/raw_keyboard_web.dart b/packages/flutter/lib/src/services/raw_keyboard_web.dart index 8d6fcadd1728..aad891313093 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_web.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_web.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; String? _unicodeChar(String key) { diff --git a/packages/flutter/lib/src/services/raw_keyboard_windows.dart b/packages/flutter/lib/src/services/raw_keyboard_windows.dart index 1e393cb37b64..d9f97978c1eb 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_windows.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_windows.dart @@ -4,12 +4,12 @@ import 'package:flutter/foundation.dart'; -import 'keyboard_maps.dart'; +import 'keyboard_maps.g.dart'; import 'raw_keyboard.dart'; export 'package:flutter/foundation.dart' show DiagnosticPropertiesBuilder; -export 'keyboard_key.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; +export 'keyboard_key.g.dart' show LogicalKeyboardKey, PhysicalKeyboardKey; export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; // Virtual key VK_PROCESSKEY in Win32 API. diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart index a9db62f1057b..113d72e060c5 100644 --- a/packages/flutter/test/material/ink_well_test.dart +++ b/packages/flutter/test/material/ink_well_test.dart @@ -5,7 +5,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:flutter/src/services/keyboard_key.dart'; +import 'package:flutter/src/services/keyboard_key.g.dart'; import 'package:flutter_test/flutter_test.dart'; import '../rendering/mock_canvas.dart'; diff --git a/packages/flutter/test/material/raw_material_button_test.dart b/packages/flutter/test/material/raw_material_button_test.dart index 815e03a01077..9bacdd293807 100644 --- a/packages/flutter/test/material/raw_material_button_test.dart +++ b/packages/flutter/test/material/raw_material_button_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:flutter/src/services/keyboard_key.dart'; +import 'package:flutter/src/services/keyboard_key.g.dart'; import 'package:flutter_test/flutter_test.dart'; import '../rendering/mock_canvas.dart';