OLD | NEW |
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
| 7 'chromium_code': 1, |
7 'policy_out_dir': '<(SHARED_INTERMEDIATE_DIR)/policy', | 8 'policy_out_dir': '<(SHARED_INTERMEDIATE_DIR)/policy', |
| 9 'protoc_out_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out', |
8 'generate_policy_source_script': | 10 'generate_policy_source_script': |
9 ['python', 'tools/build/generate_policy_source.py'], | 11 ['python', 'tools/build/generate_policy_source.py'], |
10 }, | 12 }, |
11 'target_defaults': { | 13 'target_defaults': { |
12 'variables': { | 14 'variables': { |
13 'policy_target': 0, | 15 'policy_target': 0, |
14 }, | 16 }, |
15 'target_conditions': [ | 17 'target_conditions': [ |
16 [ 'policy_target==1', { | 18 [ 'policy_target==1', { |
17 'include_dirs': [ | 19 'include_dirs': [ |
18 '<(policy_out_dir)', | 20 '<(policy_out_dir)', |
| 21 '<(protoc_out_dir)', |
| 22 '../../..', |
19 ], | 23 ], |
20 'actions': [ | 24 'actions': [ |
21 { | 25 { |
22 'variables': | 26 'variables': |
23 { | 27 { |
24 'policy_constant_header': | 28 'policy_constant_header': |
25 '<(policy_out_dir)/policy/policy_constants.h', | 29 '<(policy_out_dir)/policy/policy_constants.h', |
26 'policy_constant_source': | 30 'policy_constant_source': |
27 '<(policy_out_dir)/policy/policy_constants.cc', | 31 '<(policy_out_dir)/policy/policy_constants.cc', |
28 'configuration_policy_type_header': | 32 'configuration_policy_type_header': |
29 '<(policy_out_dir)/policy/configuration_policy_type.h', | 33 '<(policy_out_dir)/policy/configuration_policy_type.h', |
| 34 'protobuf_decoder': |
| 35 '<(policy_out_dir)/policy/cloud_policy_generated.cc', |
30 }, | 36 }, |
31 'inputs': [ | 37 'inputs': [ |
32 'policy_templates.json', | 38 'policy_templates.json', |
33 '../../tools/build/generate_policy_source.py' | 39 '../../tools/build/generate_policy_source.py' |
34 ], | 40 ], |
35 'outputs': [ | 41 'outputs': [ |
36 '<(policy_constant_header)', | 42 '<(policy_constant_header)', |
37 '<(policy_constant_source)', | 43 '<(policy_constant_source)', |
38 '<(configuration_policy_type_header)', | 44 '<(configuration_policy_type_header)', |
| 45 '<(protobuf_decoder)', |
39 ], | 46 ], |
40 'action_name': 'generate_policy_source', | 47 'action_name': 'generate_policy_source', |
41 'action': [ | 48 'action': [ |
42 '<@(generate_policy_source_script)', | 49 '<@(generate_policy_source_script)', |
43 '--policy-constants-header=<(policy_constant_header)', | 50 '--policy-constants-header=<(policy_constant_header)', |
44 '--policy-constants-source=<(policy_constant_source)', | 51 '--policy-constants-source=<(policy_constant_source)', |
45 '--policy-type-header=<(configuration_policy_type_header)', | 52 '--policy-type-header=<(configuration_policy_type_header)', |
| 53 '--protobuf-decoder=<(protobuf_decoder)', |
46 '<(OS)', | 54 '<(OS)', |
47 '<@(_inputs)', | 55 '<@(_inputs)', |
48 ], | 56 ], |
49 'message': 'Generating policy source', | 57 'message': 'Generating policy source', |
50 'process_outputs_as_sources': 1, | 58 'process_outputs_as_sources': 1, |
51 }, | 59 }, |
52 ], | 60 ], |
53 }, ], | 61 }, ], |
54 ], | 62 ], |
55 }, | 63 }, |
56 'targets': [ | 64 'targets': [ |
57 { | 65 { |
| 66 'target_name': 'cloud_policy_proto_gen', |
| 67 'type': 'none', |
| 68 'actions': [ |
| 69 { |
| 70 'variables': { |
| 71 'cloud_policy_proto': |
| 72 '<(policy_out_dir)/policy/cloud_policy.proto', |
| 73 }, |
| 74 'inputs': [ |
| 75 'policy_templates.json', |
| 76 '../../tools/build/generate_policy_source.py' |
| 77 ], |
| 78 'outputs': [ |
| 79 '<(cloud_policy_proto)', |
| 80 ], |
| 81 'action_name': 'generate_cloud_policy_proto', |
| 82 'action': [ |
| 83 '<@(generate_policy_source_script)', |
| 84 '--policy-protobuf=<(cloud_policy_proto)', |
| 85 '<(OS)', |
| 86 '<@(_inputs)', |
| 87 ], |
| 88 'message': 'Generating cloud policy protobuf', |
| 89 }, |
| 90 ], |
| 91 }, |
| 92 { |
| 93 'target_name': 'cloud_policy_proto', |
| 94 'type': 'none', |
| 95 'variables': { |
| 96 'proto_path_substr': 'chrome/browser/policy/proto', |
| 97 'proto_rel_path': '../../../<(proto_path_substr)', |
| 98 }, |
| 99 'actions': [ |
| 100 { |
| 101 'action_name': 'compile_generated_proto', |
| 102 'inputs': [ |
| 103 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 104 '<(policy_out_dir)/policy/cloud_policy.proto', |
| 105 ], |
| 106 'outputs': [ |
| 107 '<(PRODUCT_DIR)/pyproto/device_management_pb/cloud_policy_pb2.py', |
| 108 '<(protoc_out_dir)/<(proto_path_substr)/cloud_policy.pb.h', |
| 109 '<(protoc_out_dir)/<(proto_path_substr)/cloud_policy.pb.cc', |
| 110 ], |
| 111 'action': [ |
| 112 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 113 '--proto_path=<(policy_out_dir)/policy', |
| 114 '<(policy_out_dir)/policy/cloud_policy.proto', |
| 115 '--cpp_out=<(protoc_out_dir)/<(proto_path_substr)', |
| 116 '--python_out=<(PRODUCT_DIR)/pyproto/device_management_pb', |
| 117 ], |
| 118 'message': 'Compiling generated cloud policy protobuf', |
| 119 }, |
| 120 ], |
| 121 'sources': [ |
| 122 '<(proto_rel_path)/device_management_backend.proto', |
| 123 '<(proto_rel_path)/device_management_local.proto', |
| 124 ], |
| 125 'rules': [ |
| 126 { |
| 127 'rule_name': 'gen_proto', |
| 128 'extension': 'proto', |
| 129 'inputs': [ |
| 130 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 131 ], |
| 132 'outputs': [ |
| 133 '<(PRODUCT_DIR)/pyproto/device_management_pb/<(RULE_INPUT_ROOT)_pb2.
py', |
| 134 '<(protoc_out_dir)/<(proto_path_substr)/<(RULE_INPUT_ROOT).pb.h', |
| 135 '<(protoc_out_dir)/<(proto_path_substr)/<(RULE_INPUT_ROOT).pb.cc', |
| 136 ], |
| 137 'action': [ |
| 138 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', |
| 139 '--proto_path=<(policy_out_dir)/policy', |
| 140 '--proto_path=<(proto_rel_path)', |
| 141 '<(proto_rel_path)/<(RULE_INPUT_NAME)', |
| 142 '--cpp_out=<(protoc_out_dir)/<(proto_path_substr)', |
| 143 '--python_out=<(PRODUCT_DIR)/pyproto/device_management_pb', |
| 144 ], |
| 145 'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)', |
| 146 } |
| 147 ], |
| 148 'dependencies': [ |
| 149 '../third_party/protobuf/protobuf.gyp:protoc#host', |
| 150 'cloud_policy_proto_gen', |
| 151 ], |
| 152 'direct_dependent_settings': { |
| 153 'include_dirs': [ |
| 154 '<(protoc_out_dir)', |
| 155 ] |
| 156 }, |
| 157 }, |
| 158 { |
58 'target_name': 'policy', | 159 'target_name': 'policy', |
59 'type': '<(library)', | 160 'type': '<(library)', |
60 'hard_dependency': 1, | 161 'hard_dependency': 1, |
61 'include_dirs': [ | 162 'include_dirs': [ |
62 '<(policy_out_dir)', | 163 '<(policy_out_dir)', |
63 ], | 164 ], |
| 165 'dependencies': [ |
| 166 'cloud_policy_proto', |
| 167 '../third_party/protobuf/protobuf.gyp:protobuf_lite', |
| 168 ], |
64 'direct_dependent_settings': { | 169 'direct_dependent_settings': { |
65 'include_dirs': [ | 170 'include_dirs': [ |
66 '<(SHARED_INTERMEDIATE_DIR)/policy' | 171 '<(policy_out_dir)' |
67 ], | 172 ], |
68 }, | 173 }, |
69 'variables': { | 174 'variables': { |
70 'policy_target': 1, | 175 'policy_target': 1, |
71 }, | 176 }, |
72 }, | 177 }, |
73 ], | 178 ], |
74 'conditions': [ | 179 'conditions': [ |
75 ['OS=="win"', { | 180 ['OS=="win"', { |
76 'targets': [ | 181 'targets': [ |
77 { | 182 { |
78 'target_name': 'policy_win64', | 183 'target_name': 'policy_win64', |
79 'type': '<(library)', | 184 'type': '<(library)', |
80 'hard_dependency': 1, | 185 'hard_dependency': 1, |
81 'variables': { | 186 'variables': { |
82 'policy_target': 1, | 187 'policy_target': 1, |
83 }, | 188 }, |
84 'direct_dependent_settings': { | 189 'direct_dependent_settings': { |
85 'include_dirs': [ | 190 'include_dirs': [ |
86 '<(SHARED_INTERMEDIATE_DIR)/policy' | 191 '<(policy_out_dir)' |
87 ], | 192 ], |
88 }, | 193 }, |
89 'configurations': { | 194 'configurations': { |
90 'Common_Base': { | 195 'Common_Base': { |
91 'msvs_target_platform': 'x64', | 196 'msvs_target_platform': 'x64', |
92 }, | 197 }, |
93 }, | 198 }, |
94 }, | 199 }, |
95 ], | 200 ], |
96 }], | 201 }], |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 ] | 366 ] |
262 }] | 367 }] |
263 ], # 'conditions' | 368 ], # 'conditions' |
264 } | 369 } |
265 | 370 |
266 # Local Variables: | 371 # Local Variables: |
267 # tab-width:2 | 372 # tab-width:2 |
268 # indent-tabs-mode:nil | 373 # indent-tabs-mode:nil |
269 # End: | 374 # End: |
270 # vim: set expandtab tabstop=2 shiftwidth=2: | 375 # vim: set expandtab tabstop=2 shiftwidth=2: |
OLD | NEW |