summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 01:23:53 +0000
committerrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-14 01:23:53 +0000
commit44c466cd38e7d6b843ef4bc21572e1f3cc51c52a (patch)
treeb66a09386c5af2fcc00f4ebeb36ee5ce5e2ba710 /sync
parent8b39347a55356fc4c30e48d350abc39b8aad79b9 (diff)
downloadchromium_src-44c466cd38e7d6b843ef4bc21572e1f3cc51c52a.zip
chromium_src-44c466cd38e7d6b843ef4bc21572e1f3cc51c52a.tar.gz
chromium_src-44c466cd38e7d6b843ef4bc21572e1f3cc51c52a.tar.bz2
[sync] Componentize sync: Part 1: Clean up sync.gyp and update chrome / test dependencies
One of the long term goals of the sync team is to pull sync code out of chrome.dll and into its own component. As of today, several chrome tests depend on various sync targets as defined in sync.gyp. This is the first in a series of CLs to achieve the above goal. This patch does the following: - Renames / reorganizes several of the targets in sync.gyp - Updates the declarations in various chrome gyp files by depending on the smallest sync target possible to reflect the actual dependency. - Takes a step closer toward the ideal IWYU guideline. TBR=erikwright@chromium.org BUG=136928 TEST=all chrome targets build on all platforms; all tests pass. Review URL: https://chromiumcodereview.appspot.com/11348052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/sync.gyp286
1 files changed, 160 insertions, 126 deletions
diff --git a/sync/sync.gyp b/sync/sync.gyp
index 758ef4c..de8e734 100644
--- a/sync/sync.gyp
+++ b/sync/sync.gyp
@@ -8,15 +8,8 @@
},
'targets': [
# The core sync library.
- #
- # TODO(akalin): Rename this to something like 'sync_core' and
- # reserve the 'sync' name for the overarching library that clients
- # should depend on.
{
- 'target_name': 'sync',
- # TODO(akalin): Change this to '<(component)'. When we rename
- # this to 'sync_core' and make the overarching 'sync' library,
- # make that one '<(component)'.
+ 'target_name': 'sync_core',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'include_dirs': [
@@ -41,43 +34,6 @@
],
'sources': [
'base/sync_export.h',
- 'internal_api/public/base/enum_set.h',
- 'internal_api/public/base/invalidation.cc',
- 'internal_api/public/base/invalidation.h',
- 'internal_api/public/base/model_type.h',
- 'internal_api/public/base/model_type_invalidation_map.cc',
- 'internal_api/public/base/model_type_invalidation_map.h',
- 'internal_api/public/base/node_ordinal.cc',
- 'internal_api/public/base/node_ordinal.h',
- 'internal_api/public/base/ordinal.h',
- 'internal_api/public/base/progress_marker_map.cc',
- 'internal_api/public/base/progress_marker_map.h',
- 'internal_api/public/engine/model_safe_worker.cc',
- 'internal_api/public/engine/model_safe_worker.h',
- 'internal_api/public/engine/passive_model_worker.cc',
- 'internal_api/public/engine/passive_model_worker.h',
- 'internal_api/public/engine/polling_constants.cc',
- 'internal_api/public/engine/polling_constants.h',
- 'internal_api/public/engine/sync_status.cc',
- 'internal_api/public/engine/sync_status.h',
- 'internal_api/public/sessions/model_neutral_state.cc',
- 'internal_api/public/sessions/model_neutral_state.h',
- 'internal_api/public/sessions/sync_session_snapshot.cc',
- 'internal_api/public/sessions/sync_session_snapshot.h',
- 'internal_api/public/sessions/sync_source_info.cc',
- 'internal_api/public/sessions/sync_source_info.h',
- 'internal_api/public/util/experiments.h',
- 'internal_api/public/util/immutable.h',
- 'internal_api/public/util/syncer_error.cc',
- 'internal_api/public/util/syncer_error.h',
- 'internal_api/public/util/sync_string_conversions.cc',
- 'internal_api/public/util/sync_string_conversions.h',
- 'internal_api/public/util/report_unrecoverable_error_function.h',
- 'internal_api/public/util/unrecoverable_error_handler.h',
- 'internal_api/public/util/unrecoverable_error_info.h',
- 'internal_api/public/util/unrecoverable_error_info.cc',
- 'internal_api/public/util/weak_handle.cc',
- 'internal_api/public/util/weak_handle.h',
'engine/all_status.cc',
'engine/all_status.h',
'engine/apply_control_data_updates.cc',
@@ -254,7 +210,7 @@
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
# TODO(akalin): Remove this (http://crbug.com/133352).
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
- 'sync',
+ 'sync_core',
],
'export_dependent_settings': [
'../jingle/jingle.gyp:notifier',
@@ -311,7 +267,7 @@
},
# The sync internal API library.
{
- 'target_name': 'syncapi_core',
+ 'target_name': 'sync_internal_api',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'include_dirs': [
@@ -322,64 +278,101 @@
'../build/temp_gyp/googleurl.gyp:googleurl',
'../net/net.gyp:net',
'protocol/sync_proto.gyp:sync_proto',
+ 'sync_core',
'sync_notifier',
- 'sync',
],
'export_dependent_settings': [
# Propagate sync_proto since our headers include its generated
# files.
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
+ 'sync_core',
],
'sources': [
+ 'internal_api/base_node.cc',
+ 'internal_api/base_transaction.cc',
+ 'internal_api/change_record.cc',
+ 'internal_api/change_reorder_buffer.cc',
+ 'internal_api/change_reorder_buffer.h',
+ 'internal_api/debug_info_event_listener.cc',
+ 'internal_api/debug_info_event_listener.h',
+ 'internal_api/http_bridge.cc',
+ 'internal_api/internal_components_factory_impl.cc',
+ 'internal_api/js_mutation_event_observer.cc',
+ 'internal_api/js_mutation_event_observer.h',
+ 'internal_api/js_sync_encryption_handler_observer.cc',
+ 'internal_api/js_sync_encryption_handler_observer.h',
+ 'internal_api/js_sync_manager_observer.cc',
+ 'internal_api/js_sync_manager_observer.h',
'internal_api/public/base_node.h',
'internal_api/public/base_transaction.h',
+ 'internal_api/public/base/enum_set.h',
+ 'internal_api/public/base/invalidation.cc',
+ 'internal_api/public/base/invalidation.h',
+ 'internal_api/public/base/model_type_invalidation_map.cc',
+ 'internal_api/public/base/model_type_invalidation_map.h',
+ 'internal_api/public/base/model_type.h',
+ 'internal_api/public/base/node_ordinal.cc',
+ 'internal_api/public/base/node_ordinal.h',
+ 'internal_api/public/base/ordinal.h',
+ 'internal_api/public/base/progress_marker_map.cc',
+ 'internal_api/public/base/progress_marker_map.h',
'internal_api/public/change_record.h',
'internal_api/public/configure_reason.h',
'internal_api/public/data_type_association_stats.cc',
'internal_api/public/data_type_association_stats.h',
'internal_api/public/data_type_debug_info_listener.h',
+ 'internal_api/public/engine/model_safe_worker.cc',
+ 'internal_api/public/engine/model_safe_worker.h',
+ 'internal_api/public/engine/passive_model_worker.cc',
+ 'internal_api/public/engine/passive_model_worker.h',
+ 'internal_api/public/engine/polling_constants.cc',
+ 'internal_api/public/engine/polling_constants.h',
+ 'internal_api/public/engine/sync_status.cc',
+ 'internal_api/public/engine/sync_status.h',
'internal_api/public/http_bridge.h',
'internal_api/public/http_post_provider_factory.h',
'internal_api/public/http_post_provider_interface.h',
- 'internal_api/public/internal_components_factory.h',
'internal_api/public/internal_components_factory_impl.h',
+ 'internal_api/public/internal_components_factory.h',
'internal_api/public/read_node.h',
'internal_api/public/read_transaction.h',
- 'internal_api/public/sync_manager.h',
+ 'internal_api/public/sessions/model_neutral_state.cc',
+ 'internal_api/public/sessions/model_neutral_state.h',
+ 'internal_api/public/sessions/sync_session_snapshot.cc',
+ 'internal_api/public/sessions/sync_session_snapshot.h',
+ 'internal_api/public/sessions/sync_source_info.cc',
+ 'internal_api/public/sessions/sync_source_info.h',
'internal_api/public/sync_encryption_handler.cc',
'internal_api/public/sync_encryption_handler.h',
- 'internal_api/public/sync_manager.cc',
'internal_api/public/sync_manager_factory.h',
+ 'internal_api/public/sync_manager.cc',
+ 'internal_api/public/sync_manager.h',
'internal_api/public/user_share.h',
+ 'internal_api/public/util/experiments.h',
+ 'internal_api/public/util/immutable.h',
+ 'internal_api/public/util/report_unrecoverable_error_function.h',
+ 'internal_api/public/util/sync_string_conversions.cc',
+ 'internal_api/public/util/sync_string_conversions.h',
+ 'internal_api/public/util/syncer_error.cc',
+ 'internal_api/public/util/syncer_error.h',
+ 'internal_api/public/util/unrecoverable_error_handler.h',
+ 'internal_api/public/util/unrecoverable_error_info.cc',
+ 'internal_api/public/util/unrecoverable_error_info.h',
+ 'internal_api/public/util/weak_handle.cc',
+ 'internal_api/public/util/weak_handle.h',
'internal_api/public/write_node.h',
'internal_api/public/write_transaction.h',
- 'internal_api/base_node.cc',
- 'internal_api/base_transaction.cc',
- 'internal_api/change_record.cc',
- 'internal_api/change_reorder_buffer.cc',
- 'internal_api/change_reorder_buffer.h',
- 'internal_api/debug_info_event_listener.cc',
- 'internal_api/debug_info_event_listener.h',
- 'internal_api/http_bridge.cc',
- 'internal_api/internal_components_factory_impl.cc',
- 'internal_api/js_mutation_event_observer.cc',
- 'internal_api/js_mutation_event_observer.h',
- 'internal_api/js_sync_encryption_handler_observer.cc',
- 'internal_api/js_sync_encryption_handler_observer.h',
- 'internal_api/js_sync_manager_observer.cc',
- 'internal_api/js_sync_manager_observer.h',
'internal_api/read_node.cc',
'internal_api/read_transaction.cc',
- 'internal_api/syncapi_internal.cc',
- 'internal_api/syncapi_internal.h',
- 'internal_api/syncapi_server_connection_manager.cc',
- 'internal_api/syncapi_server_connection_manager.h',
'internal_api/sync_encryption_handler_impl.cc',
'internal_api/sync_encryption_handler_impl.h',
'internal_api/sync_manager_factory.cc',
'internal_api/sync_manager_impl.cc',
'internal_api/sync_manager_impl.h',
+ 'internal_api/syncapi_internal.cc',
+ 'internal_api/syncapi_internal.h',
+ 'internal_api/syncapi_server_connection_manager.cc',
+ 'internal_api/syncapi_server_connection_manager.h',
'internal_api/user_share.cc',
'internal_api/write_node.cc',
'internal_api/write_transaction.cc',
@@ -388,7 +381,7 @@
# The sync external API library.
{
- 'target_name': 'syncapi_service',
+ 'target_name': 'sync_api',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'include_dirs': [
@@ -397,7 +390,7 @@
'dependencies': [
'../base/base.gyp:base',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
+ 'sync_internal_api',
],
# We avoid including header files from sync_proto in our public
# header files so we don't need to export its settings.
@@ -421,9 +414,45 @@
],
},
- # Test support files for the 'sync' target.
+ # The componentized sync library.
+ {
+ 'target_name': 'sync_component',
+ # TODO(rsimha): Change the type of this target to '<(component)' after
+ # exporting dependencies on 'sync_proto'.
+ 'type': 'none',
+ 'dependencies': [
+ 'sync_api',
+ 'sync_core',
+ 'sync_notifier',
+ 'sync_internal_api',
+ ],
+ 'export_dependent_settings': [
+ 'sync_api',
+ 'sync_core',
+ 'sync_notifier',
+ 'sync_internal_api',
+ ],
+ },
+
+ # The public sync target. This depends on 'sync_component' and
+ # 'sync_proto' separately since 'sync_proto' isn't exportable from
+ # 'sync_component' (for now).
+ {
+ 'target_name': 'sync',
+ 'type': 'none',
+ 'dependencies': [
+ 'sync_component',
+ 'protocol/sync_proto.gyp:sync_proto',
+ ],
+ 'export_dependent_settings': [
+ 'sync_component',
+ 'protocol/sync_proto.gyp:sync_proto',
+ ],
+ },
+
+ # Test support files for the 'sync_core' target.
{
- 'target_name': 'test_support_sync',
+ 'target_name': 'test_support_sync_core',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'include_dirs': [
@@ -434,23 +463,15 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
+ 'sync_core',
],
'export_dependent_settings': [
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
+ 'sync_core',
],
'sources': [
- 'internal_api/public/base/invalidation_test_util.cc',
- 'internal_api/public/base/invalidation_test_util.h',
- 'internal_api/public/base/model_type_invalidation_map_test_util.cc',
- 'internal_api/public/base/model_type_invalidation_map_test_util.h',
- 'internal_api/public/base/model_type_test_util.cc',
- 'internal_api/public/base/model_type_test_util.h',
- 'internal_api/public/sessions/sync_source_info_unittest.cc',
- 'internal_api/public/sessions/sync_session_snapshot_unittest.cc',
'js/js_test_util.cc',
'js/js_test_util.h',
'sessions/test_util.cc',
@@ -499,11 +520,13 @@
'dependencies': [
'../testing/gmock.gyp:gmock',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
+ 'sync_internal_api',
'sync_notifier',
],
'export_dependent_settings': [
'../testing/gmock.gyp:gmock',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
+ 'sync_internal_api',
'sync_notifier',
],
'sources': [
@@ -520,9 +543,9 @@
],
},
- # Test support files for the 'syncapi_core' target.
+ # Test support files for the 'sync_internal_api' target.
{
- 'target_name': 'test_support_syncapi_core',
+ 'target_name': 'test_support_sync_internal_api',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
'include_dirs': [
@@ -531,17 +554,27 @@
'dependencies': [
'../base/base.gyp:base',
'../testing/gtest.gyp:gtest',
- 'syncapi_core',
+ 'protocol/sync_proto.gyp:sync_proto',
+ 'sync_core',
+ 'sync_internal_api',
'sync_notifier',
- 'test_support_sync',
+ 'test_support_sync_core',
],
'export_dependent_settings': [
'../testing/gtest.gyp:gtest',
- 'syncapi_core',
+ 'protocol/sync_proto.gyp:sync_proto',
+ 'sync_core',
+ 'sync_internal_api',
'sync_notifier',
- 'test_support_sync',
+ 'test_support_sync_core',
],
'sources': [
+ 'internal_api/public/base/invalidation_test_util.cc',
+ 'internal_api/public/base/invalidation_test_util.h',
+ 'internal_api/public/base/model_type_invalidation_map_test_util.cc',
+ 'internal_api/public/base/model_type_invalidation_map_test_util.h',
+ 'internal_api/public/base/model_type_test_util.cc',
+ 'internal_api/public/base/model_type_test_util.h',
'internal_api/public/test/fake_sync_manager.h',
'internal_api/public/test/test_entry_factory.h',
'internal_api/public/test/test_internal_components_factory.h',
@@ -553,20 +586,20 @@
],
},
- # Test support files for the 'syncapi_service' target.
+ # Test support files for the 'sync_api' target.
{
- 'target_name': 'test_support_syncapi_service',
+ 'target_name': 'test_support_sync_api',
'type': 'static_library',
'include_dirs': [
'..',
],
'dependencies': [
'../testing/gmock.gyp:gmock',
- 'syncapi_service',
+ 'sync_api',
],
'export_dependent_settings': [
'../testing/gmock.gyp:gmock',
- 'syncapi_service',
+ 'sync_api',
],
'sources': [
'api/fake_syncable_service.cc',
@@ -576,12 +609,12 @@
],
},
- # Unit tests for the 'sync' target. This cannot be a static
+ # Unit tests for the 'sync_core' target. This cannot be a static
# library because the unit test files have to be compiled directly
# into the executable, so we push the target files to the
# depending executable target via direct_dependent_settings.
{
- 'target_name': 'sync_tests',
+ 'target_name': 'sync_core_tests',
'type': 'none',
# We only want unit test executables to include this target.
'suppress_wildcard': 1,
@@ -590,8 +623,8 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
- 'test_support_sync',
+ 'sync_core',
+ 'test_support_sync_core',
],
# Propagate all dependencies since the actual compilation
# happens in the dependents.
@@ -600,8 +633,8 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
- 'test_support_sync',
+ 'sync_core',
+ 'test_support_sync_core',
],
'direct_dependent_settings': {
'include_dirs': [
@@ -679,7 +712,7 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
- 'sync',
+ 'sync_core',
'sync_notifier',
'test_support_sync_notifier',
],
@@ -692,7 +725,7 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
- 'sync',
+ 'sync_core',
'sync_notifier',
'test_support_sync_notifier',
],
@@ -740,12 +773,12 @@
],
},
- # Unit tests for the 'syncapi_core' target. This cannot be a static
+ # Unit tests for the 'sync_internal_api' target. This cannot be a static
# library because the unit test files have to be compiled directly
# into the executable, so we push the target files to the
# depending executable target via direct_dependent_settings.
{
- 'target_name': 'syncapi_core_tests',
+ 'target_name': 'sync_internal_api_tests',
'type': 'none',
# We only want unit test executables to include this target.
'suppress_wildcard': 1,
@@ -756,10 +789,10 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
+ 'sync_core',
+ 'sync_internal_api',
'sync_notifier',
- 'syncapi_core',
- 'test_support_syncapi_core',
+ 'test_support_sync_internal_api',
],
# Propagate all dependencies since the actual compilation
# happens in the dependents.
@@ -770,22 +803,24 @@
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
+ 'sync_core',
+ 'sync_internal_api',
'sync_notifier',
- 'syncapi_core',
- 'test_support_syncapi_core',
+ 'test_support_sync_internal_api',
],
'direct_dependent_settings': {
'include_dirs': [
'..',
],
'sources': [
- 'internal_api/public/change_record_unittest.cc',
'internal_api/debug_info_event_listener_unittest.cc',
'internal_api/http_bridge_unittest.cc',
'internal_api/js_mutation_event_observer_unittest.cc',
'internal_api/js_sync_encryption_handler_observer_unittest.cc',
'internal_api/js_sync_manager_observer_unittest.cc',
+ 'internal_api/public/change_record_unittest.cc',
+ 'internal_api/public/sessions/sync_session_snapshot_unittest.cc',
+ 'internal_api/public/sessions/sync_source_info_unittest.cc',
'internal_api/syncapi_server_connection_manager_unittest.cc',
'internal_api/sync_encryption_handler_impl_unittest.cc',
'internal_api/sync_manager_impl_unittest.cc',
@@ -800,12 +835,12 @@
},
},
- # Unit tests for the 'syncapi_service' target. This cannot be a static
+ # Unit tests for the 'sync_api' target. This cannot be a static
# library because the unit test files have to be compiled directly
# into the executable, so we push the target files to the
# depending executable target via direct_dependent_settings.
{
- 'target_name': 'syncapi_service_tests',
+ 'target_name': 'sync_api_tests',
'type': 'none',
# We only want unit test executables to include this target.
'suppress_wildcard': 1,
@@ -813,9 +848,9 @@
'../base/base.gyp:base',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
- 'syncapi_service',
- 'test_support_syncapi_service',
+ 'sync_core',
+ 'sync_internal_api',
+ 'test_support_sync_internal_api',
],
# Propagate all dependencies since the actual compilation
# happens in the dependents.
@@ -823,9 +858,9 @@
'../base/base.gyp:base',
'../testing/gtest.gyp:gtest',
'protocol/sync_proto.gyp:sync_proto',
- 'sync',
- 'syncapi_service',
- 'test_support_syncapi_service',
+ 'sync_core',
+ 'sync_internal_api',
+ 'test_support_sync_internal_api',
],
'direct_dependent_settings': {
'include_dirs': [
@@ -847,10 +882,11 @@
'variables': { 'enable_wexit_time_destructors': 0, },
'dependencies': [
'../base/base.gyp:run_all_unittests',
- 'sync_tests',
+ 'sync',
+ 'sync_api_tests',
+ 'sync_core_tests',
+ 'sync_internal_api_tests',
'sync_notifier_tests',
- 'syncapi_core_tests',
- 'syncapi_service_tests',
],
# TODO(akalin): This is needed because histogram.cc uses
# leak_annotations.h, which pulls this in. Make 'base'
@@ -889,7 +925,6 @@
'../net/net.gyp:net',
'../net/net.gyp:net_test_support',
'sync',
- 'sync_notifier',
],
'sources': [
'tools/sync_listen_notifications.cc',
@@ -909,8 +944,6 @@
'../net/net.gyp:net',
'../net/net.gyp:net_test_support',
'sync',
- 'sync_notifier',
- 'syncapi_core',
],
'sources': [
'tools/sync_client.cc',
@@ -918,6 +951,7 @@
},
],
}],
+
# Special target to wrap a gtest_target_type==shared_library
# sync_unit_tests into an android apk for execution.
['OS == "android" and gtest_target_type == "shared_library"', {