Commit 07997f74 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions Build] Extract chrome api sources to a gni file

Extract chrome api sources from chrome/common/extensions/api/BUILD.gn
to a separate gni file at chrome/common/extensions/api/api_soruces.
This allows us to pull the api registration step of generation out
from chrome/common and into chrome/browser. This is helpful, since it
is a purely-browser dependency (and has browser dependencies itself).

Also make this step a public dependency of chrome/browser/extensions so
embedders do not need to explicitly depend on it themselves.

Bug: None

Change-Id: I6f2f973a5ba1c04b01aa36b096de847b73964148
Reviewed-on: https://chromium-review.googlesource.com/1139394
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575895}
parent 048081e4
......@@ -3799,7 +3799,6 @@ jumbo_split_static_library("browser") {
"//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
"//chrome/browser/web_applications",
"//chrome/common/extensions/api",
"//chrome/common/extensions/api:api_registration",
"//chrome/common/extensions/api:extensions_features",
"//components/drive",
"//components/guest_view/browser",
......
......@@ -63,7 +63,6 @@ source_set("chromeos") {
"//chrome/browser/ssl:proto",
"//chrome/common",
"//chrome/common/extensions/api",
"//chrome/common/extensions/api:api_registration",
"//chrome/common/net",
"//chrome/common/safe_browsing:proto",
"//chrome/services/file_util/public/cpp",
......
......@@ -779,6 +779,7 @@ jumbo_static_library("extensions") {
# have the same dependencies. Once browser_extensions is untangled from
# browser, then we can clean up these dependencies.
public_deps = [
"//chrome/browser/extensions/api:api_registration",
"//chrome/common/extensions/api",
"//components/safe_browsing:csd_proto",
"//components/safe_browsing/db:util",
......@@ -803,7 +804,6 @@ jumbo_static_library("extensions") {
"//chrome/browser/web_applications/extensions",
"//chrome/common",
"//chrome/common/extensions:mojo_bindings",
"//chrome/common/extensions/api:api_registration",
"//chrome/common/extensions/api:extensions_features",
"//chrome/common/safe_browsing:proto",
"//chrome/services/media_gallery_util/public/cpp",
......
# Copyright 2018 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.
import("//chrome/common/extensions/api/api_sources.gni")
import("//chrome/common/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//tools/json_schema_compiler/json_schema_api.gni")
assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")
json_schema_api("api_registration") {
sources = chrome_extensions_api_schema_sources
impl_dir = "//chrome/browser/extensions/api"
bundle_registration = true
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Chrome"
root_namespace = chrome_extensions_api_root_namespace
schema_include_rules = chrome_extensions_api_schema_include_rules
uncompiled_sources = chrome_extensions_api_uncompiled_sources
deps = [
# Different APIs include headers from these targets.
"//content/public/browser",
"//extensions/browser",
# Different APIs include some headers from chrome/common that in turn
# include generated headers from these targets.
# TODO(brettw) this should be made unnecessary if possible.
"//chrome/common/extensions/api",
"//components/sync",
"//skia",
"//third_party/metrics_proto",
"//ui/accessibility:ax_enums_mojo",
]
if (is_chromeos) {
deps += [ "//components/drive:proto" ]
}
deps += [ "//extensions/common/api" ]
}
......@@ -3819,7 +3819,6 @@ split_static_library("ui") {
"//chrome/browser/apps/platform_apps",
"//chrome/browser/extensions",
"//chrome/common/extensions/api",
"//chrome/common/extensions/api:api_registration",
"//components/drive",
"//components/guest_view/browser",
"//extensions/browser",
......
......@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//chrome/common/extensions/api/api_sources.gni")
import("//chrome/common/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//tools/json_schema_compiler/json_features.gni")
......@@ -11,156 +12,13 @@ import("//tools/json_schema_compiler/json_schema_api.gni")
assert(enable_extensions)
schema_sources = [
"accessibility_features.json",
"accessibility_private.json",
"activity_log_private.json",
"cast_streaming_receiver_session.idl",
"cast_streaming_rtp_stream.idl",
"cast_streaming_session.idl",
"cast_streaming_udp_transport.idl",
"autofill_private.idl",
"automation.idl",
"automation_internal.idl",
"autotest_private.idl",
"bookmark_manager_private.json",
"bookmarks.json",
"braille_display_private.idl",
"browser.idl",
"chrome_web_view_internal.json",
"command_line_private.json",
"content_settings.json",
"context_menus_internal.json",
"context_menus.json",
"cookies.json",
"cryptotoken_private.idl",
"dashboard_private.json",
"data_reduction_proxy.json",
"debugger.json",
"desktop_capture.json",
"developer_private.idl",
"downloads.idl",
"downloads_internal.idl",
"font_settings.json",
"gcm.json",
"history.json",
"i18n.json",
"identity.idl",
"identity_private.idl",
"image_writer_private.idl",
"inline_install_private.idl",
"instance_id.json",
"language_settings_private.idl",
"manifest_types.json",
"media_galleries.idl",
"notifications.idl",
"omnibox.json",
"page_capture.json",
"passwords_private.idl",
"permissions.json",
"preferences_private.json",
"resources_private.idl",
"safe_browsing_private.idl",
"sessions.json",
"settings_private.idl",
"signed_in_devices.idl",
"streams_private.idl",
"sync_file_system.idl",
"system_indicator.idl",
"system_private.json",
"tab_capture.idl",
"tabs.json",
"types.json",
"web_navigation.json",
# Despite the name, these APIs do not rely on any WebRTC-specific bits and as
# such do not belong in a conditional.
"webrtc_audio_private.idl",
"webrtc_desktop_capture_private.idl",
"webrtc_logging_private.idl",
"webstore_private.json",
"webstore_widget_private.idl",
"windows.json",
]
if (!is_android) {
schema_sources += [ "processes.idl" ]
}
if (is_chromeos || is_mac || is_win) {
schema_sources += [ "networking_cast_private.idl" ]
}
if (is_chromeos) {
schema_sources += [
"certificate_provider.idl",
"certificate_provider_internal.idl",
"easy_unlock_private.idl",
"echo_private.json",
"enterprise_device_attributes.idl",
"enterprise_platform_keys.idl",
"enterprise_platform_keys_internal.idl",
"enterprise_platform_keys_private.json",
"file_browser_handler_internal.json",
"file_manager_private.idl",
"file_manager_private_internal.idl",
"file_system_provider.idl",
"file_system_provider_internal.idl",
"first_run_private.json",
"input_ime.json",
"input_method_private.json",
"launcher_search_provider.idl",
"platform_keys.idl",
"platform_keys_internal.idl",
"quick_unlock_private.idl",
"screenlock_private.idl",
"terminal_private.json",
"users_private.idl",
"wallpaper.json",
"wallpaper_private.json",
]
} else if (is_linux || is_win) {
schema_sources += [ "input_ime.json" ]
}
if (!is_chromeos) {
schema_sources += [ "enterprise_reporting_private.idl" ]
}
if (enable_print_preview && !is_chromeos) {
schema_sources += [ "cloud_print_private.json" ]
}
if (enable_service_discovery) {
schema_sources += [ "mdns.idl" ]
}
extensions_api_root_namespace = "extensions::api::%(namespace)s"
extensions_api_uncompiled_sources = [
"browsing_data.json",
"extension.json",
"idltest.idl",
"music_manager_private.idl",
"top_sites.json",
]
if (is_chromeos) {
extensions_api_uncompiled_sources += [
"chromeos_info_private.json",
"media_player_private.json",
]
}
extensions_api_schema_include_rules =
"extensions/common/api:extensions::api::%(namespace)s"
json_schema_api("api") {
sources = schema_sources
sources = chrome_extensions_api_schema_sources
schemas = true
bundle = true
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Chrome"
schema_include_rules = extensions_api_schema_include_rules
schema_include_rules = chrome_extensions_api_schema_include_rules
uncompiled_bundle_schema_sources = [
"app.json",
......@@ -184,45 +42,14 @@ json_schema_api("api") {
uncompiled_bundle_schema_sources += [ "input_method_private.json" ]
}
uncompiled_sources = extensions_api_uncompiled_sources
uncompiled_sources = chrome_extensions_api_uncompiled_sources
root_namespace = extensions_api_root_namespace
root_namespace = chrome_extensions_api_root_namespace
deps = [
"//extensions/common/api",
]
}
json_schema_api("api_registration") {
sources = schema_sources
impl_dir = "//chrome/browser/extensions/api"
bundle_registration = true
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Chrome"
root_namespace = extensions_api_root_namespace
schema_include_rules = extensions_api_schema_include_rules
uncompiled_sources = extensions_api_uncompiled_sources
deps = [
# Different APIs include headers from these targets.
"//content/public/browser",
"//extensions/browser",
# Different APIs include some headers from chrome/common that in turn
# include generated headers from these targets.
# TODO(brettw) this should be made unnecessary if possible.
":api",
"//components/sync",
"//skia",
"//third_party/metrics_proto",
"//ui/accessibility:ax_enums_mojo",
]
if (is_chromeos) {
deps += [ "//components/drive:proto" ]
}
deps += [ "//extensions/common/api" ]
}
json_features("api_features") {
feature_type = "APIFeature"
method_name = "AddChromeAPIFeatures"
......
# Copyright 2018 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.
import("//build/config/features.gni")
import("//chrome/common/features.gni")
assert(enable_extensions)
schema_sources_ = [
"accessibility_features.json",
"accessibility_private.json",
"activity_log_private.json",
"cast_streaming_receiver_session.idl",
"cast_streaming_rtp_stream.idl",
"cast_streaming_session.idl",
"cast_streaming_udp_transport.idl",
"autofill_private.idl",
"automation.idl",
"automation_internal.idl",
"autotest_private.idl",
"bookmark_manager_private.json",
"bookmarks.json",
"braille_display_private.idl",
"browser.idl",
"chrome_web_view_internal.json",
"command_line_private.json",
"content_settings.json",
"context_menus_internal.json",
"context_menus.json",
"cookies.json",
"cryptotoken_private.idl",
"dashboard_private.json",
"data_reduction_proxy.json",
"debugger.json",
"desktop_capture.json",
"developer_private.idl",
"downloads.idl",
"downloads_internal.idl",
"font_settings.json",
"gcm.json",
"history.json",
"i18n.json",
"identity.idl",
"identity_private.idl",
"image_writer_private.idl",
"inline_install_private.idl",
"instance_id.json",
"language_settings_private.idl",
"manifest_types.json",
"media_galleries.idl",
"notifications.idl",
"omnibox.json",
"page_capture.json",
"passwords_private.idl",
"permissions.json",
"preferences_private.json",
"resources_private.idl",
"safe_browsing_private.idl",
"sessions.json",
"settings_private.idl",
"signed_in_devices.idl",
"streams_private.idl",
"sync_file_system.idl",
"system_indicator.idl",
"system_private.json",
"tab_capture.idl",
"tabs.json",
"types.json",
"web_navigation.json",
# Despite the name, these APIs do not rely on any WebRTC-specific bits and as
# such do not belong in a conditional.
"webrtc_audio_private.idl",
"webrtc_desktop_capture_private.idl",
"webrtc_logging_private.idl",
"webstore_private.json",
"webstore_widget_private.idl",
"windows.json",
]
if (!is_android) {
schema_sources_ += [ "processes.idl" ]
}
if (is_chromeos || is_mac || is_win) {
schema_sources_ += [ "networking_cast_private.idl" ]
}
if (is_chromeos) {
schema_sources_ += [
"certificate_provider.idl",
"certificate_provider_internal.idl",
"easy_unlock_private.idl",
"echo_private.json",
"enterprise_device_attributes.idl",
"enterprise_platform_keys.idl",
"enterprise_platform_keys_internal.idl",
"enterprise_platform_keys_private.json",
"file_browser_handler_internal.json",
"file_manager_private.idl",
"file_manager_private_internal.idl",
"file_system_provider.idl",
"file_system_provider_internal.idl",
"first_run_private.json",
"input_ime.json",
"input_method_private.json",
"launcher_search_provider.idl",
"platform_keys.idl",
"platform_keys_internal.idl",
"quick_unlock_private.idl",
"screenlock_private.idl",
"terminal_private.json",
"users_private.idl",
"wallpaper.json",
"wallpaper_private.json",
]
} else if (is_linux || is_win) {
schema_sources_ += [ "input_ime.json" ]
}
if (!is_chromeos) {
schema_sources_ += [ "enterprise_reporting_private.idl" ]
}
if (enable_print_preview && !is_chromeos) {
schema_sources_ += [ "cloud_print_private.json" ]
}
if (enable_service_discovery) {
schema_sources_ += [ "mdns.idl" ]
}
uncompiled_sources_ = [
"browsing_data.json",
"extension.json",
"idltest.idl",
"music_manager_private.idl",
"top_sites.json",
]
if (is_chromeos) {
uncompiled_sources_ += [
"chromeos_info_private.json",
"media_player_private.json",
]
}
chrome_extensions_api_schema_sources = get_path_info(schema_sources_, "abspath")
chrome_extensions_api_uncompiled_sources =
get_path_info(uncompiled_sources_, "abspath")
chrome_extensions_api_root_namespace = "extensions::api::%(namespace)s"
chrome_extensions_api_schema_include_rules =
"extensions/common/api:extensions::api::%(namespace)s"
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