|
|
|
@ -1,6 +1,36 @@
|
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
|
|
|
|
|
|
load("zapp.bzl", "zapp_binary")
|
|
|
|
|
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",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Zapp plugins used as a runtime library by rules_zapp
|
|
|
|
|
py_library(
|
|
|
|
@ -11,7 +41,7 @@ py_library(
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Bootstrapping Zapp using py_binary
|
|
|
|
|
|
|
|
|
|
py_binary(
|
|
|
|
|
name = "zappc",
|
|
|
|
|
main = "compiler/__main__.py",
|
|
|
|
@ -23,7 +53,7 @@ py_binary(
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# For testing of zappc
|
|
|
|
|
# Bootstrapping because we can
|
|
|
|
|
zapp_binary(
|
|
|
|
|
name = "zappzappc",
|
|
|
|
|
main = "compiler/__main__.py",
|
|
|
|
|