|
| 1 | +diff --git a/BUILD.bazel b/BUILD.bazel |
| 2 | +index b64b057..a7d6524 100644 |
| 3 | +--- a/BUILD.bazel |
| 4 | ++++ b/BUILD.bazel |
| 5 | +@@ -2,10 +2,6 @@ |
| 6 | + # |
| 7 | + # See also code generation logic under generator/ |
| 8 | + |
| 9 | +-load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_files", "strip_prefix") |
| 10 | +-load("@rules_pkg//:pkg.bzl", "pkg_tar", "pkg_zip") |
| 11 | +-load("//:protobuf_javascript_release.bzl", "package_naming") |
| 12 | +- |
| 13 | + exports_files(["package.json"]) |
| 14 | + |
| 15 | + config_setting( |
| 16 | +@@ -33,72 +29,6 @@ config_setting( |
| 17 | + values = {"cpu": "darwin_x86_64"}, |
| 18 | + ) |
| 19 | + |
| 20 | +-package_naming( |
| 21 | +- name = "protobuf_javascript_pkg_naming", |
| 22 | +- platform = select({ |
| 23 | +- ":k8": "linux-x86_64", # currently the only supported build type in Github Actions |
| 24 | +- ":x64_x86_windows": "win32", |
| 25 | +- ":x64_windows": "win64", |
| 26 | +- ":darwin_arm64": "osx-aarch_64", |
| 27 | +- ":darwin_x86_64": "osx-x86_64", |
| 28 | +- "//conditions:default": "", # continues with current behavior when no --cpu is specified allowing existing internal builds to function |
| 29 | +- }), |
| 30 | +-) |
| 31 | +- |
| 32 | +-pkg_files( |
| 33 | +- name = "plugin_files", |
| 34 | +- srcs = ["//generator:protoc-gen-js"], |
| 35 | +- attributes = pkg_attributes(mode = "0555"), |
| 36 | +- prefix = "bin/", |
| 37 | +-) |
| 38 | +- |
| 39 | +-pkg_files( |
| 40 | +- name = "dist_files", |
| 41 | +- srcs = glob( |
| 42 | +- [ |
| 43 | +- "google/protobuf/*.js", |
| 44 | +- "google/protobuf/compiler/*.js", |
| 45 | +- ], |
| 46 | +- allow_empty = True, |
| 47 | +- ) + [ |
| 48 | +- "LICENSE.md", |
| 49 | +- "LICENSE-asserts.md", |
| 50 | +- "README.md", |
| 51 | +- "google-protobuf.js", |
| 52 | +- "package.json", |
| 53 | +- ], |
| 54 | +- strip_prefix = strip_prefix.from_root(""), |
| 55 | +-) |
| 56 | +- |
| 57 | +-pkg_tar( |
| 58 | +- name = "dist_tar", |
| 59 | +- srcs = [ |
| 60 | +- ":dist_files", |
| 61 | +- ":plugin_files", |
| 62 | +- ], |
| 63 | +- extension = "tar.gz", |
| 64 | +- package_file_name = "protobuf-javascript-{version}-{platform}.tar.gz", |
| 65 | +- package_variables = ":protobuf_javascript_pkg_naming", |
| 66 | +-) |
| 67 | +- |
| 68 | +-pkg_zip( |
| 69 | +- name = "dist_zip", |
| 70 | +- srcs = [ |
| 71 | +- ":dist_files", |
| 72 | +- ":plugin_files", |
| 73 | +- ], |
| 74 | +- package_file_name = "protobuf-javascript-{version}-{platform}.zip", |
| 75 | +- package_variables = ":protobuf_javascript_pkg_naming", |
| 76 | +-) |
| 77 | +- |
| 78 | +-filegroup( |
| 79 | +- name = "dist_all", |
| 80 | +- srcs = [ |
| 81 | +- ":dist_tar", |
| 82 | +- ":dist_zip", |
| 83 | +- ], |
| 84 | +-) |
| 85 | +- |
| 86 | + filegroup( |
| 87 | + name = "javascript", |
| 88 | + srcs = [ |
0 commit comments