1# This Source Code Form is subject to the terms of the Mozilla Public
2# License, v. 2.0. If a copy of the MPL was not distributed with this
3# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5from __future__ import absolute_import, print_function, unicode_literals
6
7import os
8import logging
9from importlib import import_module
10
11from taskgraph import GECKO
12from taskgraph.optimize.schema import set_optimization_schema
13from comm_taskgraph.optimize import thunderbird_optimizations
14
15logger = logging.getLogger(__name__)
16
17COMM = os.path.join(GECKO, "comm")
18COMM_SCRIPTS = os.path.join(COMM, "taskcluster", "scripts")
19
20
21def register(graph_config):
22    """
23    Import all modules that are siblings of this one, triggering decorators in
24    the process.
25    """
26    logger.info("{} path registered".format(__name__))
27    set_optimization_schema(thunderbird_optimizations)
28    _import_modules(
29        [
30            "documentation",
31            "parameters",
32            "util.docker",
33            "actions",
34            "target_tasks",
35            "transforms.job.toolchain",
36        ]
37    )
38
39
40def _import_modules(modules):
41    for module in modules:
42        import_module(".{}".format(module), package=__name__)
43