| # Copyright 2017 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", "npm_package") |
| load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| exports_files([ |
| # Exported to be consumed for generating skydoc. |
| "src/jasmine_node_test.bzl", |
| ]) |
| |
| # Copy the license from our parent folder |
| 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 = [ |
| "//docs", |
| "//docs:install.md", |
| ], |
| outs = ["README.md"], |
| cmd = "unzip -o -d docs $(location //docs:docs) && cat docs/install.md docs/src/*.md | sed 's/^##/\\\n##/' > $@", |
| ) |
| |
| npm_package( |
| name = "npm_package", |
| srcs = [ |
| "BUILD.bazel", |
| "index.bzl", |
| "index.js", |
| "package.json", |
| "src/jasmine_node_test.bzl", |
| "src/jasmine_runner.js", |
| ], |
| deps = [ |
| ":copy_LICENSE", |
| ":generate_README", |
| ], |
| ) |
| |
| js_library( |
| name = "jasmine_runner", |
| srcs = [ |
| "index.js", |
| "src/jasmine_runner.js", |
| ], |
| module_name = "@bazel/jasmine", |
| ) |