Skip to content

Commit

Permalink
Generate base template from bazel consts
Browse files Browse the repository at this point in the history
  • Loading branch information
adierkens committed Jul 21, 2022
1 parent 64d7304 commit d6742fe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
6 changes: 6 additions & 0 deletions index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ load("@rules_player//player/bundle:bundle.bzl", "bundle")

lint_exts = [".ts", ".js", ".jsx", ".tsx", ".json", ".snap"]

GIT_REPO = "https://github.com/player-ui/player-ui.git"
LICENSE = "MIT"
DOCS_URL = "https://player-ui.github.io"
REPO_URL = "https://github.com/player-ui/player-ui"
ISSUES_URL = "%s/issues" % REPO_URL

DATA = []
BUILD_DATA = []
TEST_DATA = [
Expand Down
21 changes: 20 additions & 1 deletion tools/BUILD
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
load("@rules_player//javascript/package_json:index.bzl", "merge_json", "create_contributors")
load("//:index.bzl", "GIT_REPO", "LICENSE", "DOCS_URL", "REPO_URL", "ISSUES_URL")
package(default_visibility = ["//visibility:public"])

create_contributors(
name = "pkg_json_contrib",
all_contributors = "//:.all-contributorsrc",
)

genrule(
name = "pkg_json_base",
outs = ["pkg_json_base.json"],
cmd = """
echo '{
"license": "%s",
"repository": {
"type": "git",
"url": "%s"
},
"bugs": {
"url": "%s"
},
"homepage": "%s"
}' > $@
""" % (LICENSE, REPO_URL, ISSUES_URL, DOCS_URL),
)

merge_json(
name = "pkg_json_template",
srcs = [
"package-template.json",
":pkg_json_base",
":pkg_json_contrib",
]
)
Expand Down
11 changes: 0 additions & 11 deletions tools/package-template.json

This file was deleted.

0 comments on commit d6742fe

Please sign in to comment.