blob: b4522465325b5ba08e39f867cc6c47c981ef282f [file] [log] [blame]
Ira Burake4691782017-08-18 22:06:481# 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 Burakb06f55b2017-09-19 18:47:2120# major_branch_date_filepath:
21# A path to the file with the base date.
22#
Gayane Petrosyan1099dd82018-03-20 20:35:3923# milestone_filepath:
24# A path to the file with the milestone information.
25#
Ira Burake4691782017-08-18 22:06:4826template("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 Burakb06f55b2017-09-19 18:47:2136 major_branch_date_filepath = invoker.major_branch_date_filepath
Gayane Petrosyan1099dd82018-03-20 20:35:3937 milestone_filepath = invoker.milestone_filepath
Ira Burake4691782017-08-18 22:06:4838
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 Burakb06f55b2017-09-19 18:47:2148 "-d" + rebase_path(major_branch_date_filepath, root_build_dir),
Tom Anderson93e774d2018-06-14 04:50:0449 "-m" + rebase_path(milestone_filepath, root_build_dir),
Ira Burake4691782017-08-18 22:06:4850 ] + rebase_path(inputs, root_build_dir)
51 }
52}