Index: chrome/app/policy/policy_templates.gypi |
diff --git a/chrome/app/policy/policy_templates.gypi b/chrome/app/policy/policy_templates.gypi |
index 7233a9313aeab57c17905421ba33fc5c64192745..996bc6c09e0b55cbdd931311f8df91b20022438f 100644 |
--- a/chrome/app/policy/policy_templates.gypi |
+++ b/chrome/app/policy/policy_templates.gypi |
@@ -1,4 +1,4 @@ |
-# Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+# Copyright (c) 2011 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. |
@@ -27,6 +27,10 @@ |
'<(policy_out_dir)/policy/policy_constants.cc', |
'configuration_policy_type_header': |
'<(policy_out_dir)/policy/configuration_policy_type.h', |
+ 'cloud_policy_proto': |
+ '<(policy_out_dir)/policy/cloud_policy.proto', |
+ 'protobuf_decoder': |
+ '<(policy_out_dir)/policy/cloud_policy_generated.cc', |
}, |
'inputs': [ |
'policy_templates.json', |
@@ -36,6 +40,8 @@ |
'<(policy_constant_header)', |
'<(policy_constant_source)', |
'<(configuration_policy_type_header)', |
+ '<(cloud_policy_proto)', |
+ '<(protobuf_decoder)', |
], |
'action_name': 'generate_policy_source', |
'action': [ |
@@ -43,6 +49,8 @@ |
'--policy-constants-header=<(policy_constant_header)', |
'--policy-constants-source=<(policy_constant_source)', |
'--policy-type-header=<(configuration_policy_type_header)', |
+ '--policy-protobuf=<(cloud_policy_proto)', |
+ '--protobuf-decoder=<(protobuf_decoder)', |
'<(OS)', |
'<@(_inputs)', |
], |
@@ -60,6 +68,11 @@ |
'hard_dependency': 1, |
'include_dirs': [ |
'<(policy_out_dir)', |
+ '<(protoc_out_dir)', |
+ '../../..', |
+ ], |
+ 'dependencies': [ |
+ '../third_party/protobuf/protobuf.gyp:protobuf_lite', |
], |
'direct_dependent_settings': { |
'include_dirs': [ |
@@ -70,6 +83,47 @@ |
'policy_target': 1, |
}, |
}, |
+ { |
+ 'target_name': 'cloud_policy_protobuf', |
+ 'type': 'none', |
+ 'sources': [ |
+ '<(policy_out_dir)/policy/cloud_policy.proto', |
+ ], |
+ 'rules': [ |
+ { |
+ 'rule_name': 'gen_proto', |
+ 'extension': 'proto', |
+ 'inputs': [ |
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
+ ], |
+ 'variables': { |
+ 'rule_input_relpath': 'chrome/browser/policy/proto', |
+ }, |
+ 'outputs': [ |
+ '<(PRODUCT_DIR)/pyproto/device_management_pb/<(RULE_INPUT_ROOT)_pb2.py', |
+ '<(protoc_out_dir)/<(rule_input_relpath)/<(RULE_INPUT_ROOT).pb.h', |
+ '<(protoc_out_dir)/<(rule_input_relpath)/<(RULE_INPUT_ROOT).pb.cc', |
+ ], |
+ 'action': [ |
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
+ '--proto_path=<(policy_out_dir)/policy', |
+ '<(policy_out_dir)/policy/<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)', |
+ '--cpp_out=<(protoc_out_dir)/<(rule_input_relpath)', |
+ '--python_out=<(PRODUCT_DIR)/pyproto/device_management_pb', |
+ ], |
+ 'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)', |
+ } |
+ ], |
+ 'dependencies': [ |
+ '../third_party/protobuf/protobuf.gyp:protoc#host', |
+ ], |
+ 'direct_dependent_settings': { |
+ 'include_dirs': [ |
+ '<(protoc_out_dir)', |
+ '<(SHARED_INTERMEDIATE_DIR)/policy', |
+ ] |
+ }, |
+ }, |
], |
'conditions': [ |
['OS=="win"', { |