Skip to content

Commit

Permalink
[bazel] Move Objective-C runtime into //objectivec
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Yannic committed Jul 8, 2020
1 parent c02ded7 commit 132274f
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 86 deletions.
89 changes: 3 additions & 86 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -954,96 +954,13 @@ proto_lang_toolchain(

alias(
name = "objectivec",
actual = ":protobuf_objc",
actual = "//objectivec",
visibility = ["//visibility:public"],
)

objc_library(
alias(
name = "protobuf_objc",
hdrs = [
"objectivec/GPBAny.pbobjc.h",
"objectivec/GPBApi.pbobjc.h",
"objectivec/GPBDuration.pbobjc.h",
"objectivec/GPBEmpty.pbobjc.h",
"objectivec/GPBFieldMask.pbobjc.h",
"objectivec/GPBSourceContext.pbobjc.h",
"objectivec/GPBStruct.pbobjc.h",
"objectivec/GPBTimestamp.pbobjc.h",
"objectivec/GPBType.pbobjc.h",
"objectivec/GPBWrappers.pbobjc.h",
"objectivec/GPBArray.h",
"objectivec/GPBBootstrap.h",
"objectivec/GPBCodedInputStream.h",
"objectivec/GPBCodedOutputStream.h",
"objectivec/GPBDescriptor.h",
"objectivec/GPBDictionary.h",
"objectivec/GPBExtensionInternals.h",
"objectivec/GPBExtensionRegistry.h",
"objectivec/GPBMessage.h",
"objectivec/GPBProtocolBuffers.h",
"objectivec/GPBProtocolBuffers_RuntimeSupport.h",
"objectivec/GPBRootObject.h",
"objectivec/GPBRuntimeTypes.h",
"objectivec/GPBUnknownField.h",
"objectivec/GPBUnknownFieldSet.h",
"objectivec/GPBUtilities.h",
"objectivec/GPBWellKnownTypes.h",
"objectivec/GPBWireFormat.h",
"objectivec/google/protobuf/Any.pbobjc.h",
"objectivec/google/protobuf/Api.pbobjc.h",
"objectivec/google/protobuf/Duration.pbobjc.h",
"objectivec/google/protobuf/Empty.pbobjc.h",
"objectivec/google/protobuf/FieldMask.pbobjc.h",
"objectivec/google/protobuf/SourceContext.pbobjc.h",
"objectivec/google/protobuf/Struct.pbobjc.h",
"objectivec/google/protobuf/Timestamp.pbobjc.h",
"objectivec/google/protobuf/Type.pbobjc.h",
"objectivec/google/protobuf/Wrappers.pbobjc.h",
# Package private headers, but exposed because the generated sources
# need to use them.
"objectivec/GPBArray_PackagePrivate.h",
"objectivec/GPBCodedInputStream_PackagePrivate.h",
"objectivec/GPBCodedOutputStream_PackagePrivate.h",
"objectivec/GPBDescriptor_PackagePrivate.h",
"objectivec/GPBDictionary_PackagePrivate.h",
"objectivec/GPBMessage_PackagePrivate.h",
"objectivec/GPBRootObject_PackagePrivate.h",
"objectivec/GPBUnknownFieldSet_PackagePrivate.h",
"objectivec/GPBUnknownField_PackagePrivate.h",
"objectivec/GPBUtilities_PackagePrivate.h",
],
copts = [
"-Wno-vla",
],
includes = [
"objectivec",
],
non_arc_srcs = [
"objectivec/GPBAny.pbobjc.m",
"objectivec/GPBApi.pbobjc.m",
"objectivec/GPBDuration.pbobjc.m",
"objectivec/GPBEmpty.pbobjc.m",
"objectivec/GPBFieldMask.pbobjc.m",
"objectivec/GPBSourceContext.pbobjc.m",
"objectivec/GPBStruct.pbobjc.m",
"objectivec/GPBTimestamp.pbobjc.m",
"objectivec/GPBType.pbobjc.m",
"objectivec/GPBWrappers.pbobjc.m",
"objectivec/GPBArray.m",
"objectivec/GPBCodedInputStream.m",
"objectivec/GPBCodedOutputStream.m",
"objectivec/GPBDescriptor.m",
"objectivec/GPBDictionary.m",
"objectivec/GPBExtensionInternals.m",
"objectivec/GPBExtensionRegistry.m",
"objectivec/GPBMessage.m",
"objectivec/GPBRootObject.m",
"objectivec/GPBUnknownField.m",
"objectivec/GPBUnknownFieldSet.m",
"objectivec/GPBUtilities.m",
"objectivec/GPBWellKnownTypes.m",
"objectivec/GPBWireFormat.m",
],
actual = "//objectivec",
visibility = ["//visibility:public"],
)

Expand Down
90 changes: 90 additions & 0 deletions objectivec/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
load("@rules_cc//cc:defs.bzl", "objc_library")

objc_library(
name = "objectivec",
hdrs = [
"GPBAny.pbobjc.h",
"GPBApi.pbobjc.h",
"GPBDuration.pbobjc.h",
"GPBEmpty.pbobjc.h",
"GPBFieldMask.pbobjc.h",
"GPBSourceContext.pbobjc.h",
"GPBStruct.pbobjc.h",
"GPBTimestamp.pbobjc.h",
"GPBType.pbobjc.h",
"GPBWrappers.pbobjc.h",
"GPBArray.h",
"GPBBootstrap.h",
"GPBCodedInputStream.h",
"GPBCodedOutputStream.h",
"GPBDescriptor.h",
"GPBDictionary.h",
"GPBExtensionInternals.h",
"GPBExtensionRegistry.h",
"GPBMessage.h",
"GPBProtocolBuffers.h",
"GPBProtocolBuffers_RuntimeSupport.h",
"GPBRootObject.h",
"GPBRuntimeTypes.h",
"GPBUnknownField.h",
"GPBUnknownFieldSet.h",
"GPBUtilities.h",
"GPBWellKnownTypes.h",
"GPBWireFormat.h",
"google/protobuf/Any.pbobjc.h",
"google/protobuf/Api.pbobjc.h",
"google/protobuf/Duration.pbobjc.h",
"google/protobuf/Empty.pbobjc.h",
"google/protobuf/FieldMask.pbobjc.h",
"google/protobuf/SourceContext.pbobjc.h",
"google/protobuf/Struct.pbobjc.h",
"google/protobuf/Timestamp.pbobjc.h",
"google/protobuf/Type.pbobjc.h",
"google/protobuf/Wrappers.pbobjc.h",
# Package private headers, but exposed because the generated sources
# need to use them.
"GPBArray_PackagePrivate.h",
"GPBCodedInputStream_PackagePrivate.h",
"GPBCodedOutputStream_PackagePrivate.h",
"GPBDescriptor_PackagePrivate.h",
"GPBDictionary_PackagePrivate.h",
"GPBMessage_PackagePrivate.h",
"GPBRootObject_PackagePrivate.h",
"GPBUnknownFieldSet_PackagePrivate.h",
"GPBUnknownField_PackagePrivate.h",
"GPBUtilities_PackagePrivate.h",
],
copts = [
"-Wno-vla",
],
includes = [
".",
],
non_arc_srcs = [
"GPBAny.pbobjc.m",
"GPBApi.pbobjc.m",
"GPBDuration.pbobjc.m",
"GPBEmpty.pbobjc.m",
"GPBFieldMask.pbobjc.m",
"GPBSourceContext.pbobjc.m",
"GPBStruct.pbobjc.m",
"GPBTimestamp.pbobjc.m",
"GPBType.pbobjc.m",
"GPBWrappers.pbobjc.m",
"GPBArray.m",
"GPBCodedInputStream.m",
"GPBCodedOutputStream.m",
"GPBDescriptor.m",
"GPBDictionary.m",
"GPBExtensionInternals.m",
"GPBExtensionRegistry.m",
"GPBMessage.m",
"GPBRootObject.m",
"GPBUnknownField.m",
"GPBUnknownFieldSet.m",
"GPBUtilities.m",
"GPBWellKnownTypes.m",
"GPBWireFormat.m",
],
visibility = ["//visibility:public"],
)

0 comments on commit 132274f

Please sign in to comment.