cabal-buck2-0.6.0.0: buck2/prelude/haskell/tools/BUCK
load("@prelude//haskell:ghc_api_tool.bzl", "GHC_API_TOOLS", "check_ghc_api_tool_sources", "ghc_api_tool_sources", "haskell_ghc_api_tool")
load("@prelude//haskell:per_module_worker.bzl", "check_per_module_worker_sources", "per_module_worker_sources")
load("@prelude//utils:source_listing.bzl", "source_listing")
oncall("build_infra")
source_listing()
prelude = native
prelude.python_bootstrap_binary(
name = "script_template_processor",
main = "script_template_processor.py",
visibility = ["PUBLIC"],
)
# The tools of the per-module compiles (see compile_per_module in
# prelude/haskell/compile_per_module.bzl), built with the toolchain's GHC.
[
haskell_ghc_api_tool(
name = name,
srcs = ghc_api_tool_sources(),
main = main + ".hs",
visibility = ["PUBLIC"],
)
for name, main in GHC_API_TOOLS.items()
]
check_ghc_api_tool_sources(glob(["ghc-api/*.hs"]))
# The tools' sources, for a toolchain that builds the tools itself (see
# ghc_api_tool_srcs()).
[
prelude.export_file(
name = src,
visibility = ["PUBLIC"],
)
for src in ghc_api_tool_sources()
]
# The sources of the persistent worker, which a toolchain builds with its own
# compiler.
prelude.filegroup(
name = "worker-srcs",
srcs = glob(["worker/src/*.hs", "worker/app/Main.hs"]),
visibility = ["PUBLIC"],
)
check_per_module_worker_sources(glob(["worker/src/*.hs"]))
# The worker's own sources, for a toolchain that builds the worker itself
# (see per_module_worker_srcs()). The sources it shares with the tools are
# exported above.
[
prelude.export_file(
name = src,
visibility = ["PUBLIC"],
)
for src in per_module_worker_sources()
]
# Type checking target for Python tool scripts
prelude.python_library(
name = "scripts-typing",
srcs = [
"script_template_processor.py",
],
typing = True,
)