Skip to content

Commit

Permalink
[iOS/GN] Fix and enable "gn check" for "//ios/*" and "//ios_internal/*".
Browse files Browse the repository at this point in the history
Add missing dependencies, add circular include exception for targets that
are conceptually a single target but split for practical reason, move some
files and remove obsolete includes to fix "gn check".

Enable "gn check" for "//ios/*" and "//ios_internal/*".

R=dpranke@chromium.org
TBR=brettw@chromium.org
BUG=None

Review-Url: https://codereview.chromium.org/1984353002
Cr-Commit-Position: refs/heads/master@{#394428}
  • Loading branch information
sdefresne authored and Commit bot committed May 18, 2016
1 parent dc0bb63 commit 9852b77
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ check_targets = [
"//google_update/*",
"//gpu/*",

#"//ios/*",
"//ios/*",
"//ios_internal/*",
"//ipc/*",

#"//jingle/*",
Expand Down
3 changes: 3 additions & 0 deletions ios/chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ test("ios_chrome_unittests") {
"//ios/chrome/browser",
"//ios/chrome/browser:test_support",
"//ios/chrome/common",
"//ios/chrome/test",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser:test_support",
"//ios/web",
"//ios/web:test_support",
"//net:test_support",
Expand Down
2 changes: 1 addition & 1 deletion ios/chrome/app/strings/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import("//build/config/chrome_build.gni")
import("//tools/grit/grit_rule.gni")

group("strings") {
deps = [
public_deps = [
":ios_chromium_strings",
":ios_google_chrome_strings",
":ios_strings",
Expand Down
57 changes: 38 additions & 19 deletions ios/chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ source_set("browser") {
"geolocation/CLLocation+OmniboxGeolocation.mm",
"geolocation/CLLocation+XGeoHeader.h",
"geolocation/CLLocation+XGeoHeader.mm",
"geolocation/location_manager+Testing.h",
"geolocation/location_manager.h",
"geolocation/location_manager.mm",
"geolocation/omnibox_geolocation_authorization_alert.h",
Expand Down Expand Up @@ -541,6 +542,7 @@ source_set("browser") {
":about_flags",
":injected_js",
"//base",
"//base:i18n",
"//breakpad:client",
"//components/about_handler",
"//components/autofill/core/browser",
Expand All @@ -553,13 +555,16 @@ source_set("browser") {
"//components/certificate_reporting",
"//components/component_updater",
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/cookie_config",
"//components/crash/core/browser",
"//components/crash/core/common",
"//components/data_reduction_proxy/core/common",
"//components/dom_distiller/core",
"//components/dom_distiller/ios",
"//components/favicon/core",
"//components/favicon_base",
"//components/flags_ui",
"//components/gcm_driver",
"//components/google/core/browser",
"//components/history/core/browser",
Expand All @@ -585,6 +590,7 @@ source_set("browser") {
"//components/omnibox/browser",
"//components/open_from_clipboard",
"//components/password_manager/core/browser",
"//components/password_manager/core/common",
"//components/password_manager/sync/browser",
"//components/policy:policy_component_common",
"//components/pref_registry",
Expand All @@ -608,6 +614,7 @@ source_set("browser") {
"//components/sync_sessions",
"//components/syncable_prefs",
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/translate/ios/browser",
"//components/undo",
"//components/update_client",
Expand All @@ -624,15 +631,22 @@ source_set("browser") {
"//google_apis",
"//ios/chrome/browser/variations:ios_chrome_ui_string_overrider_factory",
"//ios/chrome/common",
"//ios/chrome/common/app_group",
"//ios/net",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/web",
"//ios/web",
"//ios/web:user_agent",
"//ios/web/public/app",
"//net",
"//net:extras",
"//skia",
"//sync",
"//third_party/google_toolbox_for_mac",
"//ui/base",
"//ui/gfx",
"//ui/resources",
"//ui/strings",
"//url",

# TODO(crbug.com/459705): add support for resource packing and change the
Expand All @@ -642,6 +656,8 @@ source_set("browser") {
"//ios/chrome/app/theme",
]

allow_circular_includes_from = [ ":about_flags" ]

libs = [
"Accelerate.framework",
"CoreGraphics.framework",
Expand All @@ -652,9 +668,14 @@ source_set("browser") {
]

if (enable_rlz) {
sources += [
"rlz/rlz_tracker_delegate_impl.cc",
"rlz/rlz_tracker_delegate_impl.h",
]

deps += [
":rlz",
"//components/rlz",
"//rlz:rlz_lib",
]
}
}
Expand All @@ -675,10 +696,14 @@ source_set("about_flags") {
"//components/autofill/core/common",
"//components/dom_distiller/core",
"//components/flags_ui",
"//components/flags_ui:switches",
"//components/strings",
"//components/sync_driver",
"//components/variations",
"//google_apis",
"//ios/chrome/app/strings",
"//ios/web",
"//ios/web:user_agent",
]

defines = [
Expand All @@ -702,31 +727,13 @@ js_compile_unchecked("injected_js") {
]
}

if (enable_rlz_support) {
source_set("rlz") {
sources = [
"rlz/rlz_tracker_delegate_impl.cc",
"rlz/rlz_tracker_delegate_impl.h",
]

deps = [
"//components/google/core/browser",
"//components/omnibox/browser",
"//components/rlz",
"//components/search_engines",
"//rlz:rlz_lib",
]
}
}

source_set("test_support") {
testonly = true
sources = [
"browser_state/test_chrome_browser_state.h",
"browser_state/test_chrome_browser_state.mm",
"browser_state/test_chrome_browser_state_isolated_context.h",
"browser_state/test_chrome_browser_state_isolated_context.mm",
"geolocation/location_manager+Testing.h",
"geolocation/test_location_manager.h",
"geolocation/test_location_manager.mm",
"net/mock_image_fetcher.h",
Expand All @@ -746,20 +753,32 @@ source_set("test_support") {
deps = [
":browser",
"//base",
"//components/bookmarks/browser",
"//components/browser_sync/browser",
"//components/browser_sync/browser:test_support",
"//components/history/core/browser",
"//components/history/ios/browser",
"//components/keyed_service/core",
"//components/keyed_service/ios",
"//components/pref_registry:test_support",
"//components/signin/core/browser",
"//components/signin/core/browser",
"//components/signin/core/browser:test_support",
"//components/signin/ios/browser",
"//components/signin/ios/browser:test_support",
"//components/sync_driver",
"//components/sync_driver:test_support",
"//components/syncable_prefs",
"//components/syncable_prefs:test_support",
"//components/user_prefs",
"//components/webdata_services",
"//ios/chrome/browser",
"//ios/chrome/common",
"//ios/chrome/test",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser:test_support",
"//ios/web",
"//net:test_support",
"//sync",
"//testing/gmock",
"//testing/gtest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#import "ios/chrome/browser/autofill/form_suggestion_view.h"
#import "ios/chrome/browser/passwords/password_generation_utils.h"
#include "ios/chrome/browser/ui/ui_util.h"
#include "ios/web/public/test/crw_test_js_injection_receiver.h"
#import "ios/web/public/url_scheme_util.h"
#import "ios/web/public/web_state/crw_web_view_proxy.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
#include "ios/web/public/web_state/url_verification_constants.h"
#include "ios/web/public/web_state/web_state.h"
#include "url/gurl.h"
Expand Down
1 change: 0 additions & 1 deletion ios/chrome/browser/ios_chrome_io_thread.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "base/threading/worker_pool.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/net_log/chrome_net_log.h"
#include "components/prefs/pref_service.h"
#include "components/proxy_config/pref_proxy_config_tracker.h"
Expand Down
4 changes: 2 additions & 2 deletions ios/chrome/browser/ios_chrome_main_parts.mm
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
#include "ui/base/resource/resource_bundle.h"

#if defined(ENABLE_RLZ)
#include "components/rlz/rlz_tracker.h"
#include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h"
#include "components/rlz/rlz_tracker.h" // nogncheck
#include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h" // nogncheck
#endif

IOSChromeMainParts::IOSChromeMainParts(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "ios/chrome/browser/web_data_service_factory.h"

#if defined(ENABLE_RLZ)
#include "components/rlz/rlz_tracker.h"
#include "components/rlz/rlz_tracker.h" // nogncheck
#endif

namespace ios {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "url/gurl.h"

#if defined(ENABLE_RLZ)
#include "components/rlz/rlz_tracker.h"
#include "components/rlz/rlz_tracker.h" // nogncheck
#endif

namespace ios {
Expand Down
2 changes: 2 additions & 0 deletions ios/chrome/common/app_group/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ source_set("client") {

deps = [
":app_group",
"//base",
]
}

Expand All @@ -42,5 +43,6 @@ source_set("main_app") {

deps = [
":app_group",
"//base",
]
}
4 changes: 4 additions & 0 deletions ios/chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ source_set("test") {

deps = [
"//base",
"//base/test:test_support",
"//components/network_time",
"//components/prefs",
"//components/prefs:test_support",
"//ios/chrome/browser",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser:test_support",
"//ios/web",
"//net",
"//testing/gmock",
"//testing/gtest",
"//ui/base",
Expand Down
2 changes: 2 additions & 0 deletions ios/net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import("//testing/test.gni")
source_set("net") {
deps = [
"//base",
"//base:i18n",
"//net",
"//url:url_features",
]

sources = [
Expand Down
3 changes: 3 additions & 0 deletions ios/public/provider/chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ source_set("browser") {
deps = [
"//base",
"//components/autofill/core/browser",
"//components/favicon_base",
"//components/metrics",
"//components/sync_sessions",
"//ios/public/provider/web",
"//ios/web",
]
Expand Down
3 changes: 3 additions & 0 deletions ios/public/provider/web/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ source_set("web") {
deps = [
"//base",
"//ios/web",
"//url",
]

allow_circular_includes_from = [ "//ios/web" ]
}
5 changes: 4 additions & 1 deletion ios/web/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ source_set("web") {
"public/ssl_status.cc",
"public/ssl_status.h",
"public/string_util.h",
"public/url_data_source_ios.h",
"public/url_scheme_util.h",
"public/url_schemes.h",
"public/url_schemes.mm",
"public/url_util.h",
"public/user_metrics.h",
"public/web/url_data_source_ios.h",
"public/web_capabilities.cc",
"public/web_capabilities.h",
"public/web_client.h",
Expand Down Expand Up @@ -260,6 +260,7 @@ source_set("web") {
source_set("core") {
deps = [
"//base",
"//url",
]

sources = [
Expand Down Expand Up @@ -382,11 +383,13 @@ bundle_data("ios_web_unittests_bundle_data") {

test("ios_web_unittests") {
deps = [
":core",
":ios_web_unittests_bundle_data",
":test_support",
":web",
"//base",
"//base/test:test_support",
"//ios/net",
"//ios/testing:ocmock_support",
"//net:test_support",
"//testing/gmock",
Expand Down
6 changes: 4 additions & 2 deletions ios/web/public/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ source_set("app") {
]

public_deps = [
"//base",
"//ios/web/app",
]

deps = [
"//ios/web/app",
"//base",
]

allow_circular_includes_from = [ "//ios/web/app" ]
}
10 changes: 6 additions & 4 deletions ios/web/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ ios_app_bundle("ios_web_shell") {

deps = [
":shell",

# All shared libraries must have the sanitizer deps to properly link in
# asan mode (this target will be empty in other cases).
"//build/config/sanitizers:deps",
]

ldflags = [
Expand Down Expand Up @@ -67,15 +71,13 @@ source_set("shell") {
":main_view_bundle_data",
":shell_bundle_data",
"//base",
"//ios/net",
"//ios/web",
"//ios/web:user_agent",
"//ios/web/public/app",
"//net",
"//net:extras",
"//ui/base",

# All shared libraries must have the sanitizer deps to properly link in
# asan mode (this target will be empty in other cases).
"//build/config/sanitizers:deps",
]

libs = [
Expand Down

0 comments on commit 9852b77

Please sign in to comment.