File: BUILD.gn

package info (click to toggle)
chromium 138.0.7204.157-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,071,864 kB
  • sloc: cpp: 34,936,859; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,967; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (188 lines) | stat: -rw-r--r-- 7,342 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/gclient_args.gni")
import("//tools/json_to_struct/json_to_struct.gni")
import("//tools/metrics/histograms/histograms_xml_files.gni")

# Only include histograms_xml if we have access to dirmd data, which
# is used to populate ownership information. This is only set to false
# for non-git checkouts.
# TODO(crbug.com/329080012): Remove this once dirmd works in non-git
# checkouts.
if (generate_location_tags) {
  action("histograms_xml") {
    script = "histograms/merge_xml.py"
    output = "$root_out_dir/histograms.xml"
    outputs = [ output ]
    inputs = histograms_xml_files
    args = [
      "--output",
      rebase_path(output, root_build_dir),
    ]
  }
}

copy("actions_xml") {
  sources = [ "actions/actions.xml" ]
  outputs = [ "$root_out_dir/actions.xml" ]
}

copy("ukm_xml") {
  sources = [ "ukm/ukm.xml" ]
  outputs = [ "$root_out_dir/ukm.xml" ]
}

group("metrics_metadata") {
  deps = [
    ":actions_xml",
    ":ukm_xml",
  ]

  # Only include histograms_xml if we have access to dirmd data, which
  # is used to populate ownership information. This is only set to false
  # for non-git checkouts.
  # TODO(crbug.com/329080012): Remove this once dirmd works in non-git
  # checkouts.
  if (generate_location_tags) {
    deps += [ ":histograms_xml" ]
  }
}

