@ -1,8 +1,17 @@
load ( " @rules_pkg//:pkg.bzl " , " pkg_zip " )
load ( " @rules_pkg//:mappings.bzl " , " pkg_attributes " , " pkg_files " )
load ( " @rules_pkg//:pkg.bzl " , " pkg_tar " , " pkg_zip " )
load (
" @rules_pkg//:mappings.bzl " ,
" pkg_attributes " ,
" pkg_filegroup " ,
" pkg_files " ,
)
load ( " //:protobuf_release.bzl " , " package_naming " )
load ( " :cc_dist_library.bzl " , " cc_dist_library " )
package_naming (
name = " protobuf_pkg_naming " ,
)
pkg_files (
name = " wkt_protos_files " ,
srcs = [
@ -69,10 +78,6 @@ pkg_files(
visibility = [ " //visibility:private " ] ,
)
package_naming (
name = " protoc_pkg_naming " ,
)
pkg_zip (
name = " protoc_release " ,
srcs = [
@ -83,7 +88,249 @@ pkg_zip(
" :wkt_protos_files " ,
] ,
package_file_name = " protoc- {version} - {platform} .zip " ,
package_variables = " :protoc_pkg_naming " ,
package_variables = " :protobuf_pkg_naming " ,
)
################################################################################
# Source distribution packaging
#
# TODO: these will eventually replace autotools for release artifact packaging.
################################################################################
pkg_filegroup (
name = " dist_common " ,
srcs = [
" //:common_dist_files " ,
" //:conformance_dist_files " ,
" //:cpp_dist_files " , # to build protoc
" //benchmarks:all_dist_files " ,
" @com_google_protobuf_examples//:dist_files " ,
] ,
)
pkg_filegroup (
name = " cpp_srcs " ,
srcs = [
" :dist_common " ,
" //:cpp_dist_files " ,
] ,
)
pkg_tar (
name = " dist_cpp_tar " ,
srcs = [ " :cpp_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-cpp- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_cpp_zip " ,
srcs = [ " :cpp_srcs " ] ,
package_file_name = " protobuf-cpp- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " csharp_srcs " ,
srcs = [
" :dist_common " ,
" //:csharp_dist_files " ,
" //csharp:dist_files " ,
] ,
)
pkg_tar (
name = " dist_csharp_tar " ,
srcs = [ " :csharp_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-csharp- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_csharp_zip " ,
srcs = [ " :csharp_srcs " ] ,
package_file_name = " protobuf-csharp- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " java_srcs " ,
srcs = [
" :dist_common " ,
" //java:all_dist_files " ,
] ,
)
pkg_tar (
name = " dist_java_tar " ,
srcs = [ " :java_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-java- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_java_zip " ,
srcs = [ " :java_srcs " ] ,
package_file_name = " protobuf-java- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " js_srcs " ,
srcs = [
" :dist_common " ,
" //js:dist_files " ,
] ,
)
pkg_tar (
name = " dist_js_tar " ,
srcs = [ " :js_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-js- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_js_zip " ,
srcs = [ " :js_srcs " ] ,
package_file_name = " protobuf-js- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " objectivec_srcs " ,
srcs = [
" :dist_common " ,
" //:objectivec_dist_files " ,
" //objectivec:dist_files " ,
] ,
)
pkg_tar (
name = " dist_objectivec_tar " ,
srcs = [ " :objectivec_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-objectivec- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_objectivec_zip " ,
srcs = [ " :objectivec_srcs " ] ,
package_file_name = " protobuf-objectivec- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " php_srcs " ,
srcs = [
" :dist_common " ,
" //:php_dist_files " ,
" //php:dist_files " ,
] ,
)
pkg_tar (
name = " dist_php_tar " ,
srcs = [ " :php_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-php- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_php_zip " ,
srcs = [ " :php_srcs " ] ,
package_file_name = " protobuf-php- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " python_srcs " ,
srcs = [
" :dist_common " ,
" //:python_dist_files " ,
] ,
)
pkg_tar (
name = " dist_python_tar " ,
srcs = [ " :python_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-python- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_python_zip " ,
srcs = [ " :python_srcs " ] ,
package_file_name = " protobuf-python- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " ruby_srcs " ,
srcs = [
" :dist_common " ,
" //ruby:dist_files " ,
] ,
)
pkg_tar (
name = " dist_ruby_tar " ,
srcs = [ " :ruby_srcs " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-ruby- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_ruby_zip " ,
srcs = [ " :ruby_srcs " ] ,
package_file_name = " protobuf-ruby- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_filegroup (
name = " dist_all " ,
srcs = [
" :cpp_srcs " ,
" :csharp_srcs " ,
" :java_srcs " ,
" :js_srcs " ,
" :objectivec_srcs " ,
" :php_srcs " ,
" :python_srcs " ,
" :ruby_srcs " ,
] ,
)
pkg_tar (
name = " dist_all_tar " ,
srcs = [ " :dist_all " ] ,
extension = " tar.gz " ,
package_dir = " protobuf- {version} " ,
package_file_name = " protobuf-all- {version} .tar.gz " ,
package_variables = " :protobuf_pkg_naming " ,
)
pkg_zip (
name = " dist_all_zip " ,
srcs = [ " :dist_all " ] ,
package_file_name = " protobuf-all- {version} .zip " ,
package_variables = " :protobuf_pkg_naming " ,
)
################################################################################