Bug 1933479 - Add tab close button on hover to vertical tabs when sidebar is collapse...
[gecko.git] / toolkit / components / telemetry / moz.build
blob7f9eb93225790b8ec58b363c3d8bbd68919aae0f
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 include("/ipc/chromium/chromium-config.mozbuild")
9 FINAL_LIBRARY = "xul"
11 DIRS = [
12     "pingsender",
15 if CONFIG["COMPILE_ENVIRONMENT"]:
16     EXPORTS.mozilla += ["!dap_ffi_generated.h"]
18     CbindgenHeader("dap_ffi_generated.h", inputs=["dap/ffi"])
20 DEFINES["MOZ_APP_VERSION"] = '"%s"' % CONFIG["MOZ_APP_VERSION"]
22 LOCAL_INCLUDES += [
23     "/xpcom/build",
24     "/xpcom/threads",
27 SPHINX_TREES["/toolkit/components/telemetry"] = "docs"
29 with Files("docs/**"):
30     SCHEDULES.exclusive = ["docs"]
32 if CONFIG["ENABLE_TESTS"]:
33     DIRS += ["tests/gtest"]
35 TEST_DIRS += ["tests", "dap/ffi-gtest"]
37 XPCSHELL_TESTS_MANIFESTS += [
38     "dap/tests/xpcshell/xpcshell.toml",
39     "tests/unit/xpcshell.toml",
41 BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
43 XPIDL_SOURCES += [
44     "core/nsITelemetry.idl",
45     "dap/nsIDAPTelemetry.idl",
48 XPIDL_MODULE = "telemetry"
50 EXPORTS.mozilla += [
51     "!TelemetryEventEnums.h",
52     "!TelemetryHistogramEnums.h",
53     "!TelemetryProcessEnums.h",
54     "!TelemetryScalarEnums.h",
55     "core/ipc/TelemetryComms.h",
56     "core/ipc/TelemetryIPC.h",
57     "core/Telemetry.h",
58     "dap/DAPTelemetry.h",
59     "dap/DAPTelemetryBindings.h",
60     "other/CombinedStacks.h",
61     "other/ProcessedStack.h",
64 EXPORTS.mozilla.telemetry += [
65     "core/Stopwatch.h",
68 UNIFIED_SOURCES += [
69     "core/Stopwatch.cpp",
70     "core/Telemetry.cpp",
71     "core/TelemetryCommon.cpp",
72     "core/TelemetryEvent.cpp",
73     "core/TelemetryHistogram.cpp",
74     "core/TelemetryScalar.cpp",
75     "core/TelemetryUserInteraction.cpp",
76     "dap/DAPTelemetry.cpp",
77     "other/CombinedStacks.cpp",
78     "other/ProcessedStack.cpp",
79     "other/TelemetryIOInterposeObserver.cpp",
82 # Android and iOS don't support Legacy Telemetry.
83 if CONFIG["MOZ_WIDGET_TOOLKIT"] not in ("android", "uikit"):
84     UNIFIED_SOURCES += [
85         "core/ipc/TelemetryIPC.cpp",
86         "core/ipc/TelemetryIPCAccumulator.cpp",
87     ]
88 else:
89     UNIFIED_SOURCES += [
90         "core/ipc/TelemetryIPCAccumulatorStub.cpp",
91         "core/ipc/TelemetryIPCStub.cpp",
92     ]
94 if CONFIG["OS_ARCH"] == "WINNT":
95     UNIFIED_SOURCES += [
96         "other/UntrustedModules.cpp",
97         "other/UntrustedModulesBackupService.cpp",
98         "other/UntrustedModulesDataSerializer.cpp",
99     ]
101 XPCOM_MANIFESTS += [
102     "components.conf",
103     "core/components.conf",
104     "dap/components.conf",
107 EXTRA_COMPONENTS += ["TelemetryStartup.manifest"]
109 EXTRA_JS_MODULES += [
110     "app/ClientID.sys.mjs",
111     "app/TelemetryArchive.sys.mjs",
112     "app/TelemetryController.sys.mjs",
113     "app/TelemetryControllerBase.sys.mjs",
114     "app/TelemetryControllerContent.sys.mjs",
115     "app/TelemetryControllerParent.sys.mjs",
116     "app/TelemetryEnvironment.sys.mjs",
117     "app/TelemetryReportingPolicy.sys.mjs",
118     "app/TelemetryScheduler.sys.mjs",
119     "app/TelemetrySend.sys.mjs",
120     "app/TelemetryStorage.sys.mjs",
121     "app/TelemetryTimestamps.sys.mjs",
122     "app/TelemetryUtils.sys.mjs",
123     "dap/DAPTelemetrySender.sys.mjs",
124     "dap/DAPVisitCounter.sys.mjs",
125     "pings/CoveragePing.sys.mjs",
126     "pings/EventPing.sys.mjs",
127     "pings/HealthPing.sys.mjs",
128     "pings/ModulesPing.sys.mjs",
129     "pings/TelemetrySession.sys.mjs",
130     "pings/UntrustedModulesPing.sys.mjs",
131     "pings/UpdatePing.sys.mjs",
132     "TelemetryStartup.sys.mjs",
135 EXTRA_JS_MODULES.backgroundtasks += [
136     "pings/BackgroundTask_pingsender.sys.mjs",
139 if CONFIG["OS_ARCH"] == "WINNT":
140     EXTRA_JS_MODULES += [
141         "pings/UninstallPing.sys.mjs",
142     ]
144 TESTING_JS_MODULES += [
145     "tests/unit/TelemetryArchiveTesting.sys.mjs",
146     "tests/unit/TelemetryEnvironmentTesting.sys.mjs",
149 PYTHON_UNITTEST_MANIFESTS += [
150     "tests/integration/tests/python.toml",
151     "tests/python/python.toml",
154 # Generate histogram files.
155 histogram_files = [
156     "Histograms.json",
158 if CONFIG["MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES"]:
159     histogram_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES"])
161 GeneratedFile(
162     "TelemetryHistogramData.inc",
163     script="build_scripts/gen_histogram_data.py",
164     inputs=histogram_files,
166 GeneratedFile(
167     "TelemetryHistogramEnums.h",
168     script="build_scripts/gen_histogram_enum.py",
169     inputs=histogram_files,
171 GeneratedFile(
172     "TelemetryHistogramNameMap.h",
173     script="build_scripts/gen_histogram_phf.py",
174     inputs=histogram_files,
177 # Generate scalar files.
178 scalar_files = [
179     "Scalars.yaml",
181 if CONFIG["MOZ_TELEMETRY_EXTRA_SCALAR_FILES"]:
182     scalar_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_SCALAR_FILES"])
184 GeneratedFile(
185     "TelemetryScalarData.h",
186     script="build_scripts/gen_scalar_data.py",
187     inputs=scalar_files,
189 GeneratedFile(
190     "TelemetryScalarEnums.h",
191     script="build_scripts/gen_scalar_enum.py",
192     inputs=scalar_files,
195 # Generate the JSON scalar definitions. They will only be
196 # used in artifact or "build faster" builds.
197 GeneratedFile(
198     "ScalarArtifactDefinitions.json",
199     script="build_scripts/gen_scalar_data.py",
200     entry_point="generate_JSON_definitions",
201     inputs=scalar_files,
204 # Move the scalars JSON file to the directory where the Firefox binary is.
205 FINAL_TARGET_FILES += ["!ScalarArtifactDefinitions.json"]
207 # Generate event files.
208 event_files = [
209     "Events.yaml",
211 if CONFIG["MOZ_TELEMETRY_EXTRA_EVENT_FILES"]:
212     event_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_EVENT_FILES"])
214 GeneratedFile(
215     "TelemetryEventData.h", script="build_scripts/gen_event_data.py", inputs=event_files
218 GeneratedFile(
219     "TelemetryEventEnums.h",
220     script="build_scripts/gen_event_enum.py",
221     inputs=event_files,
224 # Generate the JSON event definitions. They will only be
225 # used in artifact or "build faster" builds.
226 GeneratedFile(
227     "EventArtifactDefinitions.json",
228     script="build_scripts/gen_event_data.py",
229     entry_point="generate_JSON_definitions",
230     inputs=event_files,
233 # Move the events JSON file to the directory where the Firefox binary is.
234 FINAL_TARGET_FILES += ["!EventArtifactDefinitions.json"]
236 # Generate data from Processes.yaml
237 processes_files = [
238     "Processes.yaml",
241 GeneratedFile(
242     "TelemetryProcessEnums.h",
243     script="build_scripts/gen_process_enum.py",
244     inputs=processes_files,
248 GeneratedFile(
249     "TelemetryProcessData.h",
250     script="build_scripts/gen_process_data.py",
251     inputs=processes_files,
254 # Generate UserInteraction file
255 userinteraction_files = [
256     "UserInteractions.yaml",
258 GeneratedFile(
259     "TelemetryUserInteractionData.h",
260     script="build_scripts/gen_userinteraction_data.py",
261     inputs=userinteraction_files,
263 GeneratedFile(
264     "TelemetryUserInteractionNameMap.h",
265     script="build_scripts/gen_userinteraction_phf.py",
266     inputs=userinteraction_files,
269 with Files("**"):
270     BUG_COMPONENT = ("Toolkit", "Telemetry")