• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# This file describes to Cocoapods how to integrate the Objective-C runtime into a dependent
2# project.
3# Despite this file being specific to Objective-C, it needs to be on the root of the repository.
4# Otherwise, Cocoapods gives trouble like not picking up the license file correctly, or not letting
5# dependent projects use the :git notation to refer to the library.
6Pod::Spec.new do |s|
7  s.name     = 'Protobuf'
8  s.version  = '3.29.4'
9  s.summary  = 'Protocol Buffers v.3 runtime library for Objective-C.'
10  s.homepage = 'https://github.com/protocolbuffers/protobuf'
11  s.license  = 'BSD-3-Clause'
12  s.authors  = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
13
14  # Ensure developers won't hit CocoaPods/CocoaPods#11402 with the resource
15  # bundle for the privacy manifest.
16  s.cocoapods_version = '>= 1.12.0'
17
18  s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git',
19               :tag => "v#{s.version}" }
20
21  s.source_files = 'objectivec/*.{h,m,swift}',
22                   'objectivec/google/protobuf/Any.pbobjc.h',
23                   'objectivec/google/protobuf/Api.pbobjc.h',
24                   'objectivec/google/protobuf/Duration.pbobjc.h',
25                   'objectivec/google/protobuf/Empty.pbobjc.h',
26                   'objectivec/google/protobuf/FieldMask.pbobjc.h',
27                   'objectivec/google/protobuf/SourceContext.pbobjc.h',
28                   'objectivec/google/protobuf/Struct.pbobjc.h',
29                   'objectivec/google/protobuf/Timestamp.pbobjc.h',
30                   'objectivec/google/protobuf/Type.pbobjc.h',
31                   'objectivec/google/protobuf/Wrappers.pbobjc.h'
32  # The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be
33  # left out, as it's an umbrella implementation file.
34  s.exclude_files = 'objectivec/GPBProtocolBuffers.m'
35
36  # Now that there is a Swift source file, set a version.
37  s.swift_version = '5.0'
38
39  s.resource_bundle = {
40    "Protobuf_Privacy" => "PrivacyInfo.xcprivacy"
41  }
42
43  # Set a CPP symbol so the code knows to use framework imports.
44  s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
45  s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
46
47  s.ios.deployment_target = '10.0'
48  s.osx.deployment_target = '10.13'
49  s.tvos.deployment_target = '12.0'
50  s.watchos.deployment_target = '6.0'
51  s.visionos.deployment_target = '1.0'
52  s.requires_arc = false
53
54  # The unittest need the generate sources from the testing related .proto
55  # files. So to add a `test_spec`, there would also need to be something like a
56  # `script_phases` to generate them, but there would also need to be a way to
57  # ensure `protoc` had be built. Another option would be to move to a model
58  # where the needed files are always generated and checked in. Neither of these
59  # seem that great at the moment, so the tests have *not* been wired into here
60  # at this time.
61end
62