Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
d2d6ff51
Commit
d2d6ff51
authored
Aug 06, 2019
by
Yannic Bonenberger
Committed by
Adam Cozzette
Aug 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bazel] Load python rules from @rules_python
parent
479ba822
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
15 deletions
+23
-15
BUILD
BUILD
+1
-0
WORKSPACE
WORKSPACE
+5
-6
BUILD
examples/BUILD
+2
-2
protobuf.bzl
protobuf.bzl
+4
-4
protobuf_deps.bzl
protobuf_deps.bzl
+11
-3
No files found.
BUILD
View file @
d2d6ff51
...
...
@@ -3,6 +3,7 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library")
load("@rules_java//java:defs.bzl", "java_library")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("@rules_python//python:defs.bzl", "py_library")
licenses(["notice"])
...
...
WORKSPACE
View file @
d2d6ff51
...
...
@@ -5,18 +5,17 @@ local_repository(
path = "examples",
)
local_repository(
name = "submodule_gmock",
path = "third_party/googletest",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//:protobuf_deps.bzl", "protobuf_deps")
# Load common dependencies.
protobuf_deps()
new_local_repository(
name = "submodule_gmock",
build_file = "@//:third_party/googletest/BUILD.bazel",
path = "third_party/googletest",
)
http_archive(
name = "six",
build_file = "@//:six.BUILD",
...
...
examples/BUILD
View file @
d2d6ff51
...
...
@@ -4,9 +4,9 @@
# the WORKSPACE file in the same directory with this BUILD file for an
# example.
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_proto_library")
load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
# For each .proto file, a proto_library target should be defined. This target
# is not bound to any particular language. Instead, it defines the dependency
...
...
protobuf.bzl
View file @
d2d6ff51
load
(
"@rules_cc//cc:defs.bzl"
,
"cc_library"
)
load
(
"@bazel_skylib//lib:versions.bzl"
,
"versions"
)
load
(
"@rules_cc//cc:defs.bzl"
,
"cc_library"
)
load
(
"@rules_python//python:defs.bzl"
,
"py_library"
,
"py_test"
)
def
_GetPath
(
ctx
,
path
):
if
ctx
.
label
.
workspace_root
:
...
...
@@ -434,8 +435,7 @@ def py_proto_library(
if default_runtime and not default_runtime in py_libs + deps:
py_libs = py_libs + [default_runtime]
native.py_library(
py_library(
name = name,
srcs = outs + py_extra_srcs,
deps = py_libs + deps,
...
...
@@ -458,7 +458,7 @@ def internal_protobuf_py_tests(
"""
for m in modules:
s = "
python
/
google
/
protobuf
/
internal
/%
s
.
py
" % m
native.
py_test(
py_test(
name = "
py_
%
s
" % m,
srcs = [s],
main = s,
...
...
protobuf_deps.bzl
View file @
d2d6ff51
...
...
@@ -49,7 +49,15 @@ def protobuf_deps():
if not native.existing_rule("rules_proto"):
http_archive(
name = "rules_proto",
sha256 = "88b0a90433866b44bb4450d4c30bc5738b8c4f9c9ba14e9661deb123f56a833d",
strip_prefix = "rules_proto-b0cc14be5da05168b01db282fe93bdf17aa2b9f4",
urls = ["https://github.com/bazelbuild/rules_proto/archive/b0cc14be5da05168b01db282fe93bdf17aa2b9f4.tar.gz"],
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
urls = ["https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz"],
)
if not native.existing_rule("rules_python"):
http_archive(
name = "rules_python",
sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6",
strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27",
urls = ["https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz"],
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment