8000 Add source distribution packaging rules (#9835) · graup/protobuf-javascript@42a2873 · GitHub
[go: up one dir, main page]

Skip to content

Commit 42a2873

Browse files
authored
Add source distribution packaging rules (#9835)
This change adds `rules_pkg`-based targets that will produce source distribution archives, similar to `make dist`. These rules produce nearly the same outputs as `make dist`. However, there are some differences and caveats: 1. The outputs do not contain vendored googletest sources. 2. You have to run `autogen.sh` before `blaze build pkg:all`. This produces several autotools-related files directly into the source tree. 3. The output .zip files do not have a directory prefix like `protobuf-3.20.1-rc-1` (this will be addressed after [Substitute package variables in `pkg_zip#package_dir`. bazelbuild/rules_pkg#577](bazelbuild/rules_pkg#577); the tar files do have this prefix, though.) 4. One file is missing from the archives, which is produced during the `make` build: benchmarks/gogo/cpp_no_group/cpp_benchmark.cc 5. In several places, I have explicitly excluded some files that are not in the autotools distribution outputs. I think most of those files should probably be included, but for now, I'm aiming for parity with `make dist`. These are marked with comments, so it should be easy to clean them up later.
1 parent b52f520 commit 42a2873

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

BUILD

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Protobuf JS runtime
2+
#
3+
# See also code generation logic under /src/google/protobuf/compiler/js.
4+
5+
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
6+
7+
pkg_files(
8+
name = "dist_files",
9+
srcs = glob([
10+
"*.js",
11+
"*.json",
12+
"*.proto",
13+
"binary/*.js",
14+
"commonjs/*.js*", # js, json
15+
"commonjs/**/*.proto",
16+
"compatibility_tests/v3.0.0/**/*.js*",
17+
"compatibility_tests/v3.0.0/**/*.proto",
18+
"compatibility_tests/v3.0.0/**/*.sh",
19+
"compatibility_tests/v3.1.0/**/*.js*",
20+
"compatibility_tests/v3.1.0/**/*.proto",
21+
"experimental/benchmarks/**/*.js",
22+
"experimental/runtime/**/*.js",
23+
]) + [
24+
"BUILD",
25+
"README.md",
26+
],
27+
strip_prefix = strip_prefix.from_root(""),
28+
visibility = ["//pkg:__pkg__"],
29+
)

0 commit comments

Comments
 (0)
0