Skip to content

Commit 8b93b8e

Browse files
Yannicacozzette
authored andcommitted
[bazel] Move Objective-C runtime into //objectivec
Removing language-specific targets from the top-level BUILD file will allow users to keep their workspaces smaller and easier to maintain by not depending on language rules they don't need. Similar work was done for Java in protocolbuffers#7190.
1 parent 711db1d commit 8b93b8e

File tree

2 files changed

+93
-86
lines changed

2 files changed

+93
-86
lines changed

BUILD

+3-86
Original file line numberDiff line numberDiff line change
@@ -954,96 +954,13 @@ proto_lang_toolchain(
954954

955955
alias(
956956
name = "objectivec",
957-
actual = ":protobuf_objc",
957+
actual = "//objectivec",
958958
visibility = ["//visibility:public"],
959959
)
960960

961-
objc_library(
961+
alias(
962962
name = "protobuf_objc",
963-
hdrs = [
964-
"objectivec/GPBAny.pbobjc.h",
965-
"objectivec/GPBApi.pbobjc.h",
966-
"objectivec/GPBDuration.pbobjc.h",
967-
"objectivec/GPBEmpty.pbobjc.h",
968-
"objectivec/GPBFieldMask.pbobjc.h",
969-
"objectivec/GPBSourceContext.pbobjc.h",
970-
"objectivec/GPBStruct.pbobjc.h",
971-
"objectivec/GPBTimestamp.pbobjc.h",
972-
"objectivec/GPBType.pbobjc.h",
973-
"objectivec/GPBWrappers.pbobjc.h",
974-
"objectivec/GPBArray.h",
975-
"objectivec/GPBBootstrap.h",
976-
"objectivec/GPBCodedInputStream.h",
977-
"objectivec/GPBCodedOutputStream.h",
978-
"objectivec/GPBDescriptor.h",
979-
"objectivec/GPBDictionary.h",
980-
"objectivec/GPBExtensionInternals.h",
981-
"objectivec/GPBExtensionRegistry.h",
982-
"objectivec/GPBMessage.h",
983-
"objectivec/GPBProtocolBuffers.h",
984-
"objectivec/GPBProtocolBuffers_RuntimeSupport.h",
985-
"objectivec/GPBRootObject.h",
986-
"objectivec/GPBRuntimeTypes.h",
987-
"objectivec/GPBUnknownField.h",
988-
"objectivec/GPBUnknownFieldSet.h",
989-
"objectivec/GPBUtilities.h",
990-
"objectivec/GPBWellKnownTypes.h",
991-
"objectivec/GPBWireFormat.h",
992-
"objectivec/google/protobuf/Any.pbobjc.h",
993-
"objectivec/google/protobuf/Api.pbobjc.h",
994-
"objectivec/google/protobuf/Duration.pbobjc.h",
995-
"objectivec/google/protobuf/Empty.pbobjc.h",
996-
"objectivec/google/protobuf/FieldMask.pbobjc.h",
997-
"objectivec/google/protobuf/SourceContext.pbobjc.h",
998-
"objectivec/google/protobuf/Struct.pbobjc.h",
999-
"objectivec/google/protobuf/Timestamp.pbobjc.h",
1000-
"objectivec/google/protobuf/Type.pbobjc.h",
1001-
"objectivec/google/protobuf/Wrappers.pbobjc.h",
1002-
# Package private headers, but exposed because the generated sources
1003-
# need to use them.
1004-
"objectivec/GPBArray_PackagePrivate.h",
1005-
"objectivec/GPBCodedInputStream_PackagePrivate.h",
1006-
"objectivec/GPBCodedOutputStream_PackagePrivate.h",
1007-
"objectivec/GPBDescriptor_PackagePrivate.h",
1008-
"objectivec/GPBDictionary_PackagePrivate.h",
1009-
"objectivec/GPBMessage_PackagePrivate.h",
1010-
"objectivec/GPBRootObject_PackagePrivate.h",
1011-
"objectivec/GPBUnknownFieldSet_PackagePrivate.h",
1012-
"objectivec/GPBUnknownField_PackagePrivate.h",
1013-
"objectivec/GPBUtilities_PackagePrivate.h",
1014-
],
1015-
copts = [
1016-
"-Wno-vla",
1017-
],
1018-
includes = [
1019-
"objectivec",
1020-
],
1021-
non_arc_srcs = [
1022-
"objectivec/GPBAny.pbobjc.m",
1023-
"objectivec/GPBApi.pbobjc.m",
1024-
"objectivec/GPBDuration.pbobjc.m",
1025-
"objectivec/GPBEmpty.pbobjc.m",
1026-
"objectivec/GPBFieldMask.pbobjc.m",
1027-
"objectivec/GPBSourceContext.pbobjc.m",
1028-
"objectivec/GPBStruct.pbobjc.m",
1029-
"objectivec/GPBTimestamp.pbobjc.m",
1030-
"objectivec/GPBType.pbobjc.m",
1031-
"objectivec/GPBWrappers.pbobjc.m",
1032-
"objectivec/GPBArray.m",
1033-
"objectivec/GPBCodedInputStream.m",
1034-
"objectivec/GPBCodedOutputStream.m",
1035-
"objectivec/GPBDescriptor.m",
1036-
"objectivec/GPBDictionary.m",
1037-
"objectivec/GPBExtensionInternals.m",
1038-
"objectivec/GPBExtensionRegistry.m",
1039-
"objectivec/GPBMessage.m",
1040-
"objectivec/GPBRootObject.m",
1041-
"objectivec/GPBUnknownField.m",
1042-
"objectivec/GPBUnknownFieldSet.m",
1043-
"objectivec/GPBUtilities.m",
1044-
"objectivec/GPBWellKnownTypes.m",
1045-
"objectivec/GPBWireFormat.m",
1046-
],
963+
actual = "//objectivec",
1047964
visibility = ["//visibility:public"],
1048965
)
1049966

objectivec/BUILD

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
load("@rules_cc//cc:defs.bzl", "objc_library")
2+
3+
objc_library(
4+
name = "objectivec",
5+
hdrs = [
6+
"GPBAny.pbobjc.h",
7+
"GPBApi.pbobjc.h",
8+
"GPBDuration.pbobjc.h",
9+
"GPBEmpty.pbobjc.h",
10+
"GPBFieldMask.pbobjc.h",
11+
"GPBSourceContext.pbobjc.h",
12+
"GPBStruct.pbobjc.h",
13+
"GPBTimestamp.pbobjc.h",
14+
"GPBType.pbobjc.h",
15+
"GPBWrappers.pbobjc.h",
16+
"GPBArray.h",
17+
"GPBBootstrap.h",
18+
"GPBCodedInputStream.h",
19+
"GPBCodedOutputStream.h",
20+
"GPBDescriptor.h",
21+
"GPBDictionary.h",
22+
"GPBExtensionInternals.h",
23+
"GPBExtensionRegistry.h",
24+
"GPBMessage.h",
25+
"GPBProtocolBuffers.h",
26+
"GPBProtocolBuffers_RuntimeSupport.h",
27+
"GPBRootObject.h",
28+
"GPBRuntimeTypes.h",
29+
"GPBUnknownField.h",
30+
"GPBUnknownFieldSet.h",
31+
"GPBUtilities.h",
32+
"GPBWellKnownTypes.h",
33+
"GPBWireFormat.h",
34+
"google/protobuf/Any.pbobjc.h",
35+
"google/protobuf/Api.pbobjc.h",
36+
"google/protobuf/Duration.pbobjc.h",
37+
"google/protobuf/Empty.pbobjc.h",
38+
"google/protobuf/FieldMask.pbobjc.h",
39+
"google/protobuf/SourceContext.pbobjc.h",
40+
"google/protobuf/Struct.pbobjc.h",
41+
"google/protobuf/Timestamp.pbobjc.h",
42+
"google/protobuf/Type.pbobjc.h",
43+
"google/protobuf/Wrappers.pbobjc.h",
44+
# Package private headers, but exposed because the generated sources
45+
# need to use them.
46+
"GPBArray_PackagePrivate.h",
47+
"GPBCodedInputStream_PackagePrivate.h",
48+
"GPBCodedOutputStream_PackagePrivate.h",
49+
"GPBDescriptor_PackagePrivate.h",
50+
"GPBDictionary_PackagePrivate.h",
51+
"GPBMessage_PackagePrivate.h",
52+
"GPBRootObject_PackagePrivate.h",
53+
"GPBUnknownFieldSet_PackagePrivate.h",
54+
"GPBUnknownField_PackagePrivate.h",
55+
"GPBUtilities_PackagePrivate.h",
56+
],
57+
copts = [
58+
"-Wno-vla",
59+
],
60+
includes = [
61+
".",
62+
],
63+
non_arc_srcs = [
64+
"GPBAny.pbobjc.m",
65+
"GPBApi.pbobjc.m",
66+
"GPBDuration.pbobjc.m",
67+
"GPBEmpty.pbobjc.m",
68+
"GPBFieldMask.pbobjc.m",
69+
"GPBSourceContext.pbobjc.m",
70+
"GPBStruct.pbobjc.m",
71+
"GPBTimestamp.pbobjc.m",
72+
"GPBType.pbobjc.m",
73+
"GPBWrappers.pbobjc.m",
74+
"GPBArray.m",
75+
"GPBCodedInputStream.m",
76+
"GPBCodedOutputStream.m",
77+
"GPBDescriptor.m",
78+
"GPBDictionary.m",
79+
"GPBExtensionInternals.m",
80+
"GPBExtensionRegistry.m",
81+
"GPBMessage.m",
82+
"GPBRootObject.m",
83+
"GPBUnknownField.m",
84+
"GPBUnknownFieldSet.m",
85+
"GPBUtilities.m",
86+
"GPBWellKnownTypes.m",
87+
"GPBWireFormat.m",
88+
],
89+
visibility = ["//visibility:public"],
90+
)

0 commit comments

Comments
 (0)