blob: 2352e2c36472d2f1755083d7abbd516aa0aed4a8 [file]
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@build_bazel_rules_nodejs//:defs.bzl", "COMMON_REPLACEMENTS", "npm_package")
genrule(
name = "copy_LICENSE",
srcs = ["@build_bazel_rules_nodejs//:LICENSE"],
outs = ["LICENSE"],
cmd = "cp $< $@",
)
# Ugly genrule depending on local linux environment to build the README out of skylark doc generation.
# Only referenced when we do a release.
# TODO: This ought to be possible with stardoc alone. Need to coordinate with Chris Parsons.
genrule(
name = "generate_README",
srcs = [
"//packages/karma/docs:index.md",
"//packages/karma/docs:install.md",
],
outs = ["README.md"],
cmd = """cat $(location //packages/karma/docs:install.md) $(location //packages/karma/docs:index.md) | sed 's/^##/\\\n##/' > $@""",
visibility = ["//docs:__pkg__"],
)
npm_package(
name = "npm_package",
srcs = [
"@npm_bazel_karma//:package_contents",
],
replacements = COMMON_REPLACEMENTS,
vendor_external = [
"npm_bazel_karma",
],
deps = [
":copy_LICENSE",
":generate_README",
"@npm_bazel_karma//:bazel_karma_lib",
],
)