Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/components/glean/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 8 kB image not shown  

Quelle  moz.build   Sprache: unbekannt

 
Spracherkennung für: .build vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

# 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/.

SPHINX_TREES["/toolkit/components/glean"] = "docs"

# Needed so that we can include IPC things.
include("/ipc/chromium/chromium-config.mozbuild")

FINAL_LIBRARY = "xul"

EXPORTS.mozilla.glean += [
    "!GleanMetrics.h",
    "!GleanPings.h",
]

EXPORTS.mozilla.glean.bindings += [
    "!GleanJSMetricsLookup.h",
    "!GleanJSPingsLookup.h",
]

include("glean.mozbuild")

EXPORTS.mozilla.glean.bindings.jog += [
    "bindings/jog/JOG.h",
]

if CONFIG["COMPILE_ENVIRONMENT"]:
    EXPORTS.mozilla.glean += [
        "!fog_ffi_generated.h",
    ]

    EXPORTS.mozilla.glean.bindings.jog += [
        "!jog_ffi_generated.h",
    ]

    CbindgenHeader("fog_ffi_generated.h", inputs=["/toolkit/components/glean"])
    CbindgenHeader(
        "jog_ffi_generated.h", inputs=["/toolkit/components/glean/bindings/jog"]
    )

UNIFIED_SOURCES += [
    "bindings/Category.cpp",
    "bindings/Glean.cpp",
    "bindings/GleanMetric.cpp",
    "bindings/GleanPings.cpp",
    "bindings/GleanWebIDL.cpp",
    "bindings/jog/JOG.cpp",
    "bindings/private/Boolean.cpp",
    "bindings/private/Common.cpp",
    "bindings/private/Counter.cpp",
    "bindings/private/CustomDistribution.cpp",
    "bindings/private/Datetime.cpp",
    "bindings/private/Denominator.cpp",
    "bindings/private/DualLabeledCounter.cpp",
    "bindings/private/Event.cpp",
    "bindings/private/Labeled.cpp",
    "bindings/private/MemoryDistribution.cpp",
    "bindings/private/Numerator.cpp",
    "bindings/private/Object.cpp",
    "bindings/private/Ping.cpp",
    "bindings/private/Quantity.cpp",
    "bindings/private/Rate.cpp",
    "bindings/private/String.cpp",
    "bindings/private/StringList.cpp",
    "bindings/private/Text.cpp",
    "bindings/private/Timespan.cpp",
    "bindings/private/TimingDistribution.cpp",
    "bindings/private/Url.cpp",
    "bindings/private/Uuid.cpp",
    "ipc/FOGIPC.cpp",
    "ipc/Support.cpp",
]

SOURCES += [
    "!EventGIFFTMap.cpp",
    "!GleanJSMetricsLookup.cpp",
    "!GleanJSPingsLookup.cpp",
    "!HistogramGIFFTMap.cpp",
    "!ScalarGIFFTMap.cpp",
]

# Provides us the list of dependent metrics|pings.yaml.
include("metrics_index.py")

# Provides the function to convert a metrics.yaml path to the name of a header.
include("build_scripts/glean_parser_ext/metrics_header_names.py")


# Allow defining metrics/pings/tags elsewhere (like for Thunderbird).
# See https://source-docs.thunderbird.net/en/latest/telemetry/index.html
# See also: MOZ_GLEAN_INTERESTING_METRICS_FILES
if CONFIG["MOZ_GLEAN_EXTRA_METRICS_FILES"]:
    metrics_yamls.extend(CONFIG["MOZ_GLEAN_EXTRA_METRICS_FILES"])
    metrics_yamls = sorted(metrics_yamls)

if CONFIG["MOZ_GLEAN_EXTRA_PINGS_FILES"]:
    pings_yamls.extend(CONFIG["MOZ_GLEAN_EXTRA_PINGS_FILES"])
    pings_yamls = sorted(pings_yamls)

if CONFIG["MOZ_GLEAN_EXTRA_TAGS_FILES"]:
    tags_yamls.extend(CONFIG["MOZ_GLEAN_EXTRA_TAGS_FILES"])
    tags_yamls = sorted(tags_yamls)

metrics_headers = sorted({
    convert_yaml_path_to_header_name(path) + ".h"
    for path in metrics_yamls
    if path != "toolkit/components/glean/metrics.yaml"
})
EXPORTS.mozilla.glean += [("!" + filename) for filename in metrics_headers]

# GeneratedFile's `inputs` are relative to our dir.
# The yamls arrays are relative to topsrcdir, so we need to transform:
metrics_yamls = ["../../../" + x for x in metrics_yamls]
pings_yamls = ["../../../" + x for x in pings_yamls]
tags_yamls = ["../../../" + x for x in tags_yamls]

glean_parser_flags = [CONFIG["MOZ_APP_VERSION"]]

