OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 # TODO(nparker): reduce the duplication between these two, somehow. |
| 6 |
5 # Generate the binary proto form of "file_types" from the ascii proto. | 7 # Generate the binary proto form of "file_types" from the ascii proto. |
6 action("make_file_types_protobuf") { | 8 action("make_file_types_protobuf") { |
7 script = "gen_file_type_proto.py" | 9 script = "gen_file_type_proto.py" |
8 | 10 |
9 # The output goes in $target_gen_dir since that's where | 11 # The output goes in $target_gen_dir since that's where |
10 # chrome/browser/browser_resources.grd will look for it. | 12 # chrome/browser/browser_resources.grd will look for it. |
11 | 13 |
12 input_filename = "download_file_types.asciipb" | 14 input_filename = "download_file_types.asciipb" |
13 output_filename = "$target_gen_dir/download_file_types.pb" | 15 output_filename = "$target_gen_dir/download_file_types.pb" |
14 python_path_root = "$root_build_dir/pyproto" | 16 python_path_root = "$root_build_dir/pyproto" |
(...skipping 10 matching lines...) Expand all Loading... |
25 } else if (is_mac) { | 27 } else if (is_mac) { |
26 target_arch = "mac" | 28 target_arch = "mac" |
27 } else if (is_linux) { | 29 } else if (is_linux) { |
28 target_arch = "linux" | 30 target_arch = "linux" |
29 } else { | 31 } else { |
30 # This will cause the script to fail. | 32 # This will cause the script to fail. |
31 target_arch = "unknown_target_arch" | 33 target_arch = "unknown_target_arch" |
32 } | 34 } |
33 | 35 |
34 inputs = [ | 36 inputs = [ |
35 script, | |
36 input_filename, | 37 input_filename, |
37 ] | 38 ] |
38 | 39 |
39 # This script requires the generated python proto code | 40 # This script requires the generated python proto code |
40 deps = [ | 41 deps = [ |
41 "//chrome/common/safe_browsing:proto", | 42 "//chrome/common/safe_browsing:proto", |
42 "//third_party/protobuf:py_proto", | 43 "//third_party/protobuf:py_proto", |
43 ] | 44 ] |
44 | 45 |
45 outputs = [ | 46 outputs = [ |
46 output_filename, | 47 output_filename, |
47 ] | 48 ] |
48 | 49 |
49 args = [ | 50 args = [ |
50 "-w", | 51 "-w", |
51 "-t", | 52 "-t", |
52 target_arch, | 53 target_arch, |
53 "-i", | 54 "-i", |
54 rebase_path(input_filename, root_build_dir), | 55 rebase_path(input_filename, root_build_dir), |
55 "-o", | 56 "-o", |
56 rebase_path(output_filename, root_build_dir), | 57 rebase_path(output_filename, root_build_dir), |
57 "-p", | 58 "-p", |
58 rebase_path(python_path_root, root_build_dir), | 59 rebase_path(python_path_root, root_build_dir), |
59 "-p", | 60 "-p", |
60 rebase_path(python_path_safe_browsing, root_build_dir), | 61 rebase_path(python_path_safe_browsing, root_build_dir), |
61 ] | 62 ] |
62 } | 63 } |
| 64 |
| 65 # Generate the binary proto for ALL platforms. This is only run manually |
| 66 # when pushing the files to GCS for the component-updater to pick up. |
| 67 action("make_all_file_types_protobuf") { |
| 68 script = "gen_file_type_proto.py" |
| 69 |
| 70 input_filename = "download_file_types.asciipb" |
| 71 output_filename_pattern = "$target_gen_dir/all/%d/%s/download_file_types.pb" |
| 72 python_path_root = "$root_build_dir/pyproto" |
| 73 python_path_safe_browsing = "$python_path_root/chrome/common/safe_browsing" |
| 74 |
| 75 inputs = [ |
| 76 input_filename, |
| 77 ] |
| 78 |
| 79 # This script requires the generated python proto code |
| 80 deps = [ |
| 81 "//chrome/common/safe_browsing:proto", |
| 82 "//third_party/protobuf:py_proto", |
| 83 ] |
| 84 |
| 85 # A directory, since we can't derive the actual file names here. |
| 86 outputs = [ |
| 87 "$target_gen_dir/all", |
| 88 ] |
| 89 |
| 90 args = [ |
| 91 "-w", |
| 92 "-a", |
| 93 "-i", |
| 94 rebase_path(input_filename, root_build_dir), |
| 95 "-o", |
| 96 rebase_path(output_filename_pattern, root_build_dir), |
| 97 "-p", |
| 98 rebase_path(python_path_root, root_build_dir), |
| 99 "-p", |
| 100 rebase_path(python_path_safe_browsing, root_build_dir), |
| 101 ] |
| 102 } |
OLD | NEW |