Commit fae5fadd authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert //ui to not depend on set_sources_assignment_filter()

set_sources_assignment_filter() is considered as a mis-feature
of gn (as it makes it difficult to reason about the BUILD.gn
files individually).

Convert BUILD.gn files below //ui to instead use conditional
to include source files only on the platformn where they are
used.

The conversion was done by using a modified version of gn that
display all files filtered by set_sources_assignment_filter()
and updating the BUILD.gn files manually to explicitly add the
source files only on the platform that used them.

This CL was uploaded by git cl split.

Bug: 1018739
Change-Id: Idc995920f08746ab0cf4b84c5c662437ec4f50c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1930896
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719318}
parent 41361e49
......@@ -18,6 +18,12 @@ if (is_ios) {
import("//ios/build/config.gni")
}
# Reset sources_assignment_filter for the BUILD.gn file to prevent
# regression during the migration of Chromium away from the feature.
# See build/no_sources_assignment_filter.md for more information.
# TODO(crbug.com/1018739): remove this when migration is done.
set_sources_assignment_filter([])
if (is_android) {
if (!defined(keycode_conversion_data_android_path)) {
keycode_conversion_data_android_path =
......@@ -142,12 +148,6 @@ jumbo_component("events_base") {
"keycodes/dom_us_layout_data.h",
"keycodes/keyboard_code_conversion.cc",
"keycodes/keyboard_code_conversion.h",
"keycodes/keyboard_code_conversion_android.cc",
"keycodes/keyboard_code_conversion_android.h",
"keycodes/keyboard_code_conversion_mac.h",
"keycodes/keyboard_code_conversion_mac.mm",
"keycodes/keyboard_code_conversion_win.cc",
"keycodes/keyboard_code_conversion_win.h",
"keycodes/keyboard_codes.h",
"mobile_scroller.cc",
"mobile_scroller.h",
......@@ -155,6 +155,27 @@ jumbo_component("events_base") {
"pointer_details.h",
]
if (is_android) {
sources += [
"keycodes/keyboard_code_conversion_android.cc",
"keycodes/keyboard_code_conversion_android.h",
]
}
if (is_mac) {
sources += [
"keycodes/keyboard_code_conversion_mac.h",
"keycodes/keyboard_code_conversion_mac.mm",
]
}
if (is_win) {
sources += [
"keycodes/keyboard_code_conversion_win.cc",
"keycodes/keyboard_code_conversion_win.h",
]
}
defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
deps = [
......@@ -220,8 +241,6 @@ jumbo_component("events") {
]
sources = [
"cocoa/cocoa_event_utils.mm",
"cocoa/events_mac.mm",
"event.cc",
"event_dispatcher.cc",
"event_handler.cc",
......@@ -235,24 +254,36 @@ jumbo_component("events") {
"events_exports.cc",
"events_stub.cc",
"gestures/gesture_recognizer.cc",
"gestures/gesture_recognizer_impl_mac.cc",
"gestures/gesture_types.cc",
"keyboard_hook_base.cc",
"keyboard_hook_base.h",
"keycodes/platform_key_map_win.cc",
"keycodes/platform_key_map_win.h",
"mac/keyboard_hook_mac.mm",
"null_event_targeter.cc",
"scoped_target_handler.cc",
"win/events_win.cc",
"win/events_win_utils.cc",
"win/keyboard_hook_win_base.cc",
"win/keyboard_hook_win_base.h",
"win/media_keyboard_hook_win.cc",
"win/modifier_keyboard_hook_win.cc",
"win/system_event_state_lookup.cc",
]
if (is_win) {
sources += [
"keycodes/platform_key_map_win.cc",
"keycodes/platform_key_map_win.h",
"win/events_win.cc",
"win/events_win_utils.cc",
"win/keyboard_hook_win_base.cc",
"win/keyboard_hook_win_base.h",
"win/media_keyboard_hook_win.cc",
"win/modifier_keyboard_hook_win.cc",
"win/system_event_state_lookup.cc",
]
}
if (is_mac) {
sources += [
"cocoa/cocoa_event_utils.mm",
"cocoa/events_mac.mm",
"gestures/gesture_recognizer_impl_mac.cc",
"mac/keyboard_hook_mac.mm",
]
}
defines = [ "EVENTS_IMPLEMENTATION" ]
public_deps = [
......@@ -445,8 +476,6 @@ jumbo_static_library("test_support") {
"test/events_test_utils.h",
"test/keyboard_layout.cc",
"test/keyboard_layout.h",
"test/keyboard_layout_mac.cc",
"test/keyboard_layout_win.cc",
"test/motion_event_test_utils.cc",
"test/motion_event_test_utils.h",
"test/platform_event_source_test_api.cc",
......@@ -467,6 +496,14 @@ jumbo_static_library("test_support") {
"test/test_event_targeter.h",
]
if (is_win) {
sources += [ "test/keyboard_layout_win.cc" ]
}
if (is_mac) {
sources += [ "test/keyboard_layout_mac.cc" ]
}
public_deps = [
":dom_keycode_converter",
":events",
......@@ -553,16 +590,21 @@ if (!is_ios) {
"gestures/fling_curve_unittest.cc",
"keycodes/dom/keycode_converter_unittest.cc",
"keycodes/keyboard_code_conversion_unittest.cc",
"keycodes/platform_key_map_win_unittest.cc",
"mobile_scroller_unittest.cc",
"mojom/mojom_traits_unittest.cc",
"platform/platform_event_source_unittest.cc",
"scoped_target_handler_unittest.cc",
"win/event_utils_win_unittest.cc",
"win/media_keyboard_hook_win_unittest.cc",
"win/modifier_keyboard_hook_win_unittest.cc",
]
if (is_win) {
sources += [
"keycodes/platform_key_map_win_unittest.cc",
"win/event_utils_win_unittest.cc",
"win/media_keyboard_hook_win_unittest.cc",
"win/modifier_keyboard_hook_win_unittest.cc",
]
}
deps = [
":dom_keyboard_layout",
":dom_keycode_converter",
......
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