aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/protobuf/BUILD
blob: 0e277208a24e883133e552bcef8998995baa0a46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package(default_visibility = ["//visibility:public"])

licenses(["notice"])

load("@bazel_tools//third_party/protobuf:protobuf.bzl", "py_proto_library")

filegroup(
    name = "srcs",
    srcs = glob(
        [
            "**",
            "protobuf.bzl",
            "python/google/protobuf/**/*.py",
            "src/google/protobuf/**/*.proto",
        ],
    ),
    visibility = ["//third_party:__pkg__"],
)

filegroup(
    name = "protoc",
    srcs = select({
        "//third_party:windows_mingw": ["protoc-mingw.exe"],
        "//third_party:windows_msys64_mingw64": ["protoc-mingw.exe"],
        "//third_party:windows_msys64": ["protoc-mingw.exe"],
        "//third_party:windows_clang": ["protoc-mingw.exe"],
        "//third_party:darwin": ["protoc-osx-x86_32.exe"],
        "//third_party:k8": ["protoc-linux-x86_64.exe"],
        "//third_party:piii": ["protoc-linux-x86_32.exe"],
        "//third_party:arm": ["protoc-linux-arm32.exe"],
        "//third_party:freebsd": ["protoc-linux-x86_32.exe"],
    }),
)

java_import(
    name = "protobuf",
    jars = ["protobuf-java-3.0.0-beta-1.jar"],
)

# For bootstrapping JavaBuilder
filegroup(
    name = "protobuf-jars",
    srcs = ["protobuf-java-3.0.0-beta-1.jar"],
)

py_library(
    name = "protobuf_python_srcs",
    srcs = glob(
        [
            "python/google/protobuf/*.py",
            "python/google/protobuf/**/*.py",
        ],
    ),
    imports = ["python"],
)

py_proto_library(
    name = "protobuf_python",
    srcs = [
        "src/google/protobuf/any.proto",
        "src/google/protobuf/api.proto",
        "src/google/protobuf/compiler/plugin.proto",
        "src/google/protobuf/descriptor.proto",
        "src/google/protobuf/duration.proto",
        "src/google/protobuf/empty.proto",
        "src/google/protobuf/field_mask.proto",
        "src/google/protobuf/source_context.proto",
        "src/google/protobuf/struct.proto",
        "src/google/protobuf/timestamp.proto",
        "src/google/protobuf/type.proto",
        "src/google/protobuf/wrappers.proto",
    ],
    include = "src",
    default_runtime = "",
    protoc = ":protoc",
    py_libs = [
        ":python_srcs",
        "//third_party/py/six",
    ],
    srcs_version = "PY2AND3",
)