| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
| 6 import("resources/policy_templates.gni") | 6 import("resources/policy_templates.gni") |
| 7 import("//third_party/protobuf/proto_library.gni") | 7 import("//third_party/protobuf/proto_library.gni") |
| 8 import("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
| 9 | 9 |
| 10 if (is_component_build) { | 10 if (is_component_build) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 # policy. It is also the format currently used by the server. | 57 # policy. It is also the format currently used by the server. |
| 58 chrome_settings_proto_path = "$policy_gen_dir/chrome_settings.proto" | 58 chrome_settings_proto_path = "$policy_gen_dir/chrome_settings.proto" |
| 59 | 59 |
| 60 constants_header_path = "$policy_gen_dir/policy_constants.h" | 60 constants_header_path = "$policy_gen_dir/policy_constants.h" |
| 61 constants_source_path = "$policy_gen_dir/policy_constants.cc" | 61 constants_source_path = "$policy_gen_dir/policy_constants.cc" |
| 62 protobuf_decoder_path = "$policy_gen_dir/cloud_policy_generated.cc" | 62 protobuf_decoder_path = "$policy_gen_dir/cloud_policy_generated.cc" |
| 63 app_restrictions_path = "$policy_gen_dir/app_restrictions.xml" | 63 app_restrictions_path = "$policy_gen_dir/app_restrictions.xml" |
| 64 | 64 |
| 65 action("cloud_policy_code_generate") { | 65 action("cloud_policy_code_generate") { |
| 66 script = "tools/generate_policy_source.py" | 66 script = "tools/generate_policy_source.py" |
| 67 chrome_version_abspath = "//chrome/VERSION" |
| 68 chrome_version_path = rebase_path(chrome_version_abspath, root_build_dir) |
| 67 | 69 |
| 68 if (is_chromeos) { | 70 if (is_chromeos) { |
| 69 chromeos_flag = "1" | 71 chromeos_flag = "1" |
| 70 } else { | 72 } else { |
| 71 chromeos_flag = "0" | 73 chromeos_flag = "0" |
| 72 } | 74 } |
| 73 | 75 |
| 74 inputs = [ | 76 inputs = [ |
| 77 chrome_version_abspath, |
| 75 "resources/policy_templates.json", | 78 "resources/policy_templates.json", |
| 76 ] | 79 ] |
| 77 outputs = [ | 80 outputs = [ |
| 78 constants_header_path, | 81 constants_header_path, |
| 79 constants_source_path, | 82 constants_source_path, |
| 80 protobuf_decoder_path, | 83 protobuf_decoder_path, |
| 81 chrome_settings_proto_path, | 84 chrome_settings_proto_path, |
| 82 cloud_policy_proto_path, | 85 cloud_policy_proto_path, |
| 83 app_restrictions_path, | 86 app_restrictions_path, |
| 84 ] | 87 ] |
| 85 | 88 |
| 86 if (target_os != "android") { | 89 if (target_os != "android") { |
| 87 outputs -= [ app_restrictions_path ] | 90 outputs -= [ app_restrictions_path ] |
| 88 } | 91 } |
| 89 | 92 |
| 90 args = [ | 93 args = [ |
| 91 "--policy-constants-header=" + | 94 "--policy-constants-header=" + |
| 92 rebase_path(constants_header_path, root_build_dir), | 95 rebase_path(constants_header_path, root_build_dir), |
| 93 "--policy-constants-source=" + | 96 "--policy-constants-source=" + |
| 94 rebase_path(constants_source_path, root_build_dir), | 97 rebase_path(constants_source_path, root_build_dir), |
| 95 "--chrome-settings-protobuf=" + | 98 "--chrome-settings-protobuf=" + |
| 96 rebase_path(chrome_settings_proto_path, root_build_dir), | 99 rebase_path(chrome_settings_proto_path, root_build_dir), |
| 97 "--cloud-policy-protobuf=" + | 100 "--cloud-policy-protobuf=" + |
| 98 rebase_path(cloud_policy_proto_path, root_build_dir), | 101 rebase_path(cloud_policy_proto_path, root_build_dir), |
| 99 "--cloud-policy-decoder=" + | 102 "--cloud-policy-decoder=" + |
| 100 rebase_path(protobuf_decoder_path, root_build_dir), | 103 rebase_path(protobuf_decoder_path, root_build_dir), |
| 101 "--app-restrictions-definition=" + | 104 "--app-restrictions-definition=" + |
| 102 rebase_path(app_restrictions_path, root_build_dir), | 105 rebase_path(app_restrictions_path, root_build_dir), |
| 106 chrome_version_path, |
| 103 target_os, | 107 target_os, |
| 104 chromeos_flag, | 108 chromeos_flag, |
| 105 rebase_path("resources/policy_templates.json", root_build_dir), | 109 rebase_path("resources/policy_templates.json", root_build_dir), |
| 106 ] | 110 ] |
| 107 } | 111 } |
| 108 | 112 |
| 109 grit("policy_templates") { | 113 grit("policy_templates") { |
| 110 source = "resources/policy_templates.grd" | 114 source = "resources/policy_templates.grd" |
| 111 use_qualified_include = true | 115 use_qualified_include = true |
| 112 output_dir = "$root_gen_dir/chrome" | 116 output_dir = "$root_gen_dir/chrome" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 304 |
| 301 deps = [ | 305 deps = [ |
| 302 ":${target_name}__consolidate_resources", | 306 ":${target_name}__consolidate_resources", |
| 303 ":${target_name}__build_config", | 307 ":${target_name}__build_config", |
| 304 ":${target_name}__create_zip", | 308 ":${target_name}__create_zip", |
| 305 ] | 309 ] |
| 306 } | 310 } |
| 307 } | 311 } |
| 308 } | 312 } |
| 309 #TODO(GYP) chrome_manifest_bundle | 313 #TODO(GYP) chrome_manifest_bundle |
| OLD | NEW |