summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
Diffstat (limited to 'sync')
-rw-r--r--sync/BUILD.gn25
-rw-r--r--sync/protocol/BUILD.gn45
-rw-r--r--sync/protocol/protocol.gypi3
-rw-r--r--sync/protocol/protocol_sources.gni14
-rw-r--r--sync/sync_tests.gypi3
5 files changed, 42 insertions, 48 deletions
diff --git a/sync/BUILD.gn b/sync/BUILD.gn
index b6a76af..c6fd22b 100644
--- a/sync/BUILD.gn
+++ b/sync/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/features.gni")
+import("//sync/protocol/protocol_sources.gni")
import("//testing/test.gni")
component("sync") {
@@ -841,6 +842,30 @@ if (is_android) {
]
}
+ _test_support_sync_prepared_protos_dir =
+ "$root_gen_dir/test_support_sync_proto_java_prepare/"
+ action("test_support_sync_proto_java_prepare") {
+ script = "//sync/protocol/prepare_protos_for_java_tests.py"
+ inputs = sync_protocol_sources
+ outputs = process_file_template(
+ sync_protocol_sources,
+ [ "$_test_support_sync_prepared_protos_dir/{{source_file_part}}" ])
+ args = [
+ "--output_dir",
+ rebase_path(_test_support_sync_prepared_protos_dir, root_build_dir),
+ ]
+ args += rebase_path(sync_protocol_sources, root_build_dir)
+ }
+
+ # GYP: //sync/sync_tests.gypi:test_support_sync_proto_java
+ proto_java_library("test_support_sync_proto_java") {
+ proto_path = _test_support_sync_prepared_protos_dir
+ sources = get_target_outputs(":test_support_sync_proto_java_prepare")
+ deps = [
+ ":test_support_sync_proto_java_prepare",
+ ]
+ }
+
# GYP: //sync/sync_tests.gypi:sync_java_test_support
android_library("sync_java_test_support") {
testonly = true
diff --git a/sync/protocol/BUILD.gn b/sync/protocol/BUILD.gn
index 0fefbc5..f90ae70 100644
--- a/sync/protocol/BUILD.gn
+++ b/sync/protocol/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//third_party/protobuf/proto_library.gni")
+import("protocol_sources.gni")
# This must be a component for the dependency structure we have now, but the
# proto_library generates a source set. Link those into a component.
@@ -15,49 +16,7 @@ component("protocol") {
proto_library("protocol_internal") {
visibility = [ ":protocol" ]
- sources = [
- "app_list_specifics.proto",
- "app_notification_specifics.proto",
- "app_setting_specifics.proto",
- "app_specifics.proto",
- "article_specifics.proto",
- "attachments.proto",
- "autofill_specifics.proto",
- "bookmark_specifics.proto",
- "client_commands.proto",
- "client_debug_info.proto",
- "device_info_specifics.proto",
- "dictionary_specifics.proto",
- "encryption.proto",
- "entity_metadata.proto",
- "experiment_status.proto",
- "experiments_specifics.proto",
- "extension_setting_specifics.proto",
- "extension_specifics.proto",
- "favicon_image_specifics.proto",
- "favicon_tracking_specifics.proto",
- "get_updates_caller_info.proto",
- "history_delete_directive_specifics.proto",
- "managed_user_setting_specifics.proto",
- "managed_user_shared_setting_specifics.proto",
- "managed_user_specifics.proto",
- "managed_user_whitelist_specifics.proto",
- "nigori_specifics.proto",
- "password_specifics.proto",
- "preference_specifics.proto",
- "priority_preference_specifics.proto",
- "search_engine_specifics.proto",
- "session_specifics.proto",
- "sync.proto",
- "sync_enums.proto",
- "synced_notification_app_info_specifics.proto",
- "synced_notification_specifics.proto",
- "test.proto",
- "theme_specifics.proto",
- "typed_url_specifics.proto",
- "unique_position.proto",
- "wifi_credential_specifics.proto",
- ]
+ sources = sync_protocol_sources
cc_generator_options = "dllexport_decl=SYNC_PROTO_EXPORT:"
cc_include = "sync/protocol/sync_proto_export.h"
diff --git a/sync/protocol/protocol.gypi b/sync/protocol/protocol.gypi
index 82f7dd4..21aa65d 100644
--- a/sync/protocol/protocol.gypi
+++ b/sync/protocol/protocol.gypi
@@ -11,9 +11,6 @@
# The list of sync protocol buffer definitions.
'sync_proto_source_paths': [
- # NOTE: If you add a file to this list, also add it to
- # sync/protocol/BUILD.gn
- # TODO(pvalenzuela): Eliminate the requirement to update the GN file.
'<(sync_proto_sources_dir)/app_notification_specifics.proto',
'<(sync_proto_sources_dir)/app_setting_specifics.proto',
'<(sync_proto_sources_dir)/app_specifics.proto',
diff --git a/sync/protocol/protocol_sources.gni b/sync/protocol/protocol_sources.gni
new file mode 100644
index 0000000..86cefae
--- /dev/null
+++ b/sync/protocol/protocol_sources.gni
@@ -0,0 +1,14 @@
+# Copyright 2015 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.
+
+protocol_gypi =
+ exec_script("//build/gypi_to_gn.py",
+ [
+ rebase_path("//sync/protocol/protocol.gypi"),
+ "--replace=<(sync_proto_sources_dir)=//sync/protocol",
+ ],
+ "scope",
+ [ "//sync/protocol/protocol.gypi" ])
+
+sync_protocol_sources = protocol_gypi.sync_proto_source_paths
diff --git a/sync/sync_tests.gypi b/sync/sync_tests.gypi
index e7eceec..e550c30 100644
--- a/sync/sync_tests.gypi
+++ b/sync/sync_tests.gypi
@@ -439,8 +439,7 @@
'includes': [ '../build/jni_generator.gypi' ],
},
{
- # TODO(pvalenzuela): Create GN version of this target.
- # http://crbug.com/475612
+ # GN: //sync:test_support_sync_proto_java
'target_name': 'test_support_sync_proto_java',
'type': 'none',
'variables': {