load("@rules_python//python:defs.bzl", "py_binary")

py_binary(
    name = "build_qrc",
    srcs = ["build_qrc.py"],
    legacy_create_init = False,
)

genrule(
    name = "icons_qrc",
    srcs = ["//qt/aqt/data/qt/icons"],
    outs = ["icons.qrc"],
    cmd = "$(location build_qrc) $(location icons.qrc) $(SRCS)",
    tools = ["build_qrc"],
    visibility = ["//qt/aqt:__pkg__"],
)

filegroup(
    name = "qt",
    srcs = [
        "//qt/aqt/data/qt/icons",
        # not needed at runtime, but including it here ensures
        # it's up to date when a dev opens Qt Designer after a ./run
        ":icons_qrc",
    ],
    visibility = ["//qt:__subpackages__"],
)
