2021-08-09 15:26:06 +00:00
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
2021-08-30 03:41:20 +00:00
|
|
|
load("@rules_python//python:defs.bzl",
|
|
|
|
"py_library",
|
|
|
|
"py_runtime",
|
|
|
|
"py_runtime_pair"
|
|
|
|
)
|
|
|
|
|
|
|
|
load("zapp.bzl",
|
|
|
|
"zapp_binary"
|
|
|
|
)
|
|
|
|
|
|
|
|
# The Python runtime we need
|
|
|
|
py_runtime(
|
|
|
|
name = "python3_runtime",
|
|
|
|
files = [],
|
|
|
|
interpreter_path = "/usr/bin/python3",
|
|
|
|
python_version = "PY3",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
py_runtime_pair(
|
|
|
|
name = "python_runtime",
|
|
|
|
py2_runtime = None,
|
|
|
|
py3_runtime = ":python3_runtime",
|
|
|
|
)
|
|
|
|
|
|
|
|
toolchain(
|
|
|
|
name = "python3_toolchain",
|
|
|
|
toolchain = ":python_runtime",
|
|
|
|
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
|
|
|
|
)
|
|
|
|
|
2021-08-09 15:26:06 +00:00
|
|
|
|
|
|
|
# Zapp plugins used as a runtime library by rules_zapp
|
|
|
|
py_library(
|
|
|
|
name = "zapp_support",
|
2023-07-05 18:26:53 +00:00
|
|
|
srcs = ["__init__.py"] + glob(["support/**/*.py"]),
|
2021-08-09 15:26:06 +00:00
|
|
|
imports = [
|
2021-08-29 21:07:56 +00:00
|
|
|
"..",
|
2021-08-09 15:26:06 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2021-08-30 03:41:20 +00:00
|
|
|
|
2021-08-29 21:07:56 +00:00
|
|
|
py_binary(
|
|
|
|
name = "zappc",
|
|
|
|
main = "compiler/__main__.py",
|
|
|
|
srcs = glob(["support/**/*.py"]) + [
|
|
|
|
"compiler/__main__.py"
|
|
|
|
],
|
|
|
|
imports = [
|
|
|
|
"..",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-08-30 03:41:20 +00:00
|
|
|
# Bootstrapping because we can
|
2021-08-09 15:26:06 +00:00
|
|
|
zapp_binary(
|
2021-08-29 21:07:56 +00:00
|
|
|
name = "zappzappc",
|
|
|
|
main = "compiler/__main__.py",
|
|
|
|
srcs = glob(["support/**/*.py"]) + [
|
|
|
|
"compiler/__main__.py"
|
|
|
|
],
|
|
|
|
imports = [
|
|
|
|
"..",
|
|
|
|
],
|
2021-08-09 15:26:06 +00:00
|
|
|
)
|