-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create /release_crates/ directory that contains one directory for eac…
…h of our 3 crates that we package up. PiperOrigin-RevId: 702324286
- Loading branch information
1 parent
8f6afdc
commit 16260b1
Showing
20 changed files
with
125 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Protobuf Rust crate packaging for release. | ||
|
||
# Run the cargo test with only a bundled linux-x86_64 protoc. | ||
sh_binary( | ||
name = "cargo_test", | ||
srcs = ["cargo_test.sh"], | ||
data = [ | ||
"//rust/release_crates/protobuf:protobuf_crate", | ||
"//rust/release_crates/protobuf_codegen:protobuf_codegen_crate", | ||
"//rust/release_crates/protobuf_example:protobuf_example_crate", | ||
], | ||
tags = ["manual"], | ||
deps = ["@bazel_tools//tools/bash/runfiles"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") | ||
load("@rules_pkg//pkg:tar.bzl", "pkg_tar") | ||
load("//:protobuf_version.bzl", "PROTOBUF_RUST_VERSION") | ||
|
||
pkg_tar( | ||
name = "protobuf_crate", | ||
srcs = [ | ||
":crate_root_files", | ||
"//:LICENSE", | ||
"//rust:rust_protobuf_libupb_src", | ||
"//rust:rust_protobuf_src_dir", | ||
], | ||
visibility = ["//rust:__subpackages__"], | ||
) | ||
|
||
pkg_files( | ||
name = "crate_root_files", | ||
srcs = [":srcs"], | ||
strip_prefix = strip_prefix.from_root("rust/release_crates/protobuf"), | ||
) | ||
|
||
genrule( | ||
name = "gen_cargo_toml", | ||
srcs = ["Cargo-template.toml"], | ||
outs = ["Cargo.toml"], | ||
cmd = "cat $(SRCS) | sed -e 's/{{VERSION}}/{0}-beta/g' > $(OUTS)".format(PROTOBUF_RUST_VERSION), | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = [ | ||
"build.rs", | ||
":gen_cargo_toml", | ||
], | ||
visibility = ["//rust:__subpackages__"], | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") | ||
load("@rules_pkg//pkg:tar.bzl", "pkg_tar") | ||
load("//:protobuf_version.bzl", "PROTOBUF_RUST_VERSION") | ||
|
||
pkg_tar( | ||
name = "protobuf_codegen_crate", | ||
srcs = [ | ||
":protobuf_codegen_files", | ||
"//:LICENSE", | ||
"//rust:vendored_protocs_test", | ||
], | ||
tags = ["manual"], | ||
visibility = ["//rust:__subpackages__"], | ||
) | ||
|
||
pkg_files( | ||
name = "protobuf_codegen_files", | ||
srcs = [":srcs"], | ||
strip_prefix = strip_prefix.from_root("rust/release_crates/protobuf_codegen"), | ||
) | ||
|
||
genrule( | ||
name = "gen_cargo_toml", | ||
srcs = ["Cargo-template.toml"], | ||
outs = ["Cargo.toml"], | ||
cmd = "cat $(SRCS) | sed -e 's/{{VERSION}}/{0}-beta/g' > $(OUTS)".format(PROTOBUF_RUST_VERSION), | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = [ | ||
":gen_cargo_toml", | ||
] + glob(["src/**/*"]), | ||
visibility = ["//rust:__subpackages__"], | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") | ||
load("@rules_pkg//pkg:tar.bzl", "pkg_tar") | ||
|
||
pkg_tar( | ||
name = "protobuf_example_crate", | ||
srcs = [ | ||
":protobuf_example_files", | ||
"//:LICENSE", | ||
], | ||
visibility = ["//rust:__subpackages__"], | ||
) | ||
|
||
pkg_files( | ||
name = "protobuf_example_files", | ||
srcs = [":srcs"], | ||
strip_prefix = strip_prefix.from_root("rust/release_crates/protobuf_example"), | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**/*"]), | ||
visibility = ["//rust:__subpackages__"], | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters