Commit 98153c61 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Add deprecated_default_sources_assignment_filter variable

To allow incremental removal of set_sources_assignment_filter feature,
move the global list to a separate .gni file that will need to be used
by all BUILD.gn that depend on a global filter list (until they are
converted).

To reduce the size of the CL, the file is imported from BUILDCONFIG.gn
to call set_sources_assignment_filter (and save the variable with the
old name).

Bug: 1018739
Change-Id: Id6f89127327e13731d7fddb839af72dd242ecce5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416496
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808026}
parent 55a2cbbd
...@@ -300,105 +300,13 @@ is_posix = !is_win && !is_fuchsia ...@@ -300,105 +300,13 @@ is_posix = !is_win && !is_fuchsia
# SOURCES FILTERS # SOURCES FILTERS
# ============================================================================= # =============================================================================
# #
# These patterns filter out platform-specific files when assigning to the # Compatibility to allow incremental migration of BUILD.gn files away from
# sources variable. The magic variable |sources_assignment_filter| is applied # depending on global call of set_sources_assignment_filter. Will be removed
# to each assignment or appending to the sources variable and matches are # when all files that depend on the assignment have been converted to import
# automatically removed. # the file directly. See https://crbug.com/1018739#c69.
#
# Note that the patterns are NOT regular expressions. Only "*" and "\b" (path
# boundary = end of string or slash) are supported, and the entire string
# must match the pattern (so you need "*.cc" to match all .cc files, for
# example).
# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
# below.
sources_assignment_filter = []
if (!is_win) {
sources_assignment_filter += [
"*_win.cc",
"*_win.h",
"*_win_unittest.cc",
"*\bwin/*",
"*.def",
"*.rc",
]
}
if (!is_mac) {
sources_assignment_filter += [
"*_mac.h",
"*_mac.cc",
"*_mac.mm",
"*_mac_unittest.h",
"*_mac_unittest.cc",
"*_mac_unittest.mm",
"*\bmac/*",
"*_cocoa.h",
"*_cocoa.cc",
"*_cocoa.mm",
"*_cocoa_unittest.h",
"*_cocoa_unittest.cc",
"*_cocoa_unittest.mm",
"*\bcocoa/*",
]
}
if (!is_ios) {
sources_assignment_filter += [
"*_ios.h",
"*_ios.cc",
"*_ios.mm",
"*_ios_unittest.h",
"*_ios_unittest.cc",
"*_ios_unittest.mm",
"*\bios/*",
]
}
if (!is_apple) {
sources_assignment_filter += [ "*.mm" ]
}
if (!is_linux && !is_chromeos) {
sources_assignment_filter += [
"*_linux.h",
"*_linux.cc",
"*_linux_unittest.h",
"*_linux_unittest.cc",
"*\blinux/*",
]
}
if (!is_android) {
sources_assignment_filter += [
"*_android.h",
"*_android.cc",
"*_android_unittest.h",
"*_android_unittest.cc",
"*\bandroid/*",
]
}
if (!is_chromeos) {
sources_assignment_filter += [
"*_chromeos.h",
"*_chromeos.cc",
"*_chromeos_unittest.h",
"*_chromeos_unittest.cc",
"*\bchromeos/*",
]
}
# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
# below.
# Actually save this list. import("//build/config/deprecated_default_sources_assignment_filter.gni")
# sources_assignment_filter = deprecated_default_sources_assignment_filter
# These patterns are executed for every file in the source tree of every run.
# Therefore, adding more patterns slows down the build for everybody. We should
# only add automatic patterns for configurations affecting hundreds of files
# across many projects in the tree.
#
# Therefore, we only add rules to this list corresponding to platforms on the
# Chromium waterfall. This is not for non-officially-supported platforms
# (FreeBSD, etc.) toolkits, (X11, GTK, etc.), or features. For these cases,
# write a conditional in the target to remove the file(s) from the list when
# your platform/toolkit/feature doesn't apply.
set_sources_assignment_filter(sources_assignment_filter) set_sources_assignment_filter(sources_assignment_filter)
# ============================================================================= # =============================================================================
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# =============================================================================
# SOURCES FILTERS
# =============================================================================
#
# These patterns filter out platform-specific files when assigning to the
# sources variable. The magic variable |sources_assignment_filter| is applied
# to each assignment or appending to the sources variable and matches are
# automatically removed.
#
# Note that the patterns are NOT regular expressions. Only "*" and "\b" (path
# boundary = end of string or slash) are supported, and the entire string
# must match the pattern (so you need "*.cc" to match all .cc files, for
# example).
# DO NOT ADD MORE PATTERNS TO THIS LIST, see https://crbug.com/1018739.
deprecated_default_sources_assignment_filter = []
if (!is_win) {
deprecated_default_sources_assignment_filter += [
"*_win.cc",
"*_win.h",
"*_win_unittest.cc",
"*\bwin/*",
"*.def",
"*.rc",
]
}
if (!is_mac) {
deprecated_default_sources_assignment_filter += [
"*_mac.h",
"*_mac.cc",
"*_mac.mm",
"*_mac_unittest.h",
"*_mac_unittest.cc",
"*_mac_unittest.mm",
"*\bmac/*",
"*_cocoa.h",
"*_cocoa.cc",
"*_cocoa.mm",
"*_cocoa_unittest.h",
"*_cocoa_unittest.cc",
"*_cocoa_unittest.mm",
"*\bcocoa/*",
]
}
if (!is_ios) {
deprecated_default_sources_assignment_filter += [
"*_ios.h",
"*_ios.cc",
"*_ios.mm",
"*_ios_unittest.h",
"*_ios_unittest.cc",
"*_ios_unittest.mm",
"*\bios/*",
]
}
if (!is_apple) {
deprecated_default_sources_assignment_filter += [ "*.mm" ]
}
if (!is_linux && !is_chromeos) {
deprecated_default_sources_assignment_filter += [
"*_linux.h",
"*_linux.cc",
"*_linux_unittest.h",
"*_linux_unittest.cc",
"*\blinux/*",
]
}
if (!is_android) {
deprecated_default_sources_assignment_filter += [
"*_android.h",
"*_android.cc",
"*_android_unittest.h",
"*_android_unittest.cc",
"*\bandroid/*",
]
}
if (!is_chromeos) {
deprecated_default_sources_assignment_filter += [
"*_chromeos.h",
"*_chromeos.cc",
"*_chromeos_unittest.h",
"*_chromeos_unittest.cc",
"*\bchromeos/*",
]
}
# DO NOT ADD MORE PATTERNS TO THIS LIST, see https://crbug.com/1018739.
# Actually save this list.
#
# These patterns are executed for every file in the source tree of every run.
# Therefore, adding more patterns slows down the build for everybody. We should
# only add automatic patterns for configurations affecting hundreds of files
# across many projects in the tree.
#
# Therefore, we only add rules to this list corresponding to platforms on the
# Chromium waterfall. This is not for non-officially-supported platforms
# (FreeBSD, etc.) toolkits, (X11, GTK, etc.), or features. For these cases,
# write a conditional in the target to remove the file(s) from the list when
# your platform/toolkit/feature doesn't apply.
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