|
| 1 | +diff --git a/BUILD.bazel b/BUILD.bazel |
| 2 | +index 62355ce..f989623 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 | + config_setting( |
| 14 | + name = "x64_x86_windows", |
| 15 | + values = {"cpu": "x64_x86_windows"}, |
| 16 | +@@ -31,65 +27,38 @@ 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 | +- "google/protobuf/*.js", |
| 43 | +- "google/protobuf/compiler/*.js" |
| 44 | +- ]) + [ |
| 45 | +- "google-protobuf.js", |
| 46 | +- "package.json", |
| 47 | +- "README.md", |
| 48 | +- "LICENSE.md", |
| 49 | +- "LICENSE-asserts.md", |
| 50 | +- ], |
| 51 | +- strip_prefix = strip_prefix.from_root(""), |
| 52 | +-) |
| 53 | +- |
| 54 | +-pkg_tar( |
| 55 | +- name = "dist_tar", |
| 56 | +- srcs = [ |
| 57 | +- ":dist_files", |
| 58 | +- ":plugin_files", |
| 59 | +- ], |
| 60 | +- extension = "tar.gz", |
| 61 | +- package_file_name = "protobuf-javascript-{version}-{platform}.tar.gz", |
| 62 | +- package_variables = ":protobuf_javascript_pkg_naming", |
| 63 | +-) |
| 64 | +- |
| 65 | +-pkg_zip( |
| 66 | +- name = "dist_zip", |
| 67 | +- srcs = [ |
| 68 | +- ":dist_files", |
| 69 | +- ":plugin_files", |
| 70 | +- ], |
| 71 | +- package_file_name = "protobuf-javascript-{version}-{platform}.zip", |
| 72 | +- package_variables = ":protobuf_javascript_pkg_naming", |
| 73 | +-) |
| 74 | +- |
| 75 | + filegroup( |
| 76 | +- name = "dist_all", |
| 77 | ++ name = "javascript", |
| 78 | + srcs = [ |
| 79 | +- ":dist_tar", |
| 80 | +- ":dist_zip", |
| 81 | +- ] |
| 82 | ++ "asserts.js", |
| 83 | ++ "binary/any_field_type.js", |
| 84 | ++ "binary/arith.js", |
| 85 | ++ "binary/binary_constants.js", |
| 86 | ++ "binary/bytesource.js", |
| 87 | ++ "binary/bytesource_alias.js", |
| 88 | ++ "binary/decoder.js", |
| 89 | ++ "binary/decoder_alias.js", |
| 90 | ++ "binary/encoder.js", |
| 91 | ++ "binary/encoder_alias.js", |
| 92 | ++ "binary/errors.js", |
| 93 | ++ "binary/internal_buffer.js", |
| 94 | ++ "binary/reader.js", |
| 95 | ++ "binary/reader_alias.js", |
| 96 | ++ "binary/repeated_field_type.js", |
| 97 | ++ "binary/scalar_field_type.js", |
| 98 | ++ "binary/test_utils.js", |
| 99 | ++ "binary/utf8.js", |
| 100 | ++ "binary/utils.js", |
| 101 | ++ "binary/writer.js", |
| 102 | ++ "binary/writer_alias.js", |
| 103 | ++ "bytestring.js", |
| 104 | ++ "debug.js", |
| 105 | ++ "internal_bytes.js", |
| 106 | ++ "internal_options.js", |
| 107 | ++ "internal_public.js", |
| 108 | ++ "map.js", |
| 109 | ++ "message.js", |
| 110 | ++ "unsafe_bytestring.js", |
| 111 | ++ ], |
| 112 | ++ visibility = ["//visibility:public"], |
| 113 | + ) |
0 commit comments