xref: /aosp_15_r20/external/cronet/build/config/siso/blink_all.star (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# -*- bazel-starlark -*-
2# Copyright 2023 The Chromium Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5"""Siso configuration for blink scripts."""
6
7load("@builtin//runtime.star", "runtime")
8load("@builtin//struct.star", "module")
9load("./platform.star", "platform")
10
11def __filegroups(ctx):
12    return {
13        "third_party/pyjson5/src/json5:pylib": {
14            "type": "glob",
15            "includes": ["*.py"],
16        },
17        "third_party/jinja2:pylib": {
18            "type": "glob",
19            "includes": ["*.py"],
20        },
21        "third_party/markupsafe:pylib": {
22            "type": "glob",
23            "includes": ["*.py"],
24        },
25        "third_party/blink/renderer/build/scripts:scripts": {
26            "type": "glob",
27            "includes": ["*.py"],
28        },
29        "third_party/blink/renderer/build/scripts/templates:templates": {
30            "type": "glob",
31            "includes": ["*.tmpl"],
32        },
33    }
34
35__handlers = {
36}
37
38def __step_config(ctx, step_config):
39    step_config["rules"].extend([
40        {
41            "name": "blink/generate_bindings",
42            "command_prefix": platform.python_bin + " ../../third_party/blink/renderer/bindings/scripts/generate_bindings.py",
43            "remote": True,
44            "platform_ref": "large",
45        },
46    ])
47
48    # TODO: Enable remote actions for Mac and Windows.
49    if runtime.os == "linux":
50        step_config["rules"].extend([
51            {
52                "name": "blink/run_with_pythonpath",
53                "command_prefix": platform.python_bin + " ../../third_party/blink/renderer/build/scripts/run_with_pythonpath.py -I ../../third_party/blink/renderer/build/scripts -I ../../third_party -I ../../third_party/pyjson5/src -I ../../tools ../../third_party/blink/renderer/build/scripts/",
54                # TODO: b/330095451 - specify the following inputs in GN configs.
55                "inputs": [
56                    "third_party/blink/renderer/build/scripts:scripts",
57                    "third_party/blink/renderer/build/scripts/templates:templates",
58                    "third_party/jinja2:pylib",
59                    "third_party/markupsafe:pylib",
60                    "third_party/pyjson5/src/json5:pylib",
61                ],
62                "remote": True,
63            },
64        ])
65    return step_config
66
67blink_all = module(
68    "blink_all",
69    filegroups = __filegroups,
70    handlers = __handlers,
71    step_config = __step_config,
72)
73