• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15licenses(["notice"])  # 3-clause BSD
16
17package(default_visibility = ["//visibility:public"])
18
19load("@com_github_grpc_grpc//bazel:objc_grpc_library.bzl", "objc_grpc_library")
20load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")
21load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application")
22
23objc_grpc_library(
24    name = "HelloWorld_grpc_proto",
25    srcs = ["//examples:protos/helloworld.proto"],
26    tags = ["manual"],
27    deps = ["//examples:helloworld_proto"],
28)
29
30# This one works with import "external/com_github_grpc_grpc/examples/protos/Helloworld.pbrpc.h"
31objc_grpc_library(
32    name = "HelloWorld_grpc_proto_external",
33    srcs = ["//external/com_github_grpc_grpc/examples:protos/helloworld.proto"],
34    tags = ["manual"],
35    deps = ["@com_github_grpc_grpc//examples:helloworld_proto"],
36)
37
38objc_library(
39    name = "HelloWorld-lib",
40    srcs = glob(["helloworld/**/*.m"]),
41    hdrs = glob(["helloworld/**/*.h"]),
42    data = glob([
43        "helloworld/HelloWorld/Base.lproj/**",
44        "helloworld/HelloWorld/Images.xcassets/**",
45    ]),
46    includes = ["helloworld/HelloWorld"],
47    tags = ["manual"],
48    deps = [":HelloWorld_grpc_proto"],
49)
50
51ios_application(
52    name = "HelloWorld",
53    bundle_id = "Google.HelloWorld",
54    families = [
55        "iphone",
56        "ipad",
57    ],
58    infoplists = ["helloworld/HelloWorld/Info.plist"],
59    minimum_os_version = "8.0",
60    tags = ["manual"],
61    deps = [":HelloWorld-lib"],
62)
63
64objc_library(
65    name = "HelloWorldMacos-lib",
66    srcs = glob(["helloworld_macos/**/*.m"]),
67    hdrs = glob(["helloworld_macos/**/*.h"]),
68    data = glob([
69        "helloworld_macos/HelloWorld/Base.lproj/**",
70        "helloworld_macos/HelloWorld/Images.xcassets/**",
71    ]),
72    includes = ["helloworld_macos/HelloWorld"],
73    tags = ["manual"],
74    deps = [":HelloWorld_grpc_proto"],
75)
76
77macos_application(
78    name = "HelloWorldMacos",
79    bundle_id = "io.grpc.HelloWorld",
80    entitlements = "helloworld_macos/HelloWorld/Helloworld.entitlements",
81    infoplists = ["helloworld_macos/HelloWorld/Info.plist"],
82    minimum_os_version = "10.13",
83    tags = ["manual"],
84    deps = [":HelloWorldMacos-lib"],
85)
86
87objc_grpc_library(
88    name = "RouteGuide",
89    srcs = ["//examples:protos/route_guide.proto"],
90    tags = ["manual"],
91    deps = ["//examples:route_guide_proto"],
92)
93
94objc_library(
95    name = "RouteGuideClient-lib",
96    srcs = glob(["route_guide/**/*.m"]),
97    hdrs = glob(["route_guide/**/*.h"]),
98    data = glob([
99        "route_guide/Misc/Base.lproj/**",
100        "route_guide/Misc/Images.xcassets/**",
101        "route_guide/route_guide_db.json",
102    ]),
103    includes = ["route_guide/Misc"],
104    tags = ["manual"],
105    deps = [":RouteGuide"],
106)
107
108ios_application(
109    name = "RouteGuideClient",
110    bundle_id = "gRPC.RouteGuideClient",
111    families = [
112        "iphone",
113        "ipad",
114    ],
115    infoplists = ["route_guide/Misc/Info.plist"],
116    minimum_os_version = "8.0",
117    tags = ["manual"],
118    deps = [":RouteGuideClient-lib"],
119)
120