Adds a proto_library rule for each well known type proto:
$ bazel query "filter(\".*_proto$\", \"...\")"
//:wrappers_proto
//:timestamp_proto
//:struct_proto
//:field_mask_proto
//:empty_proto
//:duration_proto
//:compiler_plugin_proto
//:descriptor_proto
//:api_proto
//:type_proto
//:source_context_proto
//:any_proto
Bazel users can reference these proto_library rules for their own
language specific rules i.e.
java_proto_library(
name = "any_java_proto",
deps = ["@com_google_protobuf//:any_proto"],
)
Also set the workspace name to "com_google_protobuf", as proto_library
rules reference protobuf that way.
This change makes use of new imports attribute for Bazel's Python rules, which
enable adding directories to the PYTHONPATH. This allows us to remove
the hack for building protobuf's Python support with Bazel and now
allows projects to include protobuf using a Bazel external repository
rather than requiring it to be imported directly into the source tree as
//google/protobuf.
This change also updates the protobuf BUILD file to use a named
repository, @python//, for including Python headers rather than
//util/python. This allows projects to specify their own package for
Python headers when including protobuf with an external repository.
Fixes#1230