2019-10-29 03:53:54 +03:00
|
|
|
# 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/.
|
2020-01-18 22:48:22 +03:00
|
|
|
|
|
|
|
from __future__ import absolute_import, print_function, unicode_literals
|
|
|
|
|
2022-04-03 04:03:58 +03:00
|
|
|
import sys
|
2020-01-18 22:48:22 +03:00
|
|
|
import os
|
|
|
|
import logging
|
|
|
|
from importlib import import_module
|
|
|
|
|
2021-10-06 07:47:46 +03:00
|
|
|
from gecko_taskgraph import GECKO
|
2020-11-15 04:48:17 +03:00
|
|
|
from comm_taskgraph.optimize import thunderbird_optimizations
|
2022-04-04 22:40:07 +03:00
|
|
|
from gecko_taskgraph.optimize.schema import set_optimization_schema # noqa: F401
|
2020-01-18 22:48:22 +03:00
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
2020-10-30 20:41:24 +03:00
|
|
|
COMM = os.path.join(GECKO, "comm")
|
|
|
|
COMM_SCRIPTS = os.path.join(COMM, "taskcluster", "scripts")
|
2020-01-18 22:48:22 +03:00
|
|
|
|
2021-03-31 23:19:03 +03:00
|
|
|
|
2020-01-18 22:48:22 +03:00
|
|
|
def register(graph_config):
|
|
|
|
"""
|
|
|
|
Import all modules that are siblings of this one, triggering decorators in
|
|
|
|
the process.
|
|
|
|
"""
|
2022-01-05 19:37:23 +03:00
|
|
|
from comm_taskgraph.parameters import register_parameters
|
|
|
|
|
2020-01-18 22:48:22 +03:00
|
|
|
logger.info("{} path registered".format(__name__))
|
2022-01-05 19:37:23 +03:00
|
|
|
register_parameters()
|
|
|
|
|
2022-04-03 04:03:58 +03:00
|
|
|
# set_optimization_schema(thunderbird_optimizations) -- bug 1762712
|
2022-04-04 22:40:07 +03:00
|
|
|
try:
|
|
|
|
task_m = sys.modules["gecko_taskgraph.transforms.task"]
|
|
|
|
except KeyError:
|
|
|
|
from gecko_taskgraph.transforms import task # noqa: F401
|
|
|
|
|
|
|
|
task_m = sys.modules["gecko_taskgraph.transforms.task"]
|
|
|
|
|
2022-04-03 04:03:58 +03:00
|
|
|
task_m.OptimizationSchema.validators = thunderbird_optimizations
|
2022-04-04 22:40:07 +03:00
|
|
|
|
2020-10-30 20:41:24 +03:00
|
|
|
_import_modules(
|
|
|
|
[
|
|
|
|
"documentation",
|
|
|
|
"util.docker",
|
|
|
|
"actions",
|
|
|
|
"target_tasks",
|
|
|
|
"transforms.job.toolchain",
|
|
|
|
]
|
|
|
|
)
|
2020-01-18 22:48:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
def _import_modules(modules):
|
|
|
|
for module in modules:
|
|
|
|
import_module(".{}".format(module), package=__name__)
|