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..1d51efcb41b9220b95dc89634941398ccf09fdaf 100644 |
--- a/chrome/app/policy/policy_templates.gypi |
+++ b/chrome/app/policy/policy_templates.gypi |
@@ -1,10 +1,12 @@ |
-# 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. |
{ |
'variables': { |
+ 'chromium_code': 1, |
'policy_out_dir': '<(SHARED_INTERMEDIATE_DIR)/policy', |
+ 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out', |
'generate_policy_source_script': |
['python', 'tools/build/generate_policy_source.py'], |
}, |
@@ -16,6 +18,8 @@ |
[ 'policy_target==1', { |
'include_dirs': [ |
'<(policy_out_dir)', |
+ '<(protoc_out_dir)', |
+ '../../..', |
], |
'actions': [ |
{ |
@@ -27,6 +31,8 @@ |
'<(policy_out_dir)/policy/policy_constants.cc', |
'configuration_policy_type_header': |
'<(policy_out_dir)/policy/configuration_policy_type.h', |
+ 'protobuf_decoder': |
+ '<(policy_out_dir)/policy/cloud_policy_generated.cc', |
}, |
'inputs': [ |
'policy_templates.json', |
@@ -36,6 +42,7 @@ |
'<(policy_constant_header)', |
'<(policy_constant_source)', |
'<(configuration_policy_type_header)', |
+ '<(protobuf_decoder)', |
], |
'action_name': 'generate_policy_source', |
'action': [ |
@@ -43,6 +50,7 @@ |
'--policy-constants-header=<(policy_constant_header)', |
'--policy-constants-source=<(policy_constant_source)', |
'--policy-type-header=<(configuration_policy_type_header)', |
+ '--protobuf-decoder=<(protobuf_decoder)', |
'<(OS)', |
'<@(_inputs)', |
], |
@@ -55,15 +63,113 @@ |
}, |
'targets': [ |
{ |
+ 'target_name': 'cloud_policy_proto_gen', |
+ 'type': 'none', |
+ 'hard_dependency': 1, |
danno
2011/02/03 15:31:38
you don't need this, because it is not a shared li
Jakob Kummerow
2011/02/08 16:15:43
Done.
|
+ 'actions': [ |
+ { |
+ 'variables': { |
+ 'cloud_policy_proto': |
+ '<(policy_out_dir)/policy/cloud_policy.proto', |
+ }, |
+ 'inputs': [ |
+ 'policy_templates.json', |
+ '../../tools/build/generate_policy_source.py' |
+ ], |
+ 'outputs': [ |
+ '<(cloud_policy_proto)', |
+ ], |
+ 'action_name': 'generate_cloud_policy_proto', |
+ 'action': [ |
+ '<@(generate_policy_source_script)', |
+ '--policy-protobuf=<(cloud_policy_proto)', |
+ '<(OS)', |
+ '<@(_inputs)', |
+ ], |
+ 'message': 'Generating cloud policy protobuf', |
+ }, |
+ ], |
+ }, |
+ { |
+ 'target_name': 'cloud_policy_proto', |
+ 'type': 'none', |
+ 'variables': { |
+ 'proto_path_substr': 'chrome/browser/policy/proto', |
+ 'proto_rel_path': '../../../<(proto_path_substr)', |
+ }, |
+ 'actions': [ |
+ { |
+ 'action_name': 'compile_generated_proto', |
+ 'inputs': [ |
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
+ '<(policy_out_dir)/policy/cloud_policy.proto', |
+ ], |
+ 'outputs': [ |
+ '<(PRODUCT_DIR)/pyproto/device_management_pb/cloud_policy_pb2.py', |
+ '<(protoc_out_dir)/<(proto_path_substr)/cloud_policy.pb.h', |
+ '<(protoc_out_dir)/<(proto_path_substr)/cloud_policy.pb.cc', |
+ ], |
+ 'action': [ |
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
+ '--proto_path=<(policy_out_dir)/policy', |
+ '<(policy_out_dir)/policy/cloud_policy.proto', |
+ '--cpp_out=<(protoc_out_dir)/<(proto_path_substr)', |
+ '--python_out=<(PRODUCT_DIR)/pyproto/device_management_pb', |
+ ], |
+ 'message': 'Compiling generated cloud policy protobuf', |
+ }, |
+ ], |
+ 'sources': [ |
+ '<(proto_rel_path)/device_management_backend.proto', |
+ '<(proto_rel_path)/device_management_local.proto', |
+ ], |
+ 'rules': [ |
+ { |
+ 'rule_name': 'gen_proto', |
+ 'extension': 'proto', |
+ 'inputs': [ |
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
+ ], |
+ 'outputs': [ |
+ '<(PRODUCT_DIR)/pyproto/device_management_pb/<(RULE_INPUT_ROOT)_pb2.py', |
+ '<(protoc_out_dir)/<(proto_path_substr)/<(RULE_INPUT_ROOT).pb.h', |
+ '<(protoc_out_dir)/<(proto_path_substr)/<(RULE_INPUT_ROOT).pb.cc', |
+ ], |
+ 'action': [ |
+ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
+ '--proto_path=<(policy_out_dir)/policy', |
+ '--proto_path=<(proto_rel_path)', |
+ '<(proto_rel_path)/<(RULE_INPUT_NAME)', |
+ '--cpp_out=<(protoc_out_dir)/<(proto_path_substr)', |
+ '--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', |
+ 'cloud_policy_proto_gen', |
+ ], |
+ 'direct_dependent_settings': { |
+ 'include_dirs': [ |
+ '<(protoc_out_dir)', |
+ ] |
+ }, |
+ }, |
+ { |
'target_name': 'policy', |
'type': '<(library)', |
'hard_dependency': 1, |
'include_dirs': [ |
'<(policy_out_dir)', |
], |
+ 'dependencies': [ |
+ 'cloud_policy_proto', |
+ '../third_party/protobuf/protobuf.gyp:protobuf_lite', |
+ ], |
'direct_dependent_settings': { |
'include_dirs': [ |
- '<(SHARED_INTERMEDIATE_DIR)/policy' |
+ '<(policy_out_dir)' |
], |
}, |
'variables': { |
@@ -83,7 +189,7 @@ |
}, |
'direct_dependent_settings': { |
'include_dirs': [ |
- '<(SHARED_INTERMEDIATE_DIR)/policy' |
+ '<(policy_out_dir)' |
], |
}, |
'configurations': { |