Commit 88a44f8e authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Remove set_sources_assignment_filter from //components/gcm_driver

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).

Bug: 1018739
Change-Id: I95e88c9c5592c1425f2a3ded0b59d72c6a1bd0e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410397
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarFilip Gorski <fgorski@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807390}
parent 885496b1
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
import("//build/buildflag_header.gni") import("//build/buildflag_header.gni")
import("//components/gcm_driver/config.gni") import("//components/gcm_driver/config.gni")
# Reset sources_assignment_filter for the BUILD.gn file to prevent
# regression during the migration of Chromium away from the feature.
# See docs/no_sources_assignment_filter.md for more information.
# TODO(crbug.com/1018739): remove this when migration is done.
set_sources_assignment_filter([])
buildflag_header("gcm_buildflags") { buildflag_header("gcm_buildflags") {
header = "gcm_buildflags.h" header = "gcm_buildflags.h"
flags = [ "USE_GCM_FROM_PLATFORM=$use_gcm_from_platform" ] flags = [ "USE_GCM_FROM_PLATFORM=$use_gcm_from_platform" ]
...@@ -81,6 +87,7 @@ static_library("gcm_driver") { ...@@ -81,6 +87,7 @@ static_library("gcm_driver") {
} }
if (use_gcm_from_platform) { if (use_gcm_from_platform) {
assert(is_android)
sources += [ sources += [
"gcm_driver_android.cc", "gcm_driver_android.cc",
"gcm_driver_android.h", "gcm_driver_android.h",
...@@ -167,10 +174,7 @@ static_library("test_support") { ...@@ -167,10 +174,7 @@ static_library("test_support") {
source_set("unit_tests") { source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [ "gcm_delayed_task_controller_unittest.cc" ]
"gcm_delayed_task_controller_unittest.cc",
"gcm_stats_recorder_android_unittest.cc",
]
deps = [ deps = [
":gcm_driver", ":gcm_driver",
...@@ -188,6 +192,10 @@ source_set("unit_tests") { ...@@ -188,6 +192,10 @@ source_set("unit_tests") {
"//third_party/protobuf:protobuf_lite", "//third_party/protobuf:protobuf_lite",
] ]
if (is_android) {
sources += [ "gcm_stats_recorder_android_unittest.cc" ]
}
if (!use_gcm_from_platform) { if (!use_gcm_from_platform) {
sources += [ sources += [
"account_tracker_unittest.cc", "account_tracker_unittest.cc",
......
...@@ -7,3 +7,6 @@ declare_args() { ...@@ -7,3 +7,6 @@ declare_args() {
# includes GMS which provides the GCM client. # includes GMS which provides the GCM client.
use_gcm_from_platform = is_android use_gcm_from_platform = is_android
} }
# Using the platform GCM is only supported on Android.
assert(!use_gcm_from_platform || is_android)
...@@ -8,14 +8,18 @@ if (is_android) { ...@@ -8,14 +8,18 @@ if (is_android) {
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
} }
# Reset sources_assignment_filter for the BUILD.gn file to prevent
# regression during the migration of Chromium away from the feature.
# See docs/no_sources_assignment_filter.md for more information.
# TODO(crbug.com/1018739): remove this when migration is done.
set_sources_assignment_filter([])
static_library("instance_id") { static_library("instance_id") {
sources = [ sources = [
"instance_id.cc", "instance_id.cc",
"instance_id.h", "instance_id.h",
"instance_id_driver.cc", "instance_id_driver.cc",
"instance_id_driver.h", "instance_id_driver.h",
"instance_id_impl.cc",
"instance_id_impl.h",
"instance_id_profile_service.cc", "instance_id_profile_service.cc",
"instance_id_profile_service.h", "instance_id_profile_service.h",
] ]
...@@ -30,15 +34,17 @@ static_library("instance_id") { ...@@ -30,15 +34,17 @@ static_library("instance_id") {
] ]
if (use_gcm_from_platform) { if (use_gcm_from_platform) {
sources -= [ assert(is_android)
"instance_id_impl.cc",
"instance_id_impl.h",
]
sources += [ sources += [
"instance_id_android.cc", "instance_id_android.cc",
"instance_id_android.h", "instance_id_android.h",
] ]
deps += [ "android:jni_headers" ] deps += [ "android:jni_headers" ]
} else {
sources += [
"instance_id_impl.cc",
"instance_id_impl.h",
]
} }
} }
...@@ -47,8 +53,6 @@ static_library("test_support") { ...@@ -47,8 +53,6 @@ static_library("test_support") {
sources = [ sources = [
"fake_gcm_driver_for_instance_id.cc", "fake_gcm_driver_for_instance_id.cc",
"fake_gcm_driver_for_instance_id.h", "fake_gcm_driver_for_instance_id.h",
"scoped_use_fake_instance_id_android.cc",
"scoped_use_fake_instance_id_android.h",
] ]
public_deps = [ ":instance_id" ] public_deps = [ ":instance_id" ]
...@@ -59,6 +63,10 @@ static_library("test_support") { ...@@ -59,6 +63,10 @@ static_library("test_support") {
] ]
if (is_android) { if (is_android) {
sources += [
"scoped_use_fake_instance_id_android.cc",
"scoped_use_fake_instance_id_android.h",
]
deps += [ "android:test_support_jni_headers" ] deps += [ "android:test_support_jni_headers" ]
} }
} }
......
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