Bug 1602773 - Run glean_parser for linting metrics.yaml. r=ahal,chutten CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D64320

Depends on D64313

--HG--
extra : histedit_source : 6399e26a18fa9d8fbab1c480cb29b84d3ab46978
This commit is contained in:
Alessio Placitelli 2020-03-02 15:36:23 +00:00
Родитель 0ebaf39eca
Коммит 3ee2a27fad
2 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,17 @@
# 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/.
import sys
from glean_parser import lint
from pathlib import Path
def main(output, *filenames):
if lint.glinter([Path(x) for x in filenames], {"allow_reserved": False}):
sys.exit(1)
if __name__ == '__main__':
main(sys.stdout, *sys.argv[1:])

Просмотреть файл

@ -228,6 +228,18 @@ GeneratedFile('TelemetryProcessData.h',
py2=True,
inputs=processes_files)
# Ensure that the GeckoView metrics file parses correctly prior to it
# being released in Android components. This triggers glean_parser by
# pretending to generate a file named 'glean_checks'.
# While this currently only applies to Android, in the medium-term it
# is going to generate code for Firefox as well (project FOG).
# Prior art for this was in bug 1063728, within SpiderMonkey tests.
GeneratedFile(
'glean_checks',
script='build_scripts/run_glean_parser.py',
py2=False,
inputs=['geckoview/streaming/metrics.yaml'])
# 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