# In local developer builds, we optimize for speed of recompilation above
# binary size, see bug 1944663.
if CONFIG["DEVELOPER_OPTIONS"]:
    glean_parser_flags += ["--fast-rebuild"]

GeneratedFile(
    "metrics_yamls.cached",
    script="build_scripts/glean_parser_ext/cache_yaml.py",
    flags=glean_parser_flags,
    inputs=metrics_yamls + tags_yamls,
)

GeneratedFile(
    "pings_yamls.cached",
    script="build_scripts/glean_parser_ext/cache_yaml.py",
    flags=glean_parser_flags,
    inputs=pings_yamls + tags_yamls,
)

GeneratedFile(
    "GleanMetrics.h",
    *metrics_headers,
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    flags=glean_parser_flags,
    inputs=["!metrics_yamls.cached"],
)

GeneratedFile(
    "GleanJSMetricsLookup.cpp",
    "GleanJSMetricsLookup.h",
    entry_point="js_metrics",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    flags=glean_parser_flags
    + [
        "GleanJSMetricsLookup.h",
    ],
    inputs=["!metrics_yamls.cached"],
)

GeneratedFile(
    "api/src/metrics.rs",
    entry_point="rust_metrics",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    flags=glean_parser_flags,
    inputs=["!metrics_yamls.cached"],
)

GeneratedFile(
    "/dist/@types/lib.gecko.glean.d.ts",
    entry_point="ts_metrics_pings",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    inputs=["!metrics_yamls.cached", "!pings_yamls.cached"],
    flags=glean_parser_flags,
)

GeneratedFile(
    "GleanPings.h",
    "GleanJSPingsLookup.h",
    "GleanJSPingsLookup.cpp",
    "api/src/pings.rs",
    entry_point="pings",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    flags=glean_parser_flags
    + [
        "GleanJSPingsLookup.h",
        "GleanJSPingsLookup.cpp",
        "api/src/pings.rs",
    ],
    inputs=["!pings_yamls.cached"],
)

# Glean Interface For Firefox Telemetry Maps from Glean MetricId to Telemetry ProbeId
# We split it one map per header to avoid unused function warnings on build.
GeneratedFile(
    "EventGIFFTMap.cpp",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    entry_point="gifft_map",
    flags=glean_parser_flags + ["Event"],
    inputs=["!metrics_yamls.cached"],
)

GeneratedFile(
    "HistogramGIFFTMap.cpp",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    entry_point="gifft_map",
    flags=glean_parser_flags + ["Histogram"],
    inputs=["!metrics_yamls.cached"],
)

GeneratedFile(
    "ScalarGIFFTMap.cpp",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    entry_point="gifft_map",
    flags=glean_parser_flags + ["Scalar"],
    inputs=["!metrics_yamls.cached"],
)

# JOG provides both the Rust factory for building runtime-registered metrics
# and pings _and_ the YAML file used at runtime to register those metrics and
# pings for Artifact Builds.
# The factory lives inside the `fog` crate to avoid a circular dependency.
GeneratedFile(
    "api/src/factory.rs",
    script="build_scripts/glean_parser_ext/run_glean_parser.py",
    entry_point="jog_factory",
    flags=glean_parser_flags,
    inputs=["!metrics_yamls.cached", "!pings_yamls.cached"],
)

# Only generate jogfile.json in Artifact Builds since
# its presence triggers main-thread I/O.
if CONFIG["MOZ_ARTIFACT_BUILDS"]:
    GeneratedFile(
        "jogfile.json",
        script="build_scripts/glean_parser_ext/run_glean_parser.py",
        entry_point="jog_file",
        flags=glean_parser_flags,
        inputs=["!metrics_yamls.cached", "!pings_yamls.cached"],
    )
    # Once generated, it needs to be placed somewhere it can be found.
    if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
        # Needs to go into its own folder for Gradle's `assets {}`.
        FINAL_TARGET_FILES.assets_jog += ["!jogfile.json"]
    else:
        # Ends up in GreD.
        FINAL_TARGET_FILES += ["!jogfile.json"]

if CONFIG["MOZ_GLEAN_INTERESTING_METRICS_FILES"]:
    GeneratedFile(
        "interesting_serverknobs.json",
        script="build_scripts/glean_parser_ext/interesting_serverknobs.py",
        flags=[CONFIG["MOZ_APP_VERSION"]],
        inputs=["!metrics_yamls.cached"],
    )
    # Once generated, it needs to be placed in GreD so it can be found.
    FINAL_TARGET_FILES += ["!interesting_serverknobs.json"]


DIRS += [
    "tests",  # Must be in DIRS, not TEST_DIRS or python-test won't find it.
    "xpcom",
]

with Files("docs/**"):
    SCHEDULES.exclusive = ["docs"]

with Files("**"):
    BUG_COMPONENT = ("Toolkit", "Telemetry")

[Dauer der Verarbeitung: 0.39 Sekunden]