ADD: added new version of protobuf

This commit is contained in:
Henry Winkel
2022-12-20 10:09:28 +01:00
parent 4a79559129
commit 1e2b3dda7b
1513 changed files with 123720 additions and 83381 deletions

View File

@@ -1,56 +0,0 @@
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("//build_defs:internal_shell.bzl", "inline_sh_test")
load("//:protobuf.bzl", "internal_ruby_proto_library")
filegroup(
name = "tests",
srcs = glob(["tests/*.rb"]),
)
filegroup(
name = "test_protos",
srcs = glob(["tests/*.proto"]),
)
internal_ruby_proto_library(
name = "test_ruby_protos",
srcs = [":test_protos"],
includes = ["."],
)
inline_sh_test(
name = "test",
srcs = [
"Rakefile",
],
deps = [
":test_ruby_protos",
":tests",
"//:well_known_ruby_protos",
"//ruby:protobuf",
],
cmd = """
pushd `dirname $(location Rakefile)`
RUBYLIB=.:tests:../../lib:../../../src BAZEL=true rake test
popd
""",
)
################################################################################
# Distribution files
############################################################################
pkg_files(
name = "dist_files",
srcs = glob([
"**/*.rb",
"**/*.proto"
]) + [
"BUILD.bazel",
"Rakefile",
"README.md",
"test.sh",
],
strip_prefix = strip_prefix.from_root(""),
visibility = ["//pkg:__pkg__"],
)

View File

@@ -2,17 +2,14 @@ require "rake/testtask"
# Proto for tests.
genproto_output = []
genproto_output << "tests/generated_code.rb"
genproto_output << "tests/test_import.rb"
file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task|
sh "./protoc --ruby_out=. tests/generated_code.proto"
end
unless ENV['BAZEL'] == 'true'
genproto_output << "tests/generated_code.rb"
genproto_output << "tests/test_import.rb"
file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task|
sh "./protoc --ruby_out=. tests/generated_code.proto"
end
file "tests/test_import.rb" => "tests/test_import.proto" do |file_task|
sh "./protoc --ruby_out=. tests/test_import.proto"
end
file "tests/test_import.rb" => "tests/test_import.proto" do |file_task|
sh "./protoc --ruby_out=. tests/test_import.proto"
end
task :genproto => genproto_output