Ira Burak | e469178 | 2017-08-18 22:06:48 | [diff] [blame] | 1 | # Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | # Runs the resources map generation script other the given header files to |
| 6 | # produce an output file and a source_set to build it. |
| 7 | # |
| 8 | # Parameters: |
| 9 | # inputs: |
| 10 | # List of file name to read. Each file should be a .xml file with |
| 11 | # histogram descriptions. |
| 12 | # |
| 13 | # namespace (optional): |
| 14 | # Namespace in which the generated code should be scoped. If left empty, |
| 15 | # the code will be in the global namespace. |
| 16 | # |
| 17 | # header_filename: |
| 18 | # Name of the generated header file. |
| 19 | # |
Ira Burak | b06f55b | 2017-09-19 18:47:21 | [diff] [blame] | 20 | # major_branch_date_filepath: |
| 21 | # A path to the file with the base date. |
| 22 | # |
Gayane Petrosyan | 1099dd8 | 2018-03-20 20:35:39 | [diff] [blame] | 23 | # milestone_filepath: |
| 24 | # A path to the file with the milestone information. |
| 25 | # |
Ira Burak | e469178 | 2017-08-18 22:06:48 | [diff] [blame] | 26 | template("generate_expired_histograms_array") { |
| 27 | action(target_name) { |
| 28 | header_filename = "$target_gen_dir/" + invoker.header_filename |
| 29 | |
| 30 | script = "//tools/metrics/histograms/generate_expired_histograms_array.py" |
| 31 | outputs = [ |
| 32 | header_filename, |
| 33 | ] |
| 34 | |
| 35 | inputs = invoker.inputs |
Ira Burak | b06f55b | 2017-09-19 18:47:21 | [diff] [blame] | 36 | major_branch_date_filepath = invoker.major_branch_date_filepath |
Gayane Petrosyan | 1099dd8 | 2018-03-20 20:35:39 | [diff] [blame] | 37 | milestone_filepath = invoker.milestone_filepath |
Ira Burak | e469178 | 2017-08-18 22:06:48 | [diff] [blame] | 38 | |
| 39 | args = [] |
| 40 | |
| 41 | if (defined(invoker.namespace) && invoker.namespace != "") { |
| 42 | args += [ "-n" + invoker.namespace ] |
| 43 | } |
| 44 | |
| 45 | args += [ |
| 46 | "-o" + rebase_path(root_gen_dir, root_build_dir), |
| 47 | "-H" + rebase_path(header_filename, root_gen_dir), |
Ira Burak | b06f55b | 2017-09-19 18:47:21 | [diff] [blame] | 48 | "-d" + rebase_path(major_branch_date_filepath, root_build_dir), |
Tom Anderson | 93e774d | 2018-06-14 04:50:04 | [diff] [blame] | 49 | "-m" + rebase_path(milestone_filepath, root_build_dir), |
Ira Burak | e469178 | 2017-08-18 22:06:48 | [diff] [blame] | 50 | ] + rebase_path(inputs, root_build_dir) |
| 51 | } |
| 52 | } |