forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
32 lines (29 loc) · 968 Bytes
/
BUILD.bazel
File metadata and controls
32 lines (29 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@jq.bzl//jq:jq.bzl", "jq")
jq(
name = "final_package_json",
# This jq filter relies on the order of the inputs
# buildifier: do not sort
srcs = [
"root_package.json",
"project_package.json",
],
args = [
"--slurp",
],
filter_file = "//tools:package_json_release_filter.jq",
)
# jq outputs CR on windows https://github.com/stedolan/jq/issues/92
# strip the CRs to do a correct comparison on all platforms
genrule(
name = "final_package_json_cr_stripped",
srcs = [":final_package_json"],
outs = ["final_package_json_cr_stripped.json"],
cmd = "cat $(execpath :final_package_json) | sed \"s#\\r##\" > $@",
)
# Test correctness of the filter that prepares each project's package.json file for release
diff_test(
name = "package_json_filter_test",
file1 = "expected_package.json",
file2 = ":final_package_json_cr_stripped",
)