Commit 36b71b7b authored by kushi.p@gmail.com's avatar kushi.p@gmail.com

Remove hand-rolled cases of protobufs generations/compilation

using src/build/protoc.gypi to offer consistency between the other
compilation steps, as well as ensuring that important variables (such as
hard_dependency) are always properly set.

BUG=109955


Review URL: http://codereview.chromium.org/9148084

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120063 0039d316-1c4b-4281-b951-d872f2087c98
parent 3d925de1
......@@ -60,37 +60,17 @@
{
'target_name': 'cloud_policy_proto_compile',
'type': 'none',
'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': [
'<(policy_out_dir)/policy/cloud_policy.proto',
],
'variables': {
'proto_in_dir': '<(policy_out_dir)/policy',
'proto_out_dir': '<(proto_path_substr)',
},
'dependencies': [
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
'cloud_policy_code_generate',
],
'direct_dependent_settings': {
'include_dirs': [
'<(protoc_out_dir)',
]
},
'includes': [ '../../../build/protoc.gypi' ],
},
{
'target_name': 'cloud_policy_backend_header_compile',
......@@ -101,36 +81,14 @@
'<(proto_rel_path)/device_management_local.proto',
'<(proto_rel_path)/old_generic_format.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=<(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)',
},
],
'variables': {
'proto_in_dir': '<(proto_rel_path)',
'proto_out_dir': '<(proto_path_substr)',
},
'dependencies': [
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
'cloud_policy_code_generate',
],
'direct_dependent_settings': {
'include_dirs': [
'<(protoc_out_dir)',
]
},
'includes': [ '../../../build/protoc.gypi' ],
},
{
'target_name': 'policy',
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2012 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.
......@@ -318,7 +318,10 @@ bool TestServer::SetPythonPath() {
.AppendASCII("browser")
.AppendASCII("sync")
.AppendASCII("protocol"));
AppendToPythonPath(pyproto_dir.AppendASCII("device_management_pb"));
AppendToPythonPath(pyproto_dir.AppendASCII("chrome")
.AppendASCII("browser")
.AppendASCII("policy")
.AppendASCII("proto"));
return true;
}
......
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