| 1 |
# gRPC Bazel BUILD file. |
| 2 |
# |
| 3 |
# Copyright 2019 gRPC authors. |
| 4 |
# |
| 5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 |
# you may not use this file except in compliance with the License. |
| 7 |
# You may obtain a copy of the License at |
| 8 |
# |
| 9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
# |
| 11 |
# Unless required by applicable law or agreed to in writing, software |
| 12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
# See the License for the specific language governing permissions and |
| 15 |
# limitations under the License. |
| 16 |
|
| 17 |
load( |
| 18 |
"//src/objective-c:grpc_objc_internal_library.bzl", |
| 19 |
"grpc_objc_examples_library", |
| 20 |
"local_objc_grpc_library", |
| 21 |
"proto_library_objc_wrapper", |
| 22 |
) |
| 23 |
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") |
| 24 |
load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_application") |
| 25 |
load("@build_bazel_rules_apple//apple:watchos.bzl", "watchos_application", "watchos_extension") |
| 26 |
|
| 27 |
licenses(["notice"]) |
| 28 |
|
| 29 |
package(default_visibility = ["//visibility:public"]) |
| 30 |
|
| 31 |
proto_library_objc_wrapper( |
| 32 |
name = "messages_proto", |
| 33 |
srcs = ["RemoteTestClient/messages.proto"], |
| 34 |
) |
| 35 |
|
| 36 |
proto_library_objc_wrapper( |
| 37 |
name = "test_proto", |
| 38 |
srcs = ["RemoteTestClient/test.proto"], |
| 39 |
use_well_known_protos = True, |
| 40 |
deps = [":messages_proto"], |
| 41 |
) |
| 42 |
|
| 43 |
# use objc_grpc_library in bazel:objc_grpc_library.bzl when developing outside the repo |
| 44 |
local_objc_grpc_library( |
| 45 |
name = "RemoteTest", |
| 46 |
srcs = ["RemoteTestClient/test.proto"], |
| 47 |
use_well_known_protos = True, |
| 48 |
deps = [ |
| 49 |
"//src/objective-c/examples:test_proto", |
| 50 |
], |
| 51 |
) |
| 52 |
|
| 53 |
# Proof that without this works without srcs |
| 54 |
local_objc_grpc_library( |
| 55 |
name = "test_objc", |
| 56 |
use_well_known_protos = True, |
| 57 |
deps = [ |
| 58 |
"//src/objective-c/examples:test_proto", |
| 59 |
], |
| 60 |
) |
| 61 |
|
| 62 |
grpc_objc_examples_library( |
| 63 |
name = "Sample-lib", |
| 64 |
srcs = glob(["Sample/Sample/**/*.m"]), |
| 65 |
hdrs = glob(["Sample/Sample/**/*.h"]), |
| 66 |
data = glob([ |
| 67 |
"Sample/Sample/Base.lproj/**", |
| 68 |
"Sample/Sample/Images.xcassets/**", |
| 69 |
]), |
| 70 |
) |
| 71 |
|
| 72 |
ios_application( |
| 73 |
name = "Sample", |
| 74 |
bundle_id = "io.grpc.Sample", |
| 75 |
families = [ |
| 76 |
"iphone", |
| 77 |
"ipad", |
| 78 |
], |
| 79 |
infoplists = ["Sample/Sample/Info.plist"], |
| 80 |
minimum_os_version = "9.0", |
| 81 |
visibility = ["//visibility:public"], |
| 82 |
deps = ["Sample-lib"], |
| 83 |
) |
| 84 |
|
| 85 |
grpc_objc_examples_library( |
| 86 |
name = "InterceptorSample-lib", |
| 87 |
srcs = glob(["InterceptorSample/InterceptorSample/**/*.m"]), |
| 88 |
hdrs = glob(["InterceptorSample/InterceptorSample/**/*.h"]), |
| 89 |
data = glob([ |
| 90 |
"InterceptorSample/InterceptorSample/Base.lproj/**", |
| 91 |
"InterceptorSample/InterceptorSample/Images.xcassets/**", |
| 92 |
]), |
| 93 |
) |
| 94 |
|
| 95 |
ios_application( |
| 96 |
name = "InterceptorSample", |
| 97 |
bundle_id = "io.grpc.InterceptorSample", |
| 98 |
families = [ |
| 99 |
"iphone", |
| 100 |
"ipad", |
| 101 |
], |
| 102 |
infoplists = ["InterceptorSample/InterceptorSample/Info.plist"], |
| 103 |
minimum_os_version = "9.0", # Safe Area Layout Guide used |
| 104 |
deps = ["InterceptorSample-lib"], |
| 105 |
) |
| 106 |
|
| 107 |
grpc_objc_examples_library( |
| 108 |
name = "tvOS-sample-lib", |
| 109 |
srcs = glob(["tvOS-sample/tvOS-sample/**/*.m"]), |
| 110 |
hdrs = glob(["tvOS-sample/tvOS-sample/**/*.h"]), |
| 111 |
data = glob([ |
| 112 |
"tvOS-sample/tvOS-sample/Base.lproj/**", |
| 113 |
"tvOS-sample/tvOS-sample/Images.xcassets/**", |
| 114 |
]), |
| 115 |
) |
| 116 |
|
| 117 |
# c-ares does not support tvOS CPU architecture with Bazel yet |
| 118 |
tvos_application( |
| 119 |
name = "tvOS-sample", |
| 120 |
bundle_id = "io.grpc.tvOS-sample", |
| 121 |
infoplists = ["tvOS-sample/tvOS-sample/Info.plist"], |
| 122 |
minimum_os_version = "10.0", |
| 123 |
deps = [":tvOS-sample-lib"], |
| 124 |
) |
| 125 |
|
| 126 |
grpc_objc_examples_library( |
| 127 |
name = "watchOS-sample-iOS-lib", |
| 128 |
srcs = glob(["watchOS-sample/watchOS-sample/**/*.m"]), |
| 129 |
hdrs = glob(["watchOS-sample/watchOS-sample/**/*.h"]), |
| 130 |
data = glob([ |
| 131 |
"watchOS-sample/watchOS-sample/Base.lproj/**", |
| 132 |
"watchOS-sample/watchOS-sample/Images.xcassets/**", |
| 133 |
]), |
| 134 |
) |
| 135 |
|
| 136 |
grpc_objc_examples_library( |
| 137 |
name = "watchOS-sample-extension-lib", |
| 138 |
srcs = glob(["watchOS-sample/WatchKit-Extention/**/*.m"]), |
| 139 |
hdrs = glob(["watchOS-sample/WatchKit-Extension/**/*.h"]), |
| 140 |
sdk_frameworks = [ |
| 141 |
"WatchConnectivity", |
| 142 |
"WatchKit", |
| 143 |
], |
| 144 |
) |
| 145 |
|
| 146 |
ios_application( |
| 147 |
name = "watchOS-sample", |
| 148 |
bundle_id = "io.grpc.watchOS-sample", |
| 149 |
families = ["iphone"], |
| 150 |
infoplists = ["watchOS-sample/watchOS-sample/Info.plist"], |
| 151 |
minimum_os_version = "9.0", # Safe Area Layout Guide used |
| 152 |
watch_application = "watchOS-sample-watchApp", |
| 153 |
deps = [":watchOS-sample-iOS-lib"], |
| 154 |
) |
| 155 |
|
| 156 |
# c-ares does not support watchOS CPU architecture with Bazel yet |
| 157 |
watchos_application( |
| 158 |
name = "watchOS-sample-watchApp", |
| 159 |
bundle_id = "io.grpc.watchOS-sample.watchkitapp", |
| 160 |
extension = ":watchOS-sample-extension", |
| 161 |
infoplists = ["watchOS-sample/WatchKit-App/Info.plist"], |
| 162 |
minimum_os_version = "4.0", |
| 163 |
storyboards = ["watchOS-sample/WatchKit-App/Base.lproj/Interface.storyboard"], |
| 164 |
) |
| 165 |
|
| 166 |
watchos_extension( |
| 167 |
name = "watchOS-sample-extension", |
| 168 |
bundle_id = "io.grpc.watchOS-sample.watchkitapp.watchkitextension", |
| 169 |
infoplists = ["watchOS-sample/WatchKit-Extension/Info.plist"], |
| 170 |
minimum_os_version = "4.0", |
| 171 |
deps = [":watchOS-sample-extension-lib"], |
| 172 |
) |