mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
77991a7553
This changes the registration code so that categories are still registered in the manifest (and thus not registered in GeckoView), but the component is still always shipped. Differential Revision: https://phabricator.services.mozilla.com/D33478 --HG-- extra : moz-landing-system : lando
258 lines
7.1 KiB
Python
258 lines
7.1 KiB
Python
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
# vim: set filetype=python:
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
HAS_MISC_RULE = True
|
|
|
|
include('/ipc/chromium/chromium-config.mozbuild')
|
|
|
|
FINAL_LIBRARY = 'xul'
|
|
|
|
DIRS = [
|
|
'hybrid-content',
|
|
'pingsender',
|
|
]
|
|
|
|
DEFINES['MOZ_APP_VERSION'] = '"%s"' % CONFIG['MOZ_APP_VERSION']
|
|
|
|
LOCAL_INCLUDES += [
|
|
'/xpcom/build',
|
|
'/xpcom/threads',
|
|
]
|
|
|
|
SPHINX_TREES['telemetry'] = 'docs'
|
|
|
|
with Files('docs/**'):
|
|
SCHEDULES.exclusive = ['docs']
|
|
|
|
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
|
|
CXXFLAGS += ['-Wno-error=shadow']
|
|
|
|
if CONFIG['ENABLE_TESTS']:
|
|
# We need to use a separate directory for GeckoView gtests. See
|
|
# the comment below near MOZ_TELEMETRY_GECKOVIEW.
|
|
DIRS += [
|
|
'geckoview/gtest',
|
|
'tests/gtest'
|
|
]
|
|
|
|
TEST_DIRS += ['tests']
|
|
|
|
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
|
BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
|
|
|
|
XPIDL_SOURCES += [
|
|
'core/nsITelemetry.idl',
|
|
'other/GCTelemetry.idl',
|
|
]
|
|
|
|
XPIDL_MODULE = 'telemetry'
|
|
|
|
EXPORTS.mozilla += [
|
|
'!TelemetryEventEnums.h',
|
|
'!TelemetryHistogramEnums.h',
|
|
'!TelemetryProcessEnums.h',
|
|
'!TelemetryScalarEnums.h',
|
|
'core/ipc/TelemetryComms.h',
|
|
'core/ipc/TelemetryIPC.h',
|
|
'core/Telemetry.h',
|
|
'other/CombinedStacks.h',
|
|
'other/ProcessedStack.h',
|
|
'TelemetryOriginEnums.h',
|
|
]
|
|
|
|
EXPORTS.mozilla.telemetry += [
|
|
'core/Stopwatch.h',
|
|
]
|
|
|
|
SOURCES += [
|
|
'core/ipc/TelemetryIPC.cpp',
|
|
'core/ipc/TelemetryIPCAccumulator.cpp',
|
|
'core/Stopwatch.cpp',
|
|
'core/Telemetry.cpp',
|
|
'core/TelemetryCommon.cpp',
|
|
'core/TelemetryEvent.cpp',
|
|
'core/TelemetryHistogram.cpp',
|
|
'core/TelemetryOrigin.cpp',
|
|
'core/TelemetryScalar.cpp',
|
|
'geckoview/TelemetryGeckoViewPersistence.cpp',
|
|
'other/CombinedStacks.cpp',
|
|
'other/ProcessedStack.cpp',
|
|
'other/TelemetryIOInterposeObserver.cpp',
|
|
'other/WebrtcTelemetry.cpp',
|
|
]
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
SOURCES += [
|
|
'other/UntrustedModules.cpp',
|
|
]
|
|
|
|
# KeyedStackCapturer entirely relies on profiler to be enabled.
|
|
if CONFIG['MOZ_GECKO_PROFILER']:
|
|
SOURCES += [
|
|
'other/KeyedStackCapturer.cpp'
|
|
]
|
|
|
|
XPCOM_MANIFESTS += [
|
|
'components.conf',
|
|
'core/components.conf',
|
|
]
|
|
|
|
EXTRA_COMPONENTS += [
|
|
'TelemetryStartup.manifest'
|
|
]
|
|
|
|
EXTRA_JS_MODULES += [
|
|
'app/ClientID.jsm',
|
|
'app/TelemetryArchive.jsm',
|
|
'app/TelemetryController.jsm',
|
|
'app/TelemetryEnvironment.jsm',
|
|
'app/TelemetryReportingPolicy.jsm',
|
|
'app/TelemetryScheduler.jsm',
|
|
'app/TelemetrySend.jsm',
|
|
'app/TelemetryStorage.jsm',
|
|
'app/TelemetryTimestamps.jsm',
|
|
'app/TelemetryUtils.jsm',
|
|
'other/GCTelemetry.jsm',
|
|
'other/UITelemetry.jsm',
|
|
'pings/CoveragePing.jsm',
|
|
'pings/EcosystemTelemetry.jsm',
|
|
'pings/EventPing.jsm',
|
|
'pings/HealthPing.jsm',
|
|
'pings/ModulesPing.jsm',
|
|
'pings/PrioPing.jsm',
|
|
'pings/TelemetrySession.jsm',
|
|
'pings/UntrustedModulesPing.jsm',
|
|
'pings/UpdatePing.jsm',
|
|
'TelemetryStartup.jsm',
|
|
]
|
|
|
|
TESTING_JS_MODULES += [
|
|
'tests/unit/TelemetryArchiveTesting.jsm',
|
|
]
|
|
|
|
PYTHON_UNITTEST_MANIFESTS += [
|
|
'tests/python/python.ini',
|
|
]
|
|
|
|
GENERATED_FILES = [
|
|
'EventArtifactDefinitions.json',
|
|
'ScalarArtifactDefinitions.json',
|
|
'TelemetryEventData.h',
|
|
'TelemetryEventEnums.h',
|
|
'TelemetryHistogramData.inc',
|
|
'TelemetryHistogramEnums.h',
|
|
'TelemetryHistogramNameMap.h',
|
|
'TelemetryProcessData.h',
|
|
'TelemetryProcessEnums.h',
|
|
'TelemetryScalarData.h',
|
|
'TelemetryScalarEnums.h',
|
|
]
|
|
|
|
# Generate histogram files.
|
|
histogram_files = [
|
|
'Histograms.json',
|
|
'/dom/base/UseCounters.conf',
|
|
'/dom/base/nsDeprecatedOperationList.h',
|
|
]
|
|
|
|
data = GENERATED_FILES['TelemetryHistogramData.inc']
|
|
data.script = 'build_scripts/gen_histogram_data.py'
|
|
data.inputs = histogram_files
|
|
|
|
enums = GENERATED_FILES['TelemetryHistogramEnums.h']
|
|
enums.script = 'build_scripts/gen_histogram_enum.py'
|
|
enums.inputs = histogram_files
|
|
|
|
data = GENERATED_FILES['TelemetryHistogramNameMap.h']
|
|
data.script = 'build_scripts/gen_histogram_phf.py'
|
|
data.inputs = histogram_files
|
|
|
|
# Generate scalar files.
|
|
scalar_files = [
|
|
'Scalars.yaml',
|
|
]
|
|
|
|
scalar_data = GENERATED_FILES['TelemetryScalarData.h']
|
|
scalar_data.script = 'build_scripts/gen_scalar_data.py'
|
|
scalar_data.inputs = scalar_files
|
|
|
|
scalar_enums = GENERATED_FILES['TelemetryScalarEnums.h']
|
|
scalar_enums.script = 'build_scripts/gen_scalar_enum.py'
|
|
scalar_enums.inputs = scalar_files
|
|
|
|
# Generate the JSON scalar definitions. They will only be
|
|
# used in artifact or "build faster" builds.
|
|
scalar_json_data = GENERATED_FILES['ScalarArtifactDefinitions.json']
|
|
scalar_json_data.script = 'build_scripts/gen_scalar_data.py:generate_JSON_definitions'
|
|
scalar_json_data.inputs = scalar_files
|
|
|
|
# Move the scalars JSON file to the directory where the Firefox binary is.
|
|
FINAL_TARGET_FILES += ['!ScalarArtifactDefinitions.json']
|
|
|
|
# Generate event files.
|
|
event_files = [
|
|
'Events.yaml',
|
|
]
|
|
|
|
event_data = GENERATED_FILES['TelemetryEventData.h']
|
|
event_data.script = 'build_scripts/gen_event_data.py'
|
|
event_data.inputs = event_files
|
|
|
|
event_enums = GENERATED_FILES['TelemetryEventEnums.h']
|
|
event_enums.script = 'build_scripts/gen_event_enum.py'
|
|
event_enums.inputs = event_files
|
|
|
|
# Generate the JSON event definitions. They will only be
|
|
# used in artifact or "build faster" builds.
|
|
event_json_data = GENERATED_FILES['EventArtifactDefinitions.json']
|
|
event_json_data.script = 'build_scripts/gen_event_data.py:generate_JSON_definitions'
|
|
event_json_data.inputs = event_files
|
|
|
|
# Move the events JSON file to the directory where the Firefox binary is.
|
|
FINAL_TARGET_FILES += ['!EventArtifactDefinitions.json']
|
|
|
|
# Generate data from Processes.yaml
|
|
processes_files = [
|
|
'Processes.yaml',
|
|
]
|
|
|
|
processes_enum = GENERATED_FILES['TelemetryProcessEnums.h']
|
|
processes_enum.script = 'build_scripts/gen_process_enum.py'
|
|
processes_enum.inputs = processes_files
|
|
|
|
processes_data = GENERATED_FILES['TelemetryProcessData.h']
|
|
processes_data.script = 'build_scripts/gen_process_data.py'
|
|
processes_data.inputs = processes_files
|
|
|
|
# Add support for GeckoView: please note that building GeckoView
|
|
# implies having an Android build. The packaging step decides
|
|
# which files to include. As a consequence, we can simply only
|
|
# include the GeckoView files on all Android builds.
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
|
# Introduce this define to conditionally enable Telemetry GV code in the various
|
|
# C++ modules. We need this trick in order to run gtest coverage on Treeherder
|
|
# on platforms other than Android, since gtests on Android are not supported
|
|
# yet (see bug 1318091).
|
|
DEFINES['MOZ_TELEMETRY_GECKOVIEW'] = True
|
|
|
|
EXTRA_JS_MODULES += [
|
|
'geckoview/GeckoViewTelemetryController.jsm',
|
|
]
|
|
|
|
# Include the GeckoView testing IDL if we're building tests
|
|
# as well. This will be used in xpcshell tests.
|
|
if CONFIG['ENABLE_TESTS']:
|
|
XPIDL_SOURCES += [
|
|
'geckoview/nsITelemetryGeckoViewTesting.idl'
|
|
]
|
|
|
|
SOURCES += [
|
|
'geckoview/TelemetryGeckoViewTesting.cpp'
|
|
]
|
|
|
|
with Files('**'):
|
|
BUG_COMPONENT = ('Toolkit', 'Telemetry')
|