# This group defines the isolate files needed to run metrics_python_tests.py on
# on bots. This also tells the build system when the tests should be re-run -
# when one of the dependent files changes.
#
# When adding new entries to this test suite, you can test things locally with
# isolation using the following command:
#
#  tools/mb/mb.py run out/gn metrics_python_tests -- \
#    --isolated-script-test-output=/tmp/output.json
#
group("metrics_python_tests") {
  data = [
    # The run_isolated_script_test.py script and its dependencies.
    "//testing/scripts/run_isolated_script_test.py",
    "//testing/scripts/common.py",

    # Scripts we depend on. Their unit tests are also included.
    "//tools/json_comment_eater/json_comment_eater.py",
    "//tools/json_comment_eater/json_comment_eater_test.py",
    "//tools/json_comment_eater/everything.json",
    "//tools/json_comment_eater/everything_expected.json",

    # The metrics_python_tests.py runner and its dependencies.
    "//tools/metrics/metrics_python_tests.py",

    "//tools/metrics/actions/action_utils.py",
    "//tools/metrics/actions/actions_model.py",
    "//tools/metrics/actions/actions_model_test.py",
    "//tools/metrics/actions/extract_actions.py",
    "//tools/metrics/actions/extract_actions_test.py",

    "//tools/metrics/common/codegen_shared_test.py",
    "//tools/metrics/common/codegen_shared.py",
    "//tools/metrics/common/diff_util.py",
    "//tools/metrics/common/model_shared.py",
    "//tools/metrics/common/models.py",
    "//tools/metrics/common/path_util.py",
    "//tools/metrics/common/presubmit_util.py",
    "//tools/metrics/common/pretty_print_xml.py",
    "//tools/metrics/common/etree_util.py",

    "//tools/metrics/dwa/builders_template.py",
    "//tools/metrics/dwa/decode_template.py",
    "//tools/metrics/dwa/dwa.xml",
    "//tools/metrics/dwa/codegen.py",
    "//tools/metrics/dwa/dwa_model.py",
    "//tools/metrics/dwa/dwa_model_test.py",
    "//tools/metrics/dwa/dwa_xml_validations.py",
    "//tools/metrics/dwa/dwa_xml_validations_test.py",
    "//tools/metrics/dwa/gen_builders.py",
    "//tools/metrics/dwa/gen_builders_test.py",

    "//tools/metrics/histograms/test_data/enums.xml",
    "//tools/metrics/histograms/test_data/histograms.xml",
    "//tools/metrics/histograms/test_data/ukm.xml",
    "//tools/metrics/histograms/enums.xml",
    "//tools/metrics/histograms/expand_owners.py",
    "//tools/metrics/histograms/expand_owners_unittest.py",
    "//tools/metrics/histograms/extract_histograms.py",
    "//tools/metrics/histograms/extract_histograms_test.py",
    "//tools/metrics/histograms/generate_expired_histograms_array.py",
    "//tools/metrics/histograms/generate_expired_histograms_array_unittest.py",
    "//tools/metrics/histograms/generate_allowlist_from_histograms_file.py",
    "//tools/metrics/histograms/generate_allowlist_from_histograms_file_unittest.py",
    "//tools/metrics/histograms/generate_flag_enums.py",
    "//tools/metrics/histograms/generate_flag_enums_test.py",
    "//tools/metrics/histograms/histogram_ownership.py",
    "//tools/metrics/histograms/histogram_configuration_model.py",
    "//tools/metrics/histograms/histogram_configuration_model_test_enums.py",
    "//tools/metrics/histograms/histogram_configuration_model_test_histograms.py",
    "//tools/metrics/histograms/histogram_paths.py",
    "//tools/metrics/histograms/merge_xml.py",
    "//tools/metrics/histograms/merge_xml_test.py",
    "//tools/metrics/histograms/populate_enums.py",
    "//tools/metrics/histograms/PRESUBMIT_test.py",
    "//tools/metrics/histograms/pretty_print.py",
    "//tools/metrics/histograms/pretty_print_test.py",
    "//tools/metrics/histograms/validate_token.py",
    "//tools/metrics/histograms/validate_token_test.py",

    "//tools/metrics/structured/codegen_unittest.py",
    "//tools/metrics/structured/sync/model_unittest.py",

    "//tools/metrics/ukm/ukm.xml",
    "//tools/metrics/ukm/codegen.py",
    "//tools/metrics/ukm/builders_template.py",
    "//tools/metrics/ukm/decode_template.py",
    "//tools/metrics/ukm/gen_builders.py",
    "//tools/metrics/ukm/gen_builders_test.py",
    "//tools/metrics/ukm/ukm_model.py",
    "//tools/metrics/ukm/ukm_model_test.py",
    "//tools/metrics/ukm/xml_validations.py",
    "//tools/metrics/ukm/xml_validations_test.py",

    "//tools/python/google/path_utils.py",

    "//tools/variations/fieldtrial_to_struct_unittest.py",
    "//tools/variations/fieldtrial_to_struct.py",
    "//tools/variations/fieldtrial_util_unittest.py",
    "//tools/variations/fieldtrial_util.py",
    "//tools/variations/split_variations_cmd_unittest.py",
    "//tools/variations/split_variations_cmd.py",
    "//tools/variations/unittest_data/expected_output.cc",
    "//tools/variations/unittest_data/expected_output.h",
    "//tools/variations/unittest_data/test_config.json",
    "//tools/variations/unittest_data/variations_cmd.txt",
    "//components/variations/field_trial_config/field_trial_testing_config_schema.json",
    "//components/variations/service/generate_ui_string_overrider.py",
    "//components/variations/service/generate_ui_string_overrider_unittest.py",
  ]

  data += JSON_TO_STRUCT_FILES + JSON_TO_STRUCT_TEST_FILES

  # Add platform-specific dependencies for dirmd.
  if (is_win) {
    data += [
      "//third_party/depot_tools/dirmd.bat",
      "//third_party/depot_tools/cipd_bin_setup.bat",
      "//third_party/depot_tools/cipd_manifest.txt",
    ]
    if (host_os == "win") {
      data += [ "//third_party/depot_tools/.cipd_bin/dirmd.exe" ]
    }
  } else {
    data += [
      "//third_party/depot_tools/dirmd",
      "//third_party/depot_tools/cipd_bin_setup.sh",
      "//third_party/depot_tools/cipd_manifest.txt",
    ]
    if (host_os != "win") {
      data += [ "//third_party/depot_tools/.cipd_bin/dirmd" ]
    }
  }

  data_deps = [ "//testing:test_scripts_shared" ]
}