1. During the loading phase, bring the google/protobuf into your WORKSPACE so you can refer to it as @com_github_google_protobuf later. The bazel convention is to have fully qualified names, flattening special characters to underscore.
git_repository(
name = "com_github_google_protobuf",
tag = "v3.0.0",
)
2. During the analysis phase, load the function in your BUILD file by referring to the skylark bzl filename.
As the protobuf repo has a BUILD file in the root (which defines it as a "package"), you need to refer to the
bzl relative to the package name. That's why you need the colon.
# You can also alias the function to whatever you want with 'foo = "cc_proto_library"'
load("@com_github_google_protobuf//:protobuf.bzl", "cc_proto_library")
# These are called "target pattern operators" IIRC
@ = names an external dependency that is loaded in WORKSPACE.
// = relative to the workspace root
: relative to package
3. Call it