blob: 24d47d6488b39ad6e0d360bc0ca5494d108bf2b6 [file] [log] [blame] [edit]
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//nodejs/private:toolchains_repo.bzl", "PLATFORMS")
load("//nodejs/private:user_build_settings.bzl", "user_args")
filegroup(
name = "package_contents",
srcs = glob(["*"]) + [
"//nodejs/private:package_contents",
],
visibility = ["//:__pkg__"],
)
bzl_library(
name = "bzl",
srcs = glob(["*.bzl"]) + ["@bazel_tools//tools:bzl_srcs"],
visibility = ["//visibility:public"],
deps = [
"//nodejs/private:bzl",
"//nodejs/private/providers:bzl",
"//third_party/github.com/bazelbuild/bazel-skylib:bzl",
],
)
# This is the target rule authors should put in their "toolchains"
# attribute in order to get a node interpreter for the correct
# platform.
# See https://docs.bazel.build/versions/main/toolchains.html#writing-rules-that-use-toolchains
toolchain_type(
name = "toolchain_type",
visibility = ["//visibility:public"],
)
[
platform(
name = key,
constraint_values = values.compatible_with,
)
for key, values in PLATFORMS.items()
]
# User set flags that are passed to the build
# you need to make sure that you pass the correct repo name infront for this flag to work
# if you are using rules from build_bazel_rules_nodejs that should be the @ in the flag
# ex: bazel build --@build_bazel_rules_nodejs//nodejs:default_args="test" main
# use rules_nodejs when you use things from that repo
# bazel test --//nodejs:default_args="" //...
user_args(
name = "default_args",
build_setting_default = "--preserve-symlinks",
visibility = ["//visibility:public"],